Skip to content

update_domain

update_domain(
    domain_id: DomainId,
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
    name: Optional[str] = None,
    identity_providers: Optional[IdentityProviderList] = None,
    identity_provider_configuration: Optional[IdentityProviderConfiguration] = None,
) -> UpdateDomainOutput

Updates a domain's name or identity provider configuration. Only the provided fields are changed; omitted fields are left unchanged. Renaming a domain also changes the endpoint URLs derived from its name.

Parameters:

  • domain_id (DomainId) –

    The unique ID of the domain to update.

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

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

  • identity_providers (Optional[IdentityProviderList], default: None ) –

    The identity providers to configure for the domain.

  • identity_provider_configuration (Optional[IdentityProviderConfiguration], default: None ) –

    Identity provider configuration for the domain.

Raises:

Examples:

Rename a domain The following example performs a partial update that changes only the domain name; the omitted fields are left unchanged. Renaming the domain also updates the endpoint URLs derived from its name, and updatedAt advances past createdAt. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> client.update_domain(domain_id='d-1a2b3c4d5e', name='prod-observability-metrics')
Source code in docs_src/capo_cloudwatchomni/_services/cloud_watch_omni.py
def update_domain(
    self,
    domain_id: "capo_cloudwatchomni.types.domain_id.DomainId",
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
    name: Optional[str] = None,
    identity_providers: Optional[
        "capo_cloudwatchomni.types.identity_provider_list.IdentityProviderList"
    ] = None,
    identity_provider_configuration: Optional[
        "capo_cloudwatchomni.types.identity_provider_configuration.IdentityProviderConfiguration"
    ] = None,
) -> "capo_cloudwatchomni.types.update_domain_output.UpdateDomainOutput":
    """Updates a domain's name or identity provider configuration. Only the provided fields are changed; omitted fields are left unchanged. Renaming a domain also changes the endpoint URLs derived from its name.

    Args:
        domain_id: The unique ID of the domain to update.
        name: A new name for the domain. Omit to leave unchanged. Must be 3-63 characters: lowercase letters, numbers, and hyphens. It must begin and end with a letter or number and cannot contain consecutive hyphens.
        identity_providers: The identity providers to configure for the domain.
        identity_provider_configuration: Identity provider configuration for the domain.

    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 domain
        The following example performs a partial update that changes only the domain name; the omitted fields are left unchanged. Renaming the domain also updates the endpoint URLs derived from its name, and updatedAt advances past createdAt. Payloads are shown as JSON; on the wire they are CBOR-encoded.

        >>> client.update_domain(domain_id='d-1a2b3c4d5e', name='prod-observability-metrics')
    """

    def _handler(
        req: "OperationRequest[capo_cloudwatchomni.types.update_domain_input.UpdateDomainInput]",
    ) -> OperationResponse[
        "capo_cloudwatchomni.types.update_domain_output.UpdateDomainOutput"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.update_domain

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateDomain")
    )
    input_: capo_cloudwatchomni.types.update_domain_input.UpdateDomainInput = {
        "domain_id": domain_id
    }
    if name is not None:
        input_["name"] = name
    if identity_providers is not None:
        input_["identity_providers"] = identity_providers
    if identity_provider_configuration is not None:
        input_["identity_provider_configuration"] = identity_provider_configuration

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