Skip to content

delete_domain async

delete_domain(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    domain_id: Optional[DomainId] = None,
    retention_policy: Optional[RetentionPolicy] = None,
) -> None

Used to delete a domain. If you onboarded with IAM mode, you will need to delete your domain to onboard again using IAM Identity Center. Use with caution. All of the members of the domain will lose access to their EFS volume, including data, notebooks, and other artifacts.

Parameters:

  • domain_id (Optional[DomainId], default: None ) –

    The domain ID.

  • retention_policy (Optional[RetentionPolicy], default: None ) –

    The retention policy for this domain, which specifies whether resources will be retained after the Domain is deleted. By default, all resources are retained (not automatically deleted).

Raises:

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def delete_domain(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    domain_id: Optional["capo_sagemaker.types.domain_id.DomainId"] = None,
    retention_policy: Optional[
        "capo_sagemaker.types.retention_policy.RetentionPolicy"
    ] = None,
) -> None:
    """<p>Used to delete a domain. If you onboarded with IAM mode, you will need to delete your domain to onboard again using IAM Identity Center. Use with caution. All of the members of the domain will lose access to their EFS volume, including data, notebooks, and other artifacts. </p>

    Args:
        domain_id: <p>The domain ID.</p>
        retention_policy: <p>The retention policy for this domain, which specifies whether resources will be retained after the Domain is deleted. By default, all resources are retained (not automatically deleted). </p>

    Raises:
        capo_sagemaker.errors.resource_in_use.ResourceInUse: <p>Resource being accessed is in use.</p>
        capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.delete_domain_request.DeleteDomainRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_sagemaker._operations.sage_maker.delete_domain

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.delete_domain.async_delete_domain(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteDomain")
    )
    input_: capo_sagemaker.types.delete_domain_request.DeleteDomainRequest = {}
    if domain_id is not None:
        input_["domain_id"] = domain_id
    if retention_policy is not None:
        input_["retention_policy"] = retention_policy

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