AWS Cost Explorer Service

2022/12/07 - AWS Cost Explorer Service - 1 updated api methods

Changes  This release adds the LinkedAccountName field to the GetAnomalies API response under RootCause

GetAnomalies (updated) Link ΒΆ
Changes (response)
{'Anomalies': {'RootCauses': {'LinkedAccountName': 'string'}}}

Retrieves all of the cost anomalies detected on your account during the time period that's specified by the DateInterval object.

See also: AWS API Documentation

Request Syntax

client.get_anomalies(
    MonitorArn='string',
    DateInterval={
        'StartDate': 'string',
        'EndDate': 'string'
    },
    Feedback='YES'|'NO'|'PLANNED_ACTIVITY',
    TotalImpact={
        'NumericOperator': 'EQUAL'|'GREATER_THAN_OR_EQUAL'|'LESS_THAN_OR_EQUAL'|'GREATER_THAN'|'LESS_THAN'|'BETWEEN',
        'StartValue': 123.0,
        'EndValue': 123.0
    },
    NextPageToken='string',
    MaxResults=123
)
type MonitorArn:

string

param MonitorArn:

Retrieves all of the cost anomalies detected for a specific cost anomaly monitor Amazon Resource Name (ARN).

type DateInterval:

dict

param DateInterval:

[REQUIRED]

Assigns the start and end dates for retrieving cost anomalies. The returned anomaly object will have an AnomalyEndDate in the specified time range.

  • StartDate (string) -- [REQUIRED]

    The first date an anomaly was observed.

  • EndDate (string) --

    The last date an anomaly was observed.

type Feedback:

string

param Feedback:

Filters anomaly results by the feedback field on the anomaly object.

type TotalImpact:

dict

param TotalImpact:

Filters anomaly results by the total impact field on the anomaly object. For example, you can filter anomalies GREATER_THAN 200.00 to retrieve anomalies, with an estimated dollar impact greater than 200.

  • NumericOperator (string) -- [REQUIRED]

    The comparing value that's used in the filter.

  • StartValue (float) -- [REQUIRED]

    The lower bound dollar value that's used in the filter.

  • EndValue (float) --

    The upper bound dollar value that's used in the filter.

type NextPageToken:

string

param NextPageToken:

The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.

type MaxResults:

integer

param MaxResults:

The number of entries a paginated response contains.

rtype:

dict

returns:

Response Syntax

{
    'Anomalies': [
        {
            'AnomalyId': 'string',
            'AnomalyStartDate': 'string',
            'AnomalyEndDate': 'string',
            'DimensionValue': 'string',
            'RootCauses': [
                {
                    'Service': 'string',
                    'Region': 'string',
                    'LinkedAccount': 'string',
                    'UsageType': 'string',
                    'LinkedAccountName': 'string'
                },
            ],
            'AnomalyScore': {
                'MaxScore': 123.0,
                'CurrentScore': 123.0
            },
            'Impact': {
                'MaxImpact': 123.0,
                'TotalImpact': 123.0
            },
            'MonitorArn': 'string',
            'Feedback': 'YES'|'NO'|'PLANNED_ACTIVITY'
        },
    ],
    'NextPageToken': 'string'
}

Response Structure

  • (dict) --

    • Anomalies (list) --

      A list of cost anomalies.

      • (dict) --

        An unusual cost pattern. This consists of the detailed metadata and the current status of the anomaly object.

        • AnomalyId (string) --

          The unique identifier for the anomaly.

        • AnomalyStartDate (string) --

          The first day the anomaly is detected.

        • AnomalyEndDate (string) --

          The last day the anomaly is detected.

        • DimensionValue (string) --

          The dimension for the anomaly (for example, an Amazon Web Service in a service monitor).

        • RootCauses (list) --

          The list of identified root causes for the anomaly.

          • (dict) --

            The combination of Amazon Web Service, linked account, linked account name, Region, and usage type where a cost anomaly is observed. The linked account name will only be available when the account name can be identified.

            • Service (string) --

              The Amazon Web Service name that's associated with the cost anomaly.

            • Region (string) --

              The Amazon Web Services Region that's associated with the cost anomaly.

            • LinkedAccount (string) --

              The member account value that's associated with the cost anomaly.

            • UsageType (string) --

              The UsageType value that's associated with the cost anomaly.

            • LinkedAccountName (string) --

              The member account name value that's associated with the cost anomaly.

        • AnomalyScore (dict) --

          The latest and maximum score for the anomaly.

          • MaxScore (float) --

            The maximum score that's observed during the AnomalyDateInterval.

          • CurrentScore (float) --

            The last observed score.

        • Impact (dict) --

          The dollar impact for the anomaly.

          • MaxImpact (float) --

            The maximum dollar value that's observed for an anomaly.

          • TotalImpact (float) --

            The cumulative dollar value that's observed for an anomaly.

        • MonitorArn (string) --

          The Amazon Resource Name (ARN) for the cost monitor that generated this anomaly.

        • Feedback (string) --

          The feedback value.

    • NextPageToken (string) --

      The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.