Skip to content

get_access_profile async

get_access_profile(
    space_id: SpaceId,
    profile_id: ProfileId,
    *,
    config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
) -> GetAccessProfileOutput

Retrieves an access profile by ID. The response indicates whether the calling principal is currently allowed to assume the profile.

Parameters:

  • space_id (SpaceId) –

    The unique ID of the space.

  • profile_id (ProfileId) –

    The unique ID of the access profile.

Raises:

Examples:

Get an access profile The following example retrieves an access profile by ID, including whether the calling principal is currently allowed to assume it. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> await client.get_access_profile(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', profile_id='analyst-readonly')
Source code in docs_src/capo_cloudwatchomni/_services/async_cloud_watch_omni.py
async def get_access_profile(
    self,
    space_id: "capo_cloudwatchomni.types.space_id.SpaceId",
    profile_id: "capo_cloudwatchomni.types.profile_id.ProfileId",
    *,
    config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
) -> "capo_cloudwatchomni.types.get_access_profile_output.GetAccessProfileOutput":
    """Retrieves an access profile by ID. The response indicates whether the calling principal is currently allowed to assume the profile.

    Args:
        space_id: The unique ID of the space.
        profile_id: The unique ID of the access profile.

    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:
        Get an access profile
        The following example retrieves an access profile by ID, including whether the calling principal is currently allowed to assume it. Payloads are shown as JSON; on the wire they are CBOR-encoded.

        >>> await client.get_access_profile(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', profile_id='analyst-readonly')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatchomni.types.get_access_profile_input.GetAccessProfileInput]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatchomni.types.get_access_profile_output.GetAccessProfileOutput"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.get_access_profile

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetAccessProfile")
    )
    input_: capo_cloudwatchomni.types.get_access_profile_input.GetAccessProfileInput = {
        "space_id": space_id,
        "profile_id": profile_id,
    }

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