metadata:
 name: deduced_state_for_host_alarms
definitions:
 entities:
  - entity:
     category: ALARM
     type: nagios
     name: cause_suboptimal_state
     severity: WARNING
     template_id: warning_alarm
  - entity:
     category: ALARM
     type: nagios
     name: cause_error_state
     severity: CRITICAL
     template_id: critical_alarm
  - entity:
     category: RESOURCE
     type: nova.host
     template_id: host
 relationships:
  - relationship:
     source: warning_alarm
     relationship_type: on
     target: host
     template_id : warning_alarm_on_host
  - relationship:
     source: critical_alarm
     relationship_type: on
     target: host
     template_id : critical_alarm_on_host
scenarios:
 - scenario:
    condition: warning_alarm_on_host
    actions:
     - action:
        action_type: set_state
        properties:
         state: SUBOPTIMAL
        action_target:
         target: host
 - scenario:
    condition: critical_alarm_on_host
    actions:
     - action:
        action_type: set_state
        properties:
         state: ERROR
        action_target:
         target: host
