# (c) cavaliba.com

#  STATUS

# -----------------------------------
# status permissions
# -----------------------------------

- classname: _permission
  keyname: p_status_access
  description: "STATUS access"
  displayname: p_status_access
  
- classname: _permission
  keyname: p_status_read
  description: "STATUS read"
  displayname: p_status_read
  
- classname: _permission
  keyname: p_status_write
  description: "STATUS write"
  displayname: p_status_write
  
- classname: _permission
  keyname: p_status_admin
  description: "STATUS admin"
  displayname: p_status_admin
  
# API/Poller
- classname: _permission
  keyname: p_status_poller
  description: "STATUS Worklist/Workresponse pollers"
  displayname: p_status_poller


# ---------------------------------------
# status enumerate
# ---------------------------------------
- classname: _enumerate
  keyname: status_monitor_type
  is_enabled: True
  _action: init
  displayname: "Status Monitor Types"
  description: "Status Monitor Types"
  content: |
    - value: "HTTP"
    - value: "TCP"
    - value: "PING"


# ---------------------------------
# status schema
# ---------------------------------

- classname: _schema
  keyname: status_monitor
  displayname: Status Monitor
  is_enabled: True
  _action: init
  order: 600
  page: Status
  
  _options:
      icon: fa-tasks
      p_admin: p_status_admin
      p_create: p_status_write
      p_read: p_status_read
      p_update: p_status_write
      p_delete: p_status_write


  app:      
      displayname: Application
      page: Monitor
      order: 100
      dataformat: schema
      dataformat_ext: app

  type:
      displayname: Type
      page: Monitor
      order: 110
      dataformat: enumerate
      dataformat_ext: status_monitor_type

  target:
      displayname: Target
      page: Monitor
      order: 120
      dataformat: string

  http_code:
      displayname: Expected Status
      page: Monitor
      order: 130
      dataformat: int

  pattern:
      displayname: Expected Pattern
      page: Monitor
      order: 140
      dataformat: string

  timeout:
      displayname: Timeout (msec)
      page: Monitor
      order: 150
      dataformat: int

  schedule:
      displayname: Schedule (sec)
      page: Monitor
      order: 160
      dataformat: int


# ---------------------------------------- 
# status dataview 
# ---------------------------------------- 


- classname: _dataview
  keyname: status_monitor_default
  displayname: Status Monitor Default
  is_enabled: True
  _action: init
  description: Status Monitors
  target_class: status_monitor
  content: |
    columns:
        - keyname
        - displayname
        - app
        - type
        - target
        - http_code
        - pattern 
        - timeout
        - schedule 


# ---------------------------------------- 
# status dashboard
# ---------------------------------------- 

- classname: _home
  keyname: status
  displayname: Status Monitor
  description: Status Monitor
  icon: fa-tasks
  url: /appstatus/private/
  dashboard_section: Services
  sidebar_section: Services
  order: 40
  permission: p_status_access
  _action: init
