# salt.states.telemetry_alert

## Manage Telemetry alert configurations

Added in version 2016.3.0.

Create, Update and destroy Mongo Telemetry alert configurations.

This module uses requests, which can be installed via package, or pip.

This module accepts explicit credential (telemetry api key) or can also read api key credentials from a pillar. Example:

    ensure telemetry alert X is defined on deployment Y:
        telemetry_alert.present:
            - deployment_id: "rs-XXXXXX"
            - metric_name: "testMetric"
            - alert_config:
               max: 1
               filter:  SERVER_ROLE_MONGOD_PRIMARY
               escalate_to: "example@pagerduty.com"
            - name: "**MANAGED BY ORCA DO NOT EDIT BY HAND** manages alarm on testMetric"

salt.states.telemetry_alert.absent(name, deployment_id, metric_name, api_key=None, profile='telemetry')

  Ensure the telemetry alert config is deleted

  name

    An optional description of the alarms (not currently supported by telemetry API)

  deployment_id

    Specifies the ID of the root deployment resource (replica set cluster or sharded cluster) to which this alert definition is attached

  metric_name

    Specifies the unique ID of the metric to whose values these thresholds will be applied

  api_key

    Telemetry api key for the user

  profile

    A dict with telemetry config data. If present, will be used instead of api_key.

salt.states.telemetry_alert.present(name, deployment_id, metric_name, alert_config, api_key=None, profile='telemetry')

  Ensure the telemetry alert exists.

  name

    An optional description of the alarm (not currently supported by telemetry API)

  deployment_id

    Specifies the ID of the root deployment resource (replica set cluster or sharded cluster) to which this alert definition is attached

  metric_name

    Specifies the unique ID of the metric to whose values these thresholds will be applied

  alert_config: Is a list of dictionaries where each dict contains the following fields:
    filter

      By default the alert will apply to the deployment and all its constituent resources. If the alert only applies to a subset of those resources, a filter may be specified to narrow this scope.

    min

      the smallest "ok" value the metric may take on; if missing or null, no minimum is enforced.

    max

      the largest "ok" value the metric may take on; if missing or null, no maximum is enforced.

    notify_all

      Used to indicate if you want to alert both onCallEngineer and apiNotifications

  api_key

    Telemetry api key for the user

  profile

    A dict of telemetry config information. If present, will be used instead of api_key.