CloudWatchApplicationSignals / Client / list_service_states

list_service_states

CloudWatchApplicationSignals.Client.list_service_states(**kwargs)

Returns information about the last deployment and other change states of services. This API provides visibility into recent changes that may have affected service performance, helping with troubleshooting and change correlation.

See also: AWS API Documentation

Request Syntax

response = client.list_service_states(
    StartTime=datetime(2015, 1, 1),
    EndTime=datetime(2015, 1, 1),
    MaxResults=123,
    NextToken='string',
    IncludeLinkedAccounts=True|False,
    AwsAccountId='string',
    AttributeFilters=[
        {
            'AttributeFilterName': 'string',
            'AttributeFilterValues': [
                'string',
            ]
        },
    ]
)
Parameters:
  • StartTime (datetime) –

    [REQUIRED]

    The start of the time period to retrieve service state information for. When used in a raw HTTP Query API, it is formatted as epoch time in seconds. For example, 1698778057.

  • EndTime (datetime) –

    [REQUIRED]

    The end of the time period to retrieve service state information for. When used in a raw HTTP Query API, it is formatted as epoch time in seconds. For example, 1698778057.

  • MaxResults (integer) – The maximum number of service states to return in one operation. If you omit this parameter, the default of 20 is used.

  • NextToken (string) – Include this value, if it was returned by the previous operation, to get the next set of service states.

  • IncludeLinkedAccounts (boolean) – If you are using this operation in a monitoring account, specify true to include service states from source accounts in the returned data.

  • AwsAccountId (string) – The Amazon Web Services account ID to filter service states by. Use this to limit results to services from a specific account.

  • AttributeFilters (list) –

    A list of attribute filters to narrow down the services. You can filter by platform, environment, or other service attributes.

    • (dict) –

      A structure that defines a filter for narrowing down results based on specific attribute values. This can be used to filter services by platform, environment, or other service characteristics.

      • AttributeFilterName (string) – [REQUIRED]

        The name of the attribute to filter by, such as Platform, Environment, or BusinessUnit.

      • AttributeFilterValues (list) – [REQUIRED]

        An array of values to match for the specified attribute. Services that have any of these values for the attribute will be included in the results.

        • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'StartTime': datetime(2015, 1, 1),
    'EndTime': datetime(2015, 1, 1),
    'ServiceStates': [
        {
            'AttributeFilters': [
                {
                    'AttributeFilterName': 'string',
                    'AttributeFilterValues': [
                        'string',
                    ]
                },
            ],
            'Service': {
                'string': 'string'
            },
            'LatestChangeEvents': [
                {
                    'Timestamp': datetime(2015, 1, 1),
                    'AccountId': 'string',
                    'Region': 'string',
                    'Entity': {
                        'string': 'string'
                    },
                    'ChangeEventType': 'DEPLOYMENT',
                    'EventId': 'string',
                    'UserName': 'string',
                    'EventName': 'string'
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • StartTime (datetime) –

      The start of the time period that the returned information applies to. When used in a raw HTTP Query API, it is formatted as epoch time in seconds. For example, 1698778057.

    • EndTime (datetime) –

      The end of the time period that the returned information applies to. When used in a raw HTTP Query API, it is formatted as epoch time in seconds. For example, 1698778057.

    • ServiceStates (list) –

      An array of structures, where each structure contains information about the state of one service, including its latest change events such as deployments.

      • (dict) –

        A structure that contains information about the current state of a service, including its latest change events such as deployments and other state-changing activities.

        • AttributeFilters (list) –

          The attribute filters that were applied when retrieving this service state information.

          • (dict) –

            A structure that defines a filter for narrowing down results based on specific attribute values. This can be used to filter services by platform, environment, or other service characteristics.

            • AttributeFilterName (string) –

              The name of the attribute to filter by, such as Platform, Environment, or BusinessUnit.

            • AttributeFilterValues (list) –

              An array of values to match for the specified attribute. Services that have any of these values for the attribute will be included in the results.

              • (string) –

        • Service (dict) –

          The key attributes that identify this service, including Type, Name, and Environment information.

          • (string) –

            • (string) –

        • LatestChangeEvents (list) –

          An array containing the most recent change events for this service, such as deployments, with information about when they occurred and who initiated them.

          • (dict) –

            A structure that contains information about a change event that occurred for a service, such as a deployment or configuration change.

            • Timestamp (datetime) –

              The timestamp when this change event occurred. When used in a raw HTTP Query API, it is formatted as epoch time in seconds.

            • AccountId (string) –

              The Amazon Web Services account ID where this change event occurred.

            • Region (string) –

              The Amazon Web Services region where this change event occurred.

            • Entity (dict) –

              The entity (service or resource) that was affected by this change event, including its key attributes.

              • (string) –

                • (string) –

            • ChangeEventType (string) –

              The type of change event that occurred, such as DEPLOYMENT.

            • EventId (string) –

              A unique identifier for this change event.

            • UserName (string) –

              The name of the user who initiated this change event, if available.

            • EventName (string) –

              The name or description of this change event.

    • NextToken (string) –

      Include this value in your next use of this API to get the next set of service states.

Exceptions

  • CloudWatchApplicationSignals.Client.exceptions.ValidationException

  • CloudWatchApplicationSignals.Client.exceptions.ThrottlingException