# (c) cavaliba.com 

# -------------------
# enumerate
# -------------------

- classname: _schema
  keyname: _enumerate
  _action: init
  is_enabled: yes
  displayname: Data Enumerates
  order: 810
  page: Admin
  _options:
      icon: fa-list
      handle_method: md5
      p_admin: p_enumerate_admin
      p_create: p_enumerate_create
      p_read: p_enumerate_read
      p_update: p_enumerate_update
      p_delete: p_enumerate_delete

  description:
    displayname: Description
    order: 100
    dataformat: string
  content:
    displayname: Content
    page: input
    order: 120
    dataformat: text
    dataformat_ext: yaml 

# -------------------
# pipeline
# -------------------


- classname: _schema
  keyname: _pipeline
  displayname: Data Pipelines
  _action: init
  is_enabled: yes
  order: 500
  page: Admin
  _options:
      icon: fa-gears
      handle_method: md5
      p_admin: p_pipeline_admin
      p_create: p_pipeline_create
      p_read: p_pipeline_read
      p_update: p_pipeline_update
      p_delete: p_pipeline_delete

  description:
    displayname: Description
    order: 100
    dataformat: string
  content:
    displayname: Content
    page: Content
    order: 100
    dataformat: text
    dataformat_ext: yaml



# -------------------
# dataview
# -------------------

- classname: _schema
  keyname: _dataview
  displayname: Data Views
  _action: init
  is_enabled: yes
  order: 810
  page: Admin
  _options:
      icon: fa-table
      handle_method: md5
      p_admin: p_dataview_admin
      p_create: p_dataview_create
      p_read: p_dataview_read
      p_update: p_dataview_update
      p_delete: p_dataview_delete
  
  description:
    displayname: Description
    order: 100
    dataformat: string
  target_class:
    displayname: Schema
    order: 110
    dataformat: string
  content:
    displayname: Content
    order: 120
    dataformat: text
    dataformat_ext: yaml



# --------------------------------------------
# apikey
# --------------------------------------------

- classname: _schema
  keyname: _apikey
  _action: init
  is_enabled: yes
  displayname: API Keys
  is_enabled: yes
  order: 820
  page: Admin

  _options:
      icon: fa-key
      handle_method: md5
      p_admin: p_apikey_admin
      p_create: p_apikey_create
      p_read: p_apikey_read
      p_update: p_apikey_update
      p_delete: p_apikey_delete

  keyvalue:
        displayname: Secret
        order: 50
        dataformat: string
  description:
        displayname: Description
        order: 60
        dataformat: string
        default : "API Key"
  is_readonly:
        displayname: Read-Only
        dataformat: boolean
        order: 70
        default: true
  permissions:
        order: 80
        displayname: Permissions
        dataformat: text
  not_after:
        displayname: Not After
        description: format YYYY-MM-DD
        dataformat: date
  time_filter:
        displayname: Time Filter
        dataformat: text
  ip_filter:
        displayname: IP Filter
        dataformat: text
        default : "*"
  acl_filter:
        displayname: ACL Filter
        cardinal_max: 0
        dataformat: text
  last_success:
        displayname: Last Success
        description: format YYYY-MM-DD
        dataformat: date
  last_error:
        displayname: Last Error
        description: format YYYY-MM-DD
        dataformat: date
  success_count:
        displayname: Success Count
        dataformat: int
  error_count:
        displayname: Error Count
        dataformat: int


# --------------------------------------------
# site
# --------------------------------------------

- classname: _schema
  keyname: site
  displayname: Sites
  _action: init
  is_enabled: yes
  order: 50
  page: Data

  _options:
      icon: fa-hospital-o
      handle_method: md5
      p_admin: p_data_site_admin
      p_create: p_data_site_create
      p_read: p_data_site_read
      p_update: p_data_site_update
      p_delete: p_data_site_delete

  description:
      displayname: Description
      order: 100
      dataformat: string

  notify_user:
      displayname: Notify (Users)
      page: Notifications
      order: 200
      dataformat: user
      cardinal_max: 0

  notify_group:
      displayname: Notify (Groups)
      page: Notifications
      order: 210
      dataformat: group
      cardinal_max: 0        

  notify_app:      
      displayname: Notify (Apps)
      page: Notifications
      order: 220
      dataformat: schema
      dataformat_ext: app
      cardinal_max: 0


# --------------------------------------------
# app
# --------------------------------------------

