Skip to main content
Version: 0.18.9

OpsgenieAlertAction

class great_expectations.checkpoint.OpsgenieAlertAction(data_context: AbstractDataContext, renderer: dict, api_key: str, region: Optional[str] = None, priority: str = 'P3', notify_on: str = 'failure', tags: Optional[list[str]] = None)#

Sends an Opsgenie alert.

- name: send_opsgenie_alert_on_validation_result
action:
class_name: OpsgenieAlertAction
# put the actual webhook URL in the uncommitted/config_variables.yml file
# or pass in as environment variable
api_key: ${opsgenie_api_key}
region:
priority: P2
notify_on: failure

Parameters
  • data_context – Data Context that is used by the Action.

  • api_key – Opsgenie API key.

  • region – Specifies the Opsgenie region. Populate 'EU' for Europe otherwise do not set.

  • priority – Specifies the priority of the alert (P1 - P5).

  • notify_on – Specifies validation status that triggers notification. One of "all", "failure", "success".

  • tags – Tags to include in the alert

run(validation_result_suite: ExpectationSuiteValidationResult, validation_result_suite_identifier: Union[ValidationResultIdentifier, GXCloudIdentifier], data_asset, expectation_suite_identifier: Optional[ExpectationSuiteIdentifier] = None, checkpoint_identifier=None, **kwargs)#

Public entrypoint GX uses to trigger a ValidationAction.

When a ValidationAction is configured in a Checkpoint, this method gets called after the Checkpoint produces an ExpectationSuiteValidationResult.

Parameters
  • validation_result_suite – An instance of the ExpectationSuiteValidationResult class.

  • validation_result_suite_identifier – an instance of either the ValidationResultIdentifier class (for open source Great Expectations) or the GXCloudIdentifier (from Great Expectations Cloud).

  • data_asset – An instance of the Validator class.

  • expectation_suite_identifier – Optionally, an instance of the ExpectationSuiteIdentifier class.

  • checkpoint_identifier – Optionally, an Identifier for the Checkpoint.

  • kwargs – named parameters that are specific to a given Action, and need to be assigned a value in the Action's configuration in a Checkpoint's action_list.

Returns

A Dict describing the result of the Action.