salt.states.opsgenie

Create/Close an alert in OpsGenie

New in version 2018.3.0.

This state is useful for creating or closing alerts in OpsGenie during state runs.

used_space:
  disk.status:
    - name: /
    - maximum: 79%
    - minimum: 20%

opsgenie_create_action_sender:
  opsgenie.create_alert:
    - api_key: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
    - reason: 'Disk capacity is out of designated range.'
    - name: disk.status
    - onfail:
      - disk: used_space

opsgenie_close_action_sender:
  opsgenie.close_alert:
    - api_key: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
    - name: disk.status
    - require:
      - disk: used_space
salt.states.opsgenie.close_alert(name=None, api_key=None, reason='Conditions are met.', action_type='Close')

Close an alert in OpsGenie. It's a wrapper function for create_alert. Example usage with Salt's requisites and other global state arguments could be found above.

Required Parameters:

name

It will be used as alert's alias. If you want to use the close functionality you must provide name field for both states like in above case.

Optional Parameters:

api_key

It's the API Key you've copied while adding integration in OpsGenie.

reason

It will be used as alert's default message in OpsGenie.

action_type

OpsGenie supports the default values Create/Close for action_type. You can customize this field with OpsGenie's custom actions for other purposes like adding notes or acknowledging alerts.

salt.states.opsgenie.create_alert(name=None, api_key=None, reason=None, action_type='Create')

Create an alert in OpsGenie. Example usage with Salt's requisites and other global state arguments could be found above.

Required Parameters:

api_key

It's the API Key you've copied while adding integration in OpsGenie.

reason

It will be used as alert's default message in OpsGenie.

Optional Parameters:

name

It will be used as alert's alias. If you want to use the close functionality you must provide name field for both states like in above case.

action_type

OpsGenie supports the default values Create/Close for action_type. You can customize this field with OpsGenie's custom actions for other purposes like adding notes or acknowledging alerts.