Skip to content

list_service_states

list_service_states(
    start_time: datetime,
    end_time: datetime,
    *,
    config_overrides: Optional[ApplicationSignalsClientConfig] = None,
    max_results: Optional[ListServiceStatesMaxResults] = None,
    next_token: Optional[NextToken] = None,
    include_linked_accounts: Optional[bool] = None,
    aws_account_id: Optional[AwsAccountId] = None,
    attribute_filters: Optional[AttributeFilters] = None,
) -> ListServiceStatesOutput

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.

Parameters:

  • start_time (datetime) –

    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.

  • end_time (datetime) –

    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.

  • max_results (Optional[ListServiceStatesMaxResults], default: None ) –

    The maximum number of service states to return in one operation. If you omit this parameter, the default of 20 is used.

  • next_token (Optional[NextToken], default: None ) –

    Include this value, if it was returned by the previous operation, to get the next set of service states.

  • include_linked_accounts (Optional[bool], default: None ) –

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

  • aws_account_id (Optional[AwsAccountId], default: None ) –

    The Amazon Web Services account ID to filter service states by. Use this to limit results to services from a specific account.

  • attribute_filters (Optional[AttributeFilters], default: None ) –

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

Raises:

Source code in docs_src/capo_application_signals/_services/application_signals.py
def list_service_states(
    self,
    start_time: datetime.datetime,
    end_time: datetime.datetime,
    *,
    config_overrides: Optional[ApplicationSignalsClientConfig] = None,
    max_results: Optional[
        "capo_application_signals.types.list_service_states_max_results.ListServiceStatesMaxResults"
    ] = None,
    next_token: Optional[
        "capo_application_signals.types.next_token.NextToken"
    ] = None,
    include_linked_accounts: Optional[bool] = None,
    aws_account_id: Optional[
        "capo_application_signals.types.aws_account_id.AwsAccountId"
    ] = None,
    attribute_filters: Optional[
        "capo_application_signals.types.attribute_filters.AttributeFilters"
    ] = None,
) -> "capo_application_signals.types.list_service_states_output.ListServiceStatesOutput":
    """<p>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.</p>

    Args:
        start_time: <p>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, <code>1698778057</code>.</p>
        end_time: <p>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, <code>1698778057</code>.</p>
        max_results: <p>The maximum number of service states to return in one operation. If you omit this parameter, the default of 20 is used.</p>
        next_token: <p>Include this value, if it was returned by the previous operation, to get the next set of service states.</p>
        include_linked_accounts: <p>If you are using this operation in a monitoring account, specify <code>true</code> to include service states from source accounts in the returned data.</p>
        aws_account_id: <p>The Amazon Web Services account ID to filter service states by. Use this to limit results to services from a specific account.</p>
        attribute_filters: <p>A list of attribute filters to narrow down the services. You can filter by platform, environment, or other service attributes.</p>

    Raises:
        capo_application_signals.errors.throttling_exception.ThrottlingException: <p>The request was throttled because of quota limits.</p>
        capo_application_signals.errors.validation_exception.ValidationException: <p>The resource is not valid.</p>
        capo_application_signals.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_application_signals.types.list_service_states_input.ListServiceStatesInput]",
    ) -> OperationResponse[
        "capo_application_signals.types.list_service_states_output.ListServiceStatesOutput"
    ]:
        import capo_application_signals._operations.application_signals.list_service_states

        output, http_response = (
            capo_application_signals._operations.application_signals.list_service_states.list_service_states(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListServiceStates")
    )
    input_: capo_application_signals.types.list_service_states_input.ListServiceStatesInput = {
        "start_time": start_time,
        "end_time": end_time,
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if include_linked_accounts is not None:
        input_["include_linked_accounts"] = include_linked_accounts
    if aws_account_id is not None:
        input_["aws_account_id"] = aws_account_id
    if attribute_filters is not None:
        input_["attribute_filters"] = attribute_filters

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output