Skip to content

associate_package

associate_package(
    package_id: PackageID,
    domain_name: DomainName,
    *,
    config_overrides: Optional[OpenSearchClientConfig] = None,
    prerequisite_package_id_list: Optional[PackageIDList] = None,
    association_configuration: Optional[PackageAssociationConfiguration] = None,
) -> AssociatePackageResponse

Associates a package with an Amazon OpenSearch Service domain. For more information, see Custom packages for Amazon OpenSearch Service.

Parameters:

  • package_id (PackageID) –

    Internal ID of the package to associate with a domain. Use DescribePackages to find this value.

  • domain_name (DomainName) –

    Name of the domain to associate the package with.

  • prerequisite_package_id_list (Optional[PackageIDList], default: None ) –

    A list of package IDs that must be associated with the domain before the package specified in the request can be associated.

  • association_configuration (Optional[PackageAssociationConfiguration], default: None ) –

    The configuration for associating a package with an Amazon OpenSearch Service domain.

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/open_search.py
def associate_package(
    self,
    package_id: "capo_opensearch.types.package_id.PackageID",
    domain_name: "capo_opensearch.types.domain_name.DomainName",
    *,
    config_overrides: Optional[OpenSearchClientConfig] = None,
    prerequisite_package_id_list: Optional[
        "capo_opensearch.types.package_id_list.PackageIDList"
    ] = None,
    association_configuration: Optional[
        "capo_opensearch.types.package_association_configuration.PackageAssociationConfiguration"
    ] = None,
) -> "capo_opensearch.types.associate_package_response.AssociatePackageResponse":
    """<p>Associates a package with an Amazon OpenSearch Service domain. 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 associate with a domain. Use <code>DescribePackages</code> to find this value. </p>
        domain_name: <p>Name of the domain to associate the package with.</p>
        prerequisite_package_id_list: <p>A list of package IDs that must be associated with the domain before the package specified in the request can be associated.</p>
        association_configuration: <p>The configuration for associating a package with an Amazon OpenSearch Service domain.</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.
    """

    def _handler(
        req: "OperationRequest[capo_opensearch.types.associate_package_request.AssociatePackageRequest]",
    ) -> OperationResponse[
        "capo_opensearch.types.associate_package_response.AssociatePackageResponse"
    ]:
        import capo_opensearch._operations.amazon_open_search_service.associate_package

        output, http_response = (
            capo_opensearch._operations.amazon_open_search_service.associate_package.associate_package(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AssociatePackage")
    )
    input_: capo_opensearch.types.associate_package_request.AssociatePackageRequest = {
        "package_id": package_id,
        "domain_name": domain_name,
    }
    if prerequisite_package_id_list is not None:
        input_["prerequisite_package_id_list"] = prerequisite_package_id_list
    if association_configuration is not None:
        input_["association_configuration"] = association_configuration

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