Skip to main content
Version: 1.0 prerelease

OpsgenieAlertAction

class great_expectations.checkpoint.OpsgenieAlertAction(*, type: Literal['opsgenie'] = 'opsgenie', notify_on: Literal['all', 'failure', 'success'] = 'failure', api_key: str, region: Optional[str] = None, priority: Literal['P1', 'P2', 'P3', 'P4', 'P5'] = 'P3', tags: Optional[List[str]] = None, renderer: great_expectations.render.renderer.opsgenie_renderer.OpsgenieRenderer = 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:
  • 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], 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).

  • 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.