CloudWatchApplicationSignals / Client / list_service_states

list_service_states

CloudWatchApplicationSignals.Client.list_service_states(**kwargs)

Retrieves the current state information for services monitored by Application Signals. Service states include health status, recent change events, and other operational metadata.

You can filter results by time range, AWS account, and service attributes to focus on specific services or time periods. This operation supports pagination and can include data from linked accounts.

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 time for the service states query. Only service states from this time onward will be included. Specify the time as the number of milliseconds since January 1, 1970, 00:00:00 UTC.

  • EndTime (datetime) –

    [REQUIRED]

    The end time for the service states query. Only service states before this time will be included. Specify the time as the number of milliseconds since January 1, 1970, 00:00:00 UTC.

  • MaxResults (integer) – The maximum number of service states to return in a single request. Valid range is 1 to 100. If not specified, defaults to 50.

  • NextToken (string) – The token for the next set of results. Use this token to retrieve additional pages of service states when the result set is large.

  • IncludeLinkedAccounts (boolean) – Specifies whether to include service states from linked AWS accounts in the results. Set to true to include linked accounts, or false to only include the current account. Defaults to false.

  • AwsAccountId (string) – The AWS account ID to filter service states. If specified, only service states from this account will be returned. If not specified, service states from the current account (and linked accounts if enabled) are returned.

  • AttributeFilters (list) –

    An array of attribute filters to narrow down the service states returned. Each filter specifies an attribute name and the values to match against.

    • (dict) –

      Represents a filter for service attributes. Used to narrow down results based on specific attribute names and values.

      • AttributeFilterName (string) – [REQUIRED]

        The name of the attribute to filter on. This corresponds to service metadata attributes such as environment, team, or custom tags.

      • AttributeFilterValues (list) – [REQUIRED]

        An array of values to match against the specified attribute. Services with attribute values matching any of these values 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 time of the query range, expressed as the number of milliseconds since January 1, 1970, 00:00:00 UTC.

    • EndTime (datetime) –

      The end time of the query range, expressed as the number of milliseconds since January 1, 1970, 00:00:00 UTC.

    • ServiceStates (list) –

      An array of service state objects that match the specified criteria. Each service state includes current status, recent change events, and service metadata.

      • (dict) –

        Represents the current state and health information for a service monitored by Application Signals.

        • AttributeFilters (list) –

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

          • (dict) –

            Represents a filter for service attributes. Used to narrow down results based on specific attribute names and values.

            • AttributeFilterName (string) –

              The name of the attribute to filter on. This corresponds to service metadata attributes such as environment, team, or custom tags.

            • AttributeFilterValues (list) –

              An array of values to match against the specified attribute. Services with attribute values matching any of these values will be included in the results.

              • (string) –

        • Service (dict) –

          The service entity information for this service state.

          • (string) –

            • (string) –

        • LatestChangeEvents (list) –

          An array of the most recent change events that may have affected this service, such as deployments or configuration changes.

          • (dict) –

            Represents a change event that occurred in the system, such as deployments, configuration changes, or other operational events that may impact service performance.

            • Timestamp (datetime) –

              The timestamp when the change event occurred, expressed as the number of milliseconds since January 1, 1970, 00:00:00 UTC.

            • AccountId (string) –

              The AWS account ID where the change event occurred.

            • Region (string) –

              The AWS region where the change event occurred.

            • Entity (dict) –

              The entity or resource that was changed, such as a service, deployment, or configuration.

              • (string) –

                • (string) –

            • ChangeEventType (string) –

              The type of change that occurred, such as “Deployment”, “Configuration”, or “Infrastructure”.

            • EventId (string) –

              A unique identifier for the change event.

            • UserName (string) –

              The name of the user or system that initiated the change event.

            • EventName (string) –

              A descriptive name for the change event that provides context about what changed.

    • NextToken (string) –

      The token to use for retrieving the next page of results. This value is present only if there are more results available than were returned in the current response.

Exceptions

  • CloudWatchApplicationSignals.Client.exceptions.ValidationException

  • CloudWatchApplicationSignals.Client.exceptions.ThrottlingException