Skip to content

get_omni_slo async

get_omni_slo(
    space_id: SpaceId,
    slo_id: SloId,
    *,
    config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
) -> GetOmniSloOutput

Retrieves a single service level objective (SLO) by its identifier, including its definition and its current state. The state reports the measurement taken when the state last changed, not a live figure. Use ListOmniSlos to enumerate the SLOs in a space.

Parameters:

  • space_id (SpaceId) –

    The unique ID of the space that owns the SLO.

  • slo_id (SloId) –

    The identifier of the SLO to retrieve.

Raises:

Examples:

Retrieve an SLO The following example retrieves a request-based SLO by its identifier. The state reports the measurement taken when the state last changed: 75.1 percent of the error budget, counted in events, had been consumed, which reached the warning ratio of 0.75, so the SLO entered the WARNING state. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> await client.get_omni_slo(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', slo_id='9f8e7d6c5b4a49382716051a2b3c4d5e')
Source code in docs_src/capo_cloudwatchomni/_services/async_cloud_watch_omni.py
async def get_omni_slo(
    self,
    space_id: "capo_cloudwatchomni.types.space_id.SpaceId",
    slo_id: "capo_cloudwatchomni.types.slo_id.SloId",
    *,
    config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
) -> "capo_cloudwatchomni.types.get_omni_slo_output.GetOmniSloOutput":
    """Retrieves a single service level objective (SLO) by its identifier, including its definition and its current state. The state reports the measurement taken when the state last changed, not a live figure. Use ListOmniSlos to enumerate the SLOs in a space.

    Args:
        space_id: The unique ID of the space that owns the SLO.
        slo_id: The identifier of the SLO to retrieve.

    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:
        Retrieve an SLO
        The following example retrieves a request-based SLO by its identifier. The state reports the measurement taken when the state last changed: 75.1 percent of the error budget, counted in events, had been consumed, which reached the warning ratio of 0.75, so the SLO entered the WARNING state. Payloads are shown as JSON; on the wire they are CBOR-encoded.

        >>> await client.get_omni_slo(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', slo_id='9f8e7d6c5b4a49382716051a2b3c4d5e')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatchomni.types.get_omni_slo_input.GetOmniSloInput]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatchomni.types.get_omni_slo_output.GetOmniSloOutput"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.get_omni_slo

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetOmniSlo")
    )
    input_: capo_cloudwatchomni.types.get_omni_slo_input.GetOmniSloInput = {
        "space_id": space_id,
        "slo_id": slo_id,
    }

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