Skip to content

delete_domain_for_organization

delete_domain_for_organization(
    domain_id: DomainId,
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
) -> DeleteDomainForOrganizationOutput

Removes an organization domain and all of its resources. Call this operation in the Region where the domain was created. A domain cannot be deleted while it contains spaces.

Parameters:

  • domain_id (DomainId) –

    The ID of the organization domain to delete.

Raises:

Examples:

Delete an organization domain The following example deletes an organization domain in the Region where it was created. The domain must not contain any spaces. A successful response returns an empty body. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> client.delete_domain_for_organization(domain_id='d-9z8y7x6w5v')
Source code in docs_src/capo_cloudwatchomni/_services/cloud_watch_omni.py
def delete_domain_for_organization(
    self,
    domain_id: "capo_cloudwatchomni.types.domain_id.DomainId",
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
) -> "capo_cloudwatchomni.types.delete_domain_for_organization_output.DeleteDomainForOrganizationOutput":
    """Removes an organization domain and all of its resources. Call this operation in the Region where the domain was created. A domain cannot be deleted while it contains spaces.

    Args:
        domain_id: The ID of the organization domain to delete.

    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.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:
        Delete an organization domain
        The following example deletes an organization domain in the Region where it was created. The domain must not contain any spaces. A successful response returns an empty body. Payloads are shown as JSON; on the wire they are CBOR-encoded.

        >>> client.delete_domain_for_organization(domain_id='d-9z8y7x6w5v')
    """

    def _handler(
        req: "OperationRequest[capo_cloudwatchomni.types.delete_domain_for_organization_input.DeleteDomainForOrganizationInput]",
    ) -> OperationResponse[
        "capo_cloudwatchomni.types.delete_domain_for_organization_output.DeleteDomainForOrganizationOutput"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.delete_domain_for_organization

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteDomainForOrganization")
    )
    input_: capo_cloudwatchomni.types.delete_domain_for_organization_input.DeleteDomainForOrganizationInput = {
        "domain_id": domain_id
    }

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