Skip to content

update_space

update_space(
    space_id: SpaceId,
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
    name: Optional[str] = None,
    agent_core_evaluation_role_arn: Optional[Arn] = None,
    encryption_configuration: Optional[EncryptionConfiguration] = None,
) -> UpdateSpaceOutput

Updates a space. Only the provided fields are changed; omitted fields are left unchanged.

Parameters:

  • space_id (SpaceId) –

    The unique ID of the space to update.

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

    A new name for the space. Omit to leave unchanged. Must be 3-64 characters: lowercase letters, numbers, and hyphens. It must begin and end with a letter or number and cannot contain consecutive hyphens.

  • agent_core_evaluation_role_arn (Optional[Arn], default: None ) –

    The ARN of the IAM role used by AgentCore online evaluation. Must be in the caller's account. Omit if the space does not use AgentCore online evaluation.

  • encryption_configuration (Optional[EncryptionConfiguration], default: None ) –

    How to encrypt the space's data at rest. Omit to leave encryption unchanged. Pass encryptionStrategy AWS_OWNED to stop using a customer managed key and revert to service owned encryption.

Raises:

Examples:

Rename a space The following example updates only the name of a space; omitted fields are left unchanged. The response returns the full space with a later updatedAt timestamp. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> client.update_space(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', name='prod-observability-team')
Source code in docs_src/capo_cloudwatchomni/_services/cloud_watch_omni.py
def update_space(
    self,
    space_id: "capo_cloudwatchomni.types.space_id.SpaceId",
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
    name: Optional[str] = None,
    agent_core_evaluation_role_arn: Optional[
        "capo_cloudwatchomni.types.arn.Arn"
    ] = None,
    encryption_configuration: Optional[
        "capo_cloudwatchomni.types.encryption_configuration.EncryptionConfiguration"
    ] = None,
) -> "capo_cloudwatchomni.types.update_space_output.UpdateSpaceOutput":
    """Updates a space. Only the provided fields are changed; omitted fields are left unchanged.

    Args:
        space_id: The unique ID of the space to update.
        name: A new name for the space. Omit to leave unchanged. Must be 3-64 characters: lowercase letters, numbers, and hyphens. It must begin and end with a letter or number and cannot contain consecutive hyphens.
        agent_core_evaluation_role_arn: The ARN of the IAM role used by AgentCore online evaluation. Must be in the caller's account. Omit if the space does not use AgentCore online evaluation.
        encryption_configuration: How to encrypt the space's data at rest. Omit to leave encryption unchanged. Pass `encryptionStrategy` AWS_OWNED to stop using a customer managed key and revert to service owned encryption.

    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:
        Rename a space
        The following example updates only the name of a space; omitted fields are left unchanged. The response returns the full space with a later updatedAt timestamp. Payloads are shown as JSON; on the wire they are CBOR-encoded.

        >>> client.update_space(space_id='a1b2c3d4-5e6f-4a3b-8c9d-0e1f2a3b4c5d', name='prod-observability-team')
    """

    def _handler(
        req: "OperationRequest[capo_cloudwatchomni.types.update_space_input.UpdateSpaceInput]",
    ) -> OperationResponse[
        "capo_cloudwatchomni.types.update_space_output.UpdateSpaceOutput"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.update_space

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateSpace")
    )
    input_: capo_cloudwatchomni.types.update_space_input.UpdateSpaceInput = {
        "space_id": space_id
    }
    if name is not None:
        input_["name"] = name
    if agent_core_evaluation_role_arn is not None:
        input_["agent_core_evaluation_role_arn"] = agent_core_evaluation_role_arn
    if encryption_configuration is not None:
        input_["encryption_configuration"] = encryption_configuration

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