blob: 48ba35339b667245d9fc00d36f02067a1fae3d89 [file] [log] [blame]
:py:mod:`airflow.providers.opsgenie.operators.opsgenie`
=======================================================
.. py:module:: airflow.providers.opsgenie.operators.opsgenie
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.providers.opsgenie.operators.opsgenie.OpsgenieCreateAlertOperator
airflow.providers.opsgenie.operators.opsgenie.OpsgenieCloseAlertOperator
airflow.providers.opsgenie.operators.opsgenie.OpsgenieDeleteAlertOperator
.. py:class:: 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)
Bases: :py:obj:`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.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:OpsgenieCreateAlertOperator`
:param opsgenie_conn_id: The name of the Opsgenie connection to use
:param message: The Message of the Opsgenie alert (templated)
:param alias: Client-defined identifier of the alert (templated)
:param description: Description field of the alert (templated)
:param responders: Teams, users, escalations and schedules that
the alert will be routed to send notifications.
:param visible_to: Teams and users that the alert will become visible
to without sending any notification.
:param actions: Custom actions that will be available for the alert.
:param tags: Tags of the alert.
:param details: Map of key-value pairs to use as custom properties of the alert.
:param entity: Entity field of the alert that is
generally used to specify which domain alert is related to. (templated)
:param source: Source field of the alert. Default value is
IP address of the incoming request.
:param priority: Priority level of the alert. Default value is P3. (templated)
:param user: Display name of the request owner.
:param note: Additional note that will be added while creating the alert. (templated)
.. py:attribute:: template_fields
:annotation: :Sequence[str] = ['message', 'alias', 'description', 'entity', 'priority', 'note']
.. py:method:: execute(self, context)
Call the OpsgenieAlertHook to post message
.. py:class:: OpsgenieCloseAlertOperator(*, identifier, opsgenie_conn_id = 'opsgenie_default', identifier_type = None, user = None, note = None, source = None, close_alert_kwargs = None, **kwargs)
Bases: :py:obj:`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.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:OpsgenieCloseAlertOperator`
:param opsgenie_conn_id: The name of the Opsgenie connection to use
:param identifier: Identifier of alert which could be alert id, tiny id or alert alias
:param identifier_type: Type of the identifier that is provided as an in-line parameter.
Possible values are 'id', 'alias' or 'tiny'
:param user: display name of the request owner
:param note: additional note that will be added while creating the alert
:param source: source field of the alert. Default value is IP address of the incoming request
:param close_alert_kwargs: additional params to pass
.. py:method:: execute(self, context)
Call the OpsgenieAlertHook to close alert
.. py:class:: OpsgenieDeleteAlertOperator(*, identifier, opsgenie_conn_id = 'opsgenie_default', identifier_type = None, user = None, source = None, **kwargs)
Bases: :py:obj:`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.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:OpsgenieDeleteAlertOperator`
:param opsgenie_conn_id: The name of the Opsgenie connection to use
:param identifier: Identifier of alert which could be alert id, tiny id or alert alias
:param identifier_type: Type of the identifier that is provided as an in-line parameter.
Possible values are 'id', 'alias' or 'tiny'
:param user: Display name of the request owner
:param source: Display name of the request source
.. py:attribute:: template_fields
:annotation: :Sequence[str] = ['identifier']
.. py:method:: execute(self, context)
Call the OpsgenieAlertHook to delete alert