Skip to content

list_omni_slos async

list_omni_slos(
    space_id: SpaceId,
    *,
    config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
    filter_criteria: Optional[SloFilterCriteria] = None,
    sort_by: Optional[SloSortField] = None,
    sort_order: Optional[SloSortOrder] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[int] = None,
) -> ListOmniSlosOutput

Lists the SLOs in a space, with their current state, optionally filtered and sorted, with pagination. Each item reports the measurement taken when its state last changed.

Parameters:

  • space_id (SpaceId) –

    The unique ID of the space.

  • filter_criteria (Optional[SloFilterCriteria], default: None ) –

    Filters that narrow which SLOs are returned. All members are optional; the names, namePrefix and ids filters are mutually exclusive.

  • sort_by (Optional[SloSortField], default: None ) –

    The field to sort results by. Defaults to NAME.

  • sort_order (Optional[SloSortOrder], default: None ) –

    The order in which to sort results.

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

    A token to retrieve the next page of results.

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

    The maximum number of SLOs to return per page. Defaults to 50.

Raises:

Examples:

List the SLOs that need attention The following example lists the SLOs in a space whose state is WARNING or CRITICAL, sorted by state with CRITICAL first, two to a page. The response holds a nextToken, so more SLOs match. Each item reports the measurement taken when its state last changed. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> await client.list_omni_slos(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', filter_criteria={'stateValue': ['WARNING', 'CRITICAL']}, sort_by='STATE', sort_order='DESC', max_results=2)
Source code in docs_src/capo_cloudwatchomni/_services/async_cloud_watch_omni.py
async def list_omni_slos(
    self,
    space_id: "capo_cloudwatchomni.types.space_id.SpaceId",
    *,
    config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
    filter_criteria: Optional[
        "capo_cloudwatchomni.types.slo_filter_criteria.SloFilterCriteria"
    ] = None,
    sort_by: Optional[
        "capo_cloudwatchomni.types.slo_sort_field.SloSortField"
    ] = None,
    sort_order: Optional[
        "capo_cloudwatchomni.types.slo_sort_order.SloSortOrder"
    ] = None,
    next_token: Optional["capo_cloudwatchomni.types.next_token.NextToken"] = None,
    max_results: Optional[int] = None,
) -> "capo_cloudwatchomni.types.list_omni_slos_output.ListOmniSlosOutput":
    """Lists the SLOs in a space, with their current state, optionally filtered and sorted, with pagination. Each item reports the measurement taken when its state last changed.

    Args:
        space_id: The unique ID of the space.
        filter_criteria: Filters that narrow which SLOs are returned. All members are optional; the names, namePrefix and ids filters are mutually exclusive.
        sort_by: The field to sort results by. Defaults to NAME.
        sort_order: The order in which to sort results.
        next_token: A token to retrieve the next page of results.
        max_results: The maximum number of SLOs to return per page. Defaults to 50.

    Raises:
        capo_cloudwatchomni.errors.access_denied_exception.AccessDeniedException: The caller is not authorized to perform this action.
        capo_cloudwatchomni.errors.internal_server_exception.InternalServerException: An unexpected error occurred while processing the request.
        capo_cloudwatchomni.errors.resource_not_found_exception.ResourceNotFoundException: The specified resource does not exist.
        capo_cloudwatchomni.errors.throttling_exception.ThrottlingException: The request was throttled due to exceeding the allowed request rate.
        capo_cloudwatchomni.errors.validation_exception.ValidationException: A parameter is specified incorrectly.
        capo_cloudwatchomni.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        List the SLOs that need attention
        The following example lists the SLOs in a space whose state is WARNING or CRITICAL, sorted by state with CRITICAL first, two to a page. The response holds a nextToken, so more SLOs match. Each item reports the measurement taken when its state last changed. Payloads are shown as JSON; on the wire they are CBOR-encoded.

        >>> await client.list_omni_slos(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', filter_criteria={'stateValue': ['WARNING', 'CRITICAL']}, sort_by='STATE', sort_order='DESC', max_results=2)
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatchomni.types.list_omni_slos_input.ListOmniSlosInput]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatchomni.types.list_omni_slos_output.ListOmniSlosOutput"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.list_omni_slos

        (
            output,
            http_response,
        ) = await capo_cloudwatchomni._operations.cloud_watch_omni_frontend.list_omni_slos.async_list_omni_slos(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListOmniSlos")
    )
    input_: capo_cloudwatchomni.types.list_omni_slos_input.ListOmniSlosInput = {
        "space_id": space_id
    }
    if filter_criteria is not None:
        input_["filter_criteria"] = filter_criteria
    if sort_by is not None:
        input_["sort_by"] = sort_by
    if sort_order is not None:
        input_["sort_order"] = sort_order
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output