- classname: _schema
  keyname: app
  displayname: Applications
  _action: init
  is_enabled: yes
  order: 60
  page: Data

  _options:
      icon: fa-window-maximize
      handle_method: md5
      p_admin: p_data_app_admin
      p_create: p_data_app_create
      p_read: p_data_app_read
      p_update: p_data_app_update
      p_delete: p_data_app_delete

  description:
      displayname: Description
      order: 100
      dataformat: string

  notify_user:
      displayname: Notify (Users)
      page: Notifications
      order: 200
      dataformat: user
      cardinal_max: 0

  notify_group:
      displayname: Notify (Groups)
      page: Notifications
      order: 210
      dataformat: group
      cardinal_max: 0


# --------------------------------------------
# sitegroup
# --------------------------------------------

- classname: _schema
  keyname: sitegroup
  displayname: Groups of Sites
  _action: init
  is_enabled: yes
  order: 70
  page: Data

  _options:
      icon: fa-university
      handle_method: md5
      p_admin: p_data_sitegroup_admin
      p_create: p_data_sitegroup_create
      p_read: p_data_sitegroup_read
      p_update: p_data_sitegroup_update
      p_delete: p_data_sitegroup_delete

  description:
      displayname: Description
      order: 100
      dataformat: string

  members:
      displayname: Members (Sites)
      page: Sirene
      order: 110
      dataformat: schema
      dataformat_ext: site
      cardinal_max: 0

  notify_user:
      displayname: Notify (Users)
      page: Notifications
      order: 200
      dataformat: user
      cardinal_max: 0

  notify_group:
      displayname: Notify (Groups)
      page: Notifications
      order: 210
      dataformat: group
      cardinal_max: 0








# ---------------------------------------- 
# Sirene Public
# ---------------------------------------- 

- classname: _schema
  keyname: sirene_public
  _action: init
  is_enabled: True
  displayname: Public Pages
  order: 310
  page: Sirene

  _options:
      icon: fa-globe
      handle_method: md5
      p_admin: p_data_sirene_public_admin
      p_create: p_data_sirene_public_create
      p_read: p_data_sirene_public_read
      p_update: p_data_sirene_public_update
      p_delete: p_data_sirene_public_delete

  description:
    displayname: Description
    order: 100
    dataformat: string
  is_default:
    displayname: Default
    order: 110
    dataformat: boolean
  severity:
    displayname: Severity
    order: 120
    dataformat: enumerate
    dataformat_ext: sirene_severity
  bgcolor:
    displayname: Background Color
    order: 130
    dataformat: string
  fgcolor:
    displayname: Text Color
    order: 140
    dataformat: string
  content:
    displayname: Content
    order: 200
    dataformat: text
    dataformat_ext: html


# ---------------------------------------- 
# Sirene Message
# ---------------------------------------- 

- classname: _schema
  keyname: sirene_message
  _action: init
  is_enabled: True
  displayname: Messages
  order: 999
  page: Internal

  _options:
      icon: fa-file
      handle_method: keyname
      p_admin: p_data_sirene_message_admin
      p_create: p_data_sirene_message_create
      p_read: p_data_sirene_message_read
      p_update: p_data_sirene_message_update
      p_delete: p_data_sirene_message_delete


  template:
    displayname: Template
    description: Source Template
    page: Information
    order: 105
    dataformat: string

  category:
    displayname: Category
    page: Information
    order: 110
    dataformat: enumerate
    dataformat_ext: sirene_category

  severity:
    displayname: Severity
    page: Information
    order: 120
    dataformat: enumerate
    dataformat_ext: sirene_severity

  public_page:
    displayname: Public Page
    page: Channels
    order: 130
    dataformat: schema
    dataformat_ext: sirene_public

  is_restricted:
    displayname: Restricted
    page: Channels
    order: 140
    dataformat: boolean

  has_email:
    displayname: Email
    page: Channels
    order: 150
    dataformat: boolean
    default: True

  has_sms:
    displayname: SMS
    page: Channels
    order: 160
    dataformat: boolean
    default: False


  notify_user:
    displayname: Notify Users
    page: Notify to
    order: 210
    dataformat: user
    cardinal_max: 0

  notify_group:
    displayname: Notify Groups
    page: Notify to
    order: 220
    dataformat: group
    cardinal_max: 0

  notify_app:
    displayname: Notify App
    page: Notify to
    order: 230
    dataformat: schema
    dataformat_ext: app
    cardinal_max: 0

  notify_site:
    displayname: Notify site
    page: Notify to
    order: 240
    dataformat: schema
    dataformat_ext: site
    cardinal_max: 0

  notified_username:
    displayname: All notified users
    page: Notify to
    order: 290
    dataformat: string
    cardinal_max: 0

