Amazon CloudWatch

2020/01/20 - Amazon CloudWatch - 1 updated api methods

Changes  Updating DescribeAnomalyDetectors API to return AnomalyDetector Status value in response.

DescribeAnomalyDetectors (updated) Link ΒΆ
Changes (response)
{'AnomalyDetectors': {'StateValue': 'PENDING_TRAINING | '
                                    'TRAINED_INSUFFICIENT_DATA | TRAINED'}}

Lists the anomaly detection models that you have created in your account. You can list all models in your account or filter the results to only the models that are related to a certain namespace, metric name, or metric dimension.

See also: AWS API Documentation

Request Syntax

client.describe_anomaly_detectors(
    NextToken='string',
    MaxResults=123,
    Namespace='string',
    MetricName='string',
    Dimensions=[
        {
            'Name': 'string',
            'Value': 'string'
        },
    ]
)
type NextToken

string

param NextToken

Use the token returned by the previous operation to request the next page of results.

type MaxResults

integer

param MaxResults

The maximum number of results to return in one operation. The maximum value you can specify is 10.

To retrieve the remaining results, make another call with the returned NextToken value.

type Namespace

string

param Namespace

Limits the results to only the anomaly detection models that are associated with the specified namespace.

type MetricName

string

param MetricName

Limits the results to only the anomaly detection models that are associated with the specified metric name. If there are multiple metrics with this name in different namespaces that have anomaly detection models, they're all returned.

type Dimensions

list

param Dimensions

Limits the results to only the anomaly detection models that are associated with the specified metric dimensions. If there are multiple metrics that have these dimensions and have anomaly detection models associated, they're all returned.

  • (dict) --

    Expands the identity of a metric.

    • Name (string) -- [REQUIRED]

      The name of the dimension.

    • Value (string) -- [REQUIRED]

      The value representing the dimension measurement.

rtype

dict

returns

Response Syntax

{
    'AnomalyDetectors': [
        {
            'Namespace': 'string',
            'MetricName': 'string',
            'Dimensions': [
                {
                    'Name': 'string',
                    'Value': 'string'
                },
            ],
            'Stat': 'string',
            'Configuration': {
                'ExcludedTimeRanges': [
                    {
                        'StartTime': datetime(2015, 1, 1),
                        'EndTime': datetime(2015, 1, 1)
                    },
                ],
                'MetricTimezone': 'string'
            },
            'StateValue': 'PENDING_TRAINING'|'TRAINED_INSUFFICIENT_DATA'|'TRAINED'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • AnomalyDetectors (list) --

      The list of anomaly detection models returned by the operation.

      • (dict) --

        An anomaly detection model associated with a particular CloudWatch metric and statistic. You can use the model to display a band of expected normal values when the metric is graphed.

        • Namespace (string) --

          The namespace of the metric associated with the anomaly detection model.

        • MetricName (string) --

          The name of the metric associated with the anomaly detection model.

        • Dimensions (list) --

          The metric dimensions associated with the anomaly detection model.

          • (dict) --

            Expands the identity of a metric.

            • Name (string) --

              The name of the dimension.

            • Value (string) --

              The value representing the dimension measurement.

        • Stat (string) --

          The statistic associated with the anomaly detection model.

        • Configuration (dict) --

          The configuration specifies details about how the anomaly detection model is to be trained, including time ranges to exclude from use for training the model, and the time zone to use for the metric.

          • ExcludedTimeRanges (list) --

            An array of time ranges to exclude from use when the anomaly detection model is trained. Use this to make sure that events that could cause unusual values for the metric, such as deployments, aren't used when CloudWatch creates the model.

            • (dict) --

              Specifies one range of days or times to exclude from use for training an anomaly detection model.

              • StartTime (datetime) --

                The start time of the range to exclude. The format is yyyy-MM-dd'T'HH:mm:ss . For example, 2019-07-01T23:59:59 .

              • EndTime (datetime) --

                The end time of the range to exclude. The format is yyyy-MM-dd'T'HH:mm:ss . For example, 2019-07-01T23:59:59 .

          • MetricTimezone (string) --

            The time zone to use for the metric. This is useful to enable the model to automatically account for daylight savings time changes if the metric is sensitive to such time changes.

            To specify a time zone, use the name of the time zone as specified in the standard tz database. For more information, see tz database .

        • StateValue (string) --

          The current status of the anomaly detector's training. The possible values are TRAINED | PENDING_TRAINING | TRAINED_INSUFFICIENT_DATA

    • NextToken (string) --

      A token that you can use in a subsequent operation to retrieve the next set of results.