Skip to content

update_access_profile

update_access_profile(
    space_id: SpaceId,
    profile_id: ProfileId,
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
    name: Optional[AccessProfileName] = None,
    description: Optional[str] = None,
) -> UpdateAccessProfileOutput

Updates the name or description of an access profile. Only the provided fields are changed; omitted fields are left unchanged.

Parameters:

  • space_id (SpaceId) –

    The unique ID of the space.

  • profile_id (ProfileId) –

    The unique ID of the access profile to update.

  • name (Optional[AccessProfileName], default: None ) –

    A new name for the access profile. Omit to leave unchanged.

  • description (Optional[str], default: None ) –

    A new description of the access profile. Omit to leave unchanged.

Raises:

Examples:

Update an access profile description The following example updates only the description of an access profile; the name is left unchanged. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> client.update_access_profile(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', profile_id='analyst-readonly', description='Read-only access for analysts and on-call responders.')
Source code in docs_src/capo_cloudwatchomni/_services/cloud_watch_omni.py
def update_access_profile(
    self,
    space_id: "capo_cloudwatchomni.types.space_id.SpaceId",
    profile_id: "capo_cloudwatchomni.types.profile_id.ProfileId",
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
    name: Optional[
        "capo_cloudwatchomni.types.access_profile_name.AccessProfileName"
    ] = None,
    description: Optional[str] = None,
) -> "capo_cloudwatchomni.types.update_access_profile_output.UpdateAccessProfileOutput":
    """Updates the name or description of an access profile. Only the provided fields are changed; omitted fields are left unchanged.

    Args:
        space_id: The unique ID of the space.
        profile_id: The unique ID of the access profile to update.
        name: A new name for the access profile. Omit to leave unchanged.
        description: A new description of the access profile. Omit to leave unchanged.

    Raises:
        capo_cloudwatchomni.errors.access_denied_exception.AccessDeniedException: The caller is not authorized to perform this action.
        capo_cloudwatchomni.errors.conflict_exception.ConflictException: The operation could not be completed because of a conflict with the current state of the resource.
        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.service_quota_exceeded_exception.ServiceQuotaExceededException: A service quota was exceeded.
        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:
        Update an access profile description
        The following example updates only the description of an access profile; the name is left unchanged. Payloads are shown as JSON; on the wire they are CBOR-encoded.

        >>> client.update_access_profile(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', profile_id='analyst-readonly', description='Read-only access for analysts and on-call responders.')
    """

    def _handler(
        req: "OperationRequest[capo_cloudwatchomni.types.update_access_profile_input.UpdateAccessProfileInput]",
    ) -> OperationResponse[
        "capo_cloudwatchomni.types.update_access_profile_output.UpdateAccessProfileOutput"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.update_access_profile

        output, http_response = (
            capo_cloudwatchomni._operations.cloud_watch_omni_frontend.update_access_profile.update_access_profile(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateAccessProfile")
    )
    input_: capo_cloudwatchomni.types.update_access_profile_input.UpdateAccessProfileInput = {
        "space_id": space_id,
        "profile_id": profile_id,
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description

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