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 (str | None) – Client-defined identifier of the alert (templated)

  • description (str | None) – Description field of the alert (templated)

  • responders (list[dict] | None) – Teams, users, escalations and schedules that the alert will be routed to send notifications.

  • visible_to (list[dict] | None) – Teams and users that the alert will become visible to without sending any notification.

  • actions (list[str] | None) – Custom actions that will be available for the alert.

  • tags (list[str] | None) – Tags of the alert.

  • details (dict | None) – Map of key-value pairs to use as custom properties of the alert.

  • entity (str | None) – Entity field of the alert that is generally used to specify which domain alert is related to. (templated)

  • source (str | None) – Source field of the alert. Default value is IP address of the incoming request.

  • priority (str | None) – Priority level of the alert. Default value is P3. (templated)

  • user (str | None) – Display name of the request owner.

  • note (str | None) – Additional note that will be added while creating the alert. (templated)

template_fields: Sequence[str] = ('message', 'alias', 'description', 'entity', 'priority', 'note')[source]
execute(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 (str | None) – Type of the identifier that is provided as an in-line parameter. Possible values are ‘id’, ‘alias’ or ‘tiny’

  • user (str | None) – display name of the request owner

  • note (str | None) – additional note that will be added while creating the alert

  • source (str | None) – source field of the alert. Default value is IP address of the incoming request

  • close_alert_kwargs (dict | None) – additional params to pass

execute(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 (str | None) – Type of the identifier that is provided as an in-line parameter. Possible values are ‘id’, ‘alias’ or ‘tiny’

  • user (str | None) – Display name of the request owner

  • source (str | None) – Display name of the request source

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

Call the OpsgenieAlertHook to delete alert.

Was this entry helpful?