Skip to content

dissociate_package async

dissociate_package(
    package_id: PackageID,
    domain_name: DomainName,
    *,
    config_overrides: Optional[AsyncOpenSearchClientConfig] = None,
) -> DissociatePackageResponse

Removes a package from the specified Amazon OpenSearch Service domain. The package can't be in use with any OpenSearch index for the dissociation to succeed. The package is still available in OpenSearch Service for association later. For more information, see Custom packages for Amazon OpenSearch Service.

Parameters:

  • package_id (PackageID) –

    Internal ID of the package to dissociate from the domain. Use ListPackagesForDomain to find this value.

  • domain_name (DomainName) –

    Name of the domain to dissociate the package from.

Raises:

  • AccessDeniedException –

    An error occurred because you don't have permissions to access the resource.

  • BaseException –

    An error occurred while processing the request.

  • ConflictException –

    An error occurred because the client attempts to remove a resource that is currently in use.

  • InternalException –

    Request processing failed because of an unknown error, exception, or internal failure.

  • ResourceNotFoundException –

    An exception for accessing or deleting a resource that doesn't exist.

  • ValidationException –

    An exception for accessing or deleting a resource that doesn't exist.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_opensearch/_services/async_open_search.py
async def dissociate_package(
    self,
    package_id: "capo_opensearch.types.package_id.PackageID",
    domain_name: "capo_opensearch.types.domain_name.DomainName",
    *,
    config_overrides: Optional[AsyncOpenSearchClientConfig] = None,
) -> "capo_opensearch.types.dissociate_package_response.DissociatePackageResponse":
    """<p>Removes a package from the specified Amazon OpenSearch Service domain. The package can't be in use with any OpenSearch index for the dissociation to succeed. The package is still available in OpenSearch Service for association later. For more information, see <a href="https://docs.aws.amazon.com/opensearch-service/latest/developerguide/custom-packages.html">Custom packages for Amazon OpenSearch Service</a>.</p>

    Args:
        package_id: <p>Internal ID of the package to dissociate from the domain. Use <code>ListPackagesForDomain</code> to find this value.</p>
        domain_name: <p>Name of the domain to dissociate the package from.</p>

    Raises:
        capo_opensearch.errors.access_denied_exception.AccessDeniedException: <p>An error occurred because you don't have permissions to access the resource.</p>
        capo_opensearch.errors.base_exception.BaseException: <p>An error occurred while processing the request.</p>
        capo_opensearch.errors.conflict_exception.ConflictException: <p>An error occurred because the client attempts to remove a resource that is currently in use.</p>
        capo_opensearch.errors.internal_exception.InternalException: <p>Request processing failed because of an unknown error, exception, or internal failure.</p>
        capo_opensearch.errors.resource_not_found_exception.ResourceNotFoundException: <p>An exception for accessing or deleting a resource that doesn't exist.</p>
        capo_opensearch.errors.validation_exception.ValidationException: <p>An exception for accessing or deleting a resource that doesn't exist.</p>
        capo_opensearch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_opensearch.types.dissociate_package_request.DissociatePackageRequest]",
    ) -> AsyncOperationResponse[
        "capo_opensearch.types.dissociate_package_response.DissociatePackageResponse"
    ]:
        import capo_opensearch._operations.amazon_open_search_service.dissociate_package

        (
            output,
            http_response,
        ) = await capo_opensearch._operations.amazon_open_search_service.dissociate_package.async_dissociate_package(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DissociatePackage")
    )
    input_: capo_opensearch.types.dissociate_package_request.DissociatePackageRequest = {
        "package_id": package_id,
        "domain_name": domain_name,
    }

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