airflow.providers.opsgenie.operators.opsgenie

Module Contents

Classes

OpsgenieCreateAlertOperator

This operator allows you to post alerts to Opsgenie.

OpsgenieCloseAlertOperator

This operator allows you to close alerts to Opsgenie.

OpsgenieDeleteAlertOperator

This operator allows you to delete alerts in Opsgenie.

class airflow.providers.opsgenie.operators.opsgenie.OpsgenieCreateAlertOperator(*, message, opsgenie_conn_id='opsgenie_default', alias=None, description=None, responders=None, visible_to=None, actions=None, tags=None, details=None, entity=None, source=None, priority=None, user=None, note=None, **kwargs)[source]

Bases: airflow.models.BaseOperator

This operator allows you to post alerts to Opsgenie. Accepts a connection that has an Opsgenie API key as the connection's password. This operator sets the domain to conn_id.host, and if not set will default to https://api.opsgenie.com.

Each Opsgenie API key can be pre-configured to a team integration. You can override these defaults in this operator.

See also

For more information on how to use this operator, take a look at the guide: OpsgenieCreateAlertOperator

Parameters
  • opsgenie_conn_id (str) -- The name of the Opsgenie connection to use

  • message (str) -- The Message of the Opsgenie alert (templated)

  • alias (Optional[str]) -- Client-defined identifier of the alert (templated)

  • description (Optional[str]) -- Description field of the alert (templated)

  • responders (Optional[List[dict]]) -- Teams, users, escalations and schedules that the alert will be routed to send notifications.

  • visible_to (Optional[List[dict]]) -- Teams and users that the alert will become visible to without sending any notification.

  • actions (Optional[List[str]]) -- Custom actions that will be available for the alert.

  • tags (Optional[List[str]]) -- Tags of the alert.

  • details (Optional[dict]) -- Map of key-value pairs to use as custom properties of the alert.

  • entity (Optional[str]) -- Entity field of the alert that is generally used to specify which domain alert is related to. (templated)

  • source (Optional[str]) -- Source field of the alert. Default value is IP address of the incoming request.

  • priority (Optional[str]) -- Priority level of the alert. Default value is P3. (templated)

  • user (Optional[str]) -- Display name of the request owner.

  • note (Optional[str]) -- Additional note that will be added while creating the alert. (templated)

template_fields :Sequence[str] = ['message', 'alias', 'description', 'entity', 'priority', 'note'][source]
execute(self, context)[source]

Call the OpsgenieAlertHook to post message

class airflow.providers.opsgenie.operators.opsgenie.OpsgenieCloseAlertOperator(*, identifier, opsgenie_conn_id='opsgenie_default', identifier_type=None, user=None, note=None, source=None, close_alert_kwargs=None, **kwargs)[source]

Bases: airflow.models.BaseOperator

This operator allows you to close alerts to Opsgenie. Accepts a connection that has an Opsgenie API key as the connection's password. This operator sets the domain to conn_id.host, and if not set will default to https://api.opsgenie.com.

Each Opsgenie API key can be pre-configured to a team integration. You can override these defaults in this operator.

See also

For more information on how to use this operator, take a look at the guide: OpsgenieCloseAlertOperator

Parameters
  • opsgenie_conn_id (str) -- The name of the Opsgenie connection to use

  • identifier (str) -- Identifier of alert which could be alert id, tiny id or alert alias

  • identifier_type (Optional[str]) -- Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny'

  • user (Optional[str]) -- display name of the request owner

  • note (Optional[str]) -- additional note that will be added while creating the alert

  • source (Optional[str]) -- source field of the alert. Default value is IP address of the incoming request

  • close_alert_kwargs (Optional[dict]) -- additional params to pass

execute(self, context)[source]

Call the OpsgenieAlertHook to close alert

class airflow.providers.opsgenie.operators.opsgenie.OpsgenieDeleteAlertOperator(*, identifier, opsgenie_conn_id='opsgenie_default', identifier_type=None, user=None, source=None, **kwargs)[source]

Bases: airflow.models.BaseOperator

This operator allows you to delete alerts in Opsgenie. Accepts a connection that has an Opsgenie API key as the connection's password. This operator sets the domain to conn_id.host, and if not set will default to https://api.opsgenie.com.

Each Opsgenie API key can be pre-configured to a team integration. You can override these defaults in this operator.

See also

For more information on how to use this operator, take a look at the guide: OpsgenieDeleteAlertOperator

Parameters
  • opsgenie_conn_id (str) -- The name of the Opsgenie connection to use

  • identifier (str) -- Identifier of alert which could be alert id, tiny id or alert alias

  • identifier_type (Optional[str]) -- Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny'

  • user (Optional[str]) -- Display name of the request owner

  • source (Optional[str]) -- Display name of the request source

template_fields :Sequence[str] = ['identifier'][source]
execute(self, context)[source]

Call the OpsgenieAlertHook to delete alert

Was this entry helpful?