Skip to content

update_package

update_package(
    package_id: PackageID,
    package_source: PackageSource,
    *,
    config_overrides: Optional[ElasticsearchServiceClientConfig] = None,
    package_description: Optional[PackageDescription] = None,
    commit_message: Optional[CommitMessage] = None,
) -> UpdatePackageResponse

Updates a package for use with Amazon ES domains.

Parameters:

  • package_id (PackageID) –

    Unique identifier for the package.

  • package_description (Optional[PackageDescription], default: None ) –

    New description of the package.

  • commit_message (Optional[CommitMessage], default: None ) –

    An info message for the new version which will be shown as part of GetPackageVersionHistoryResponse.

Raises:

  • AccessDeniedException –

    An error occurred because user does not have permissions to access the resource. Returns HTTP status code 403.

  • BaseException –

    An error occurred while processing the request.

  • InternalException –

    The request processing has failed because of an unknown error, exception or failure (the failure is internal to the service) . Gives http status code of 500.

  • LimitExceededException –

    An exception for trying to create more than allowed resources or sub-resources. Gives http status code of 409.

  • ResourceNotFoundException –

    An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.

  • ValidationException –

    An exception for missing / invalid input fields. Gives http status code of 400.

  • UnknownServiceError –

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

Source code in docs_src/capo_elasticsearch_service/_services/elasticsearch_service.py
def update_package(
    self,
    package_id: "capo_elasticsearch_service.types.package_id.PackageID",
    package_source: "capo_elasticsearch_service.types.package_source.PackageSource",
    *,
    config_overrides: Optional[ElasticsearchServiceClientConfig] = None,
    package_description: Optional[
        "capo_elasticsearch_service.types.package_description.PackageDescription"
    ] = None,
    commit_message: Optional[
        "capo_elasticsearch_service.types.commit_message.CommitMessage"
    ] = None,
) -> (
    "capo_elasticsearch_service.types.update_package_response.UpdatePackageResponse"
):
    """<p>Updates a package for use with Amazon ES domains.</p>

    Args:
        package_id: <p>Unique identifier for the package.</p>
        package_description: <p>New description of the package.</p>
        commit_message: <p>An info message for the new version which will be shown as part of <code>GetPackageVersionHistoryResponse</code>.</p>

    Raises:
        capo_elasticsearch_service.errors.access_denied_exception.AccessDeniedException: <p>An error occurred because user does not have permissions to access the resource. Returns HTTP status code 403.</p>
        capo_elasticsearch_service.errors.base_exception.BaseException: <p>An error occurred while processing the request.</p>
        capo_elasticsearch_service.errors.internal_exception.InternalException: <p>The request processing has failed because of an unknown error, exception or failure (the failure is internal to the service) . Gives http status code of 500.</p>
        capo_elasticsearch_service.errors.limit_exceeded_exception.LimitExceededException: <p>An exception for trying to create more than allowed resources or sub-resources. Gives http status code of 409.</p>
        capo_elasticsearch_service.errors.resource_not_found_exception.ResourceNotFoundException: <p>An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.</p>
        capo_elasticsearch_service.errors.validation_exception.ValidationException: <p>An exception for missing / invalid input fields. Gives http status code of 400.</p>
        capo_elasticsearch_service.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_elasticsearch_service.types.update_package_request.UpdatePackageRequest]",
    ) -> OperationResponse[
        "capo_elasticsearch_service.types.update_package_response.UpdatePackageResponse"
    ]:
        import capo_elasticsearch_service._operations.amazon_elasticsearch_service2015.update_package

        output, http_response = (
            capo_elasticsearch_service._operations.amazon_elasticsearch_service2015.update_package.update_package(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdatePackage")
    )
    input_: capo_elasticsearch_service.types.update_package_request.UpdatePackageRequest = {
        "package_id": package_id,
        "package_source": package_source,
    }
    if package_description is not None:
        input_["package_description"] = package_description
    if commit_message is not None:
        input_["commit_message"] = commit_message

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