#  Lifecycle

  created_at:
    displayname: Created
    page: Lifecycle
    order: 300
    dataformat: datetime
    
  created_by:
    displayname: Created by
    page: Lifecycle
    order: 310
    dataformat: user

  updated_at:
    displayname: Updated
    page: Lifecycle
    order: 320
    dataformat: datetime
    
  updated_by:
    displayname: Updated by
    page: Lifecycle
    order: 330
    dataformat: user


  removed_at:
    displayname: Removed
    page: Lifecycle
    order: 340
    dataformat: datetime
    
  removed_by:
    displayname: Removed by
    page: Lifecycle
    order: 350
    dataformat: user

  email_count:
    displayname: Emails
    page: Lifecycle
    order: 360
    dataformat: int

  sms_count:
    displayname: SMS
    page: Lifecycle
    order: 362
    dataformat: int


# -- Content

  content:
    displayname: Content
    page: Content
    order: 400
    dataformat: text
    dataformat_ext: html

  update:
    displayname: Update(s)
    page: Content
    order: 410
    dataformat: text
    dataformat_ext: json


# ---------------------------------------- 
# Sirene Template
# ---------------------------------------- 

- classname: _schema
  keyname: sirene_template
  displayname: Sirene Templates
  _action: init
  is_enabled: True
  order: 300
  page: Sirene

  _options:
      icon: fa-check-square
      handle_method: md5
      p_admin: p_data_sirene_template_admin
      p_create: p_data_sirene_template_create
      p_read: p_data_sirene_template_read
      p_update: p_data_sirene_template_update
      p_delete: p_data_sirene_template_delete

  hint:
    displayname: Hint
    page: Information
    order: 100
    dataformat: string

  category:
    displayname: Category
    page: Information
    order: 110
    dataformat: enumerate
    dataformat_ext: sirene_category

  severity:
    displayname: Severity
    page: Information
    order: 120
    dataformat: enumerate
    dataformat_ext: sirene_severity

  public_page:
    displayname: Public Page
    page: Channels
    order: 130
    dataformat: schema
    dataformat_ext: sirene_public

  is_restricted:
    displayname: Restricted
    page: Channels
    order: 140
    dataformat: boolean

  has_email:
    displayname: Email
    page: Channels
    order: 150
    dataformat: boolean
    default: True

  has_sms:
    displayname: SMS
    page: Channels
    order: 160
    dataformat: boolean
    default: False

  notify_user:
    displayname: Notify Users
    page: Notify to
    order: 310
    dataformat: user
    cardinal_max: 0

  notify_group:
    displayname: Notify Groups
    page: Notify to
    order: 320
    dataformat: group
    cardinal_max: 0

  notify_app:
    displayname: Notify App
    page: Notify to
    order: 330
    dataformat: schema
    dataformat_ext: app
    cardinal_max: 0

  notify_site:
    displayname: Notify site
    page: Notify to
    order: 340
    dataformat: schema
    dataformat_ext: site
    cardinal_max: 0

  content:
    displayname: Content
    page: Content
    order: 400
    dataformat: text
    dataformat_ext: html



# ---------------------------------
# schema: status_monitor
# ---------------------------------

- classname: _schema
  keyname: status_monitor
  displayname: Status Monitor
  is_enabled: True
  _action: init
  order: 600
  page: Status
  
  _options:
      icon: fa-tasks
      handle_method: md5
      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



# ---------------------------------
# IPAM subnet
# ---------------------------------

- classname: _schema
  keyname: ipam_subnet
  displayname: IPAM IPv4 Subnet
  is_enabled: yes
  order: 80
  page: Data

  _options:
      icon: fa-map-marker
      handle_method: ipv4
      p_admin: p_ipam_admin
      p_create: p_ipam_write
      p_read: p_ipam_read
      p_update: p_ipam_write
      p_delete: p_ipam_write

  description:
      displayname: Description
      dataformat: string

  subnet:
      displayname: IPv4 Subnet
      description: 'Format A.B.C.D/E valid IP V4 subnet'
      dataformat: ipv4
      dataformat_ext: ipv4
      dataformat_ext: subnet strict

# ---------------------------------
# IPAM vlan
# ---------------------------------

- classname: _schema
  keyname: ipam_vlan
  displayname: IPAM VLANs
  is_enabled: yes
  order: 81
  page: Data

  _options:
      icon: fa-street-view
      handle_method: md5
      p_admin: p_ipam_admin
      p_create: p_ipam_write
      p_read: p_ipam_read
      p_update: p_ipam_write
      p_delete: p_ipam_write

  description:
      displayname: Description
      dataformat: string

  vlan_id:
      displayname: VLAN ID
      description: VLAN ID (integer)
      dataformat: int

  vlan_family:
      displayname: VLAN Family
      description: VLAN Family
      dataformat: enumerate
      dataformat_ext: ipam_vlan_family

  subnet:
      displayname: IP Subnet
      description: 0 or more IP subnets
      dataformat: schema
      dataformat_ext: ipam_subnet
      cardinal_max: 0
