Skip to content

update_metadata_configuration

update_metadata_configuration(
    *,
    config_overrides: Optional[S3VectorsClientConfig] = None,
    vector_bucket_name: Optional[VectorBucketName] = None,
    index_name: Optional[IndexName] = None,
    index_arn: Optional[IndexArn] = None,
    add: Optional[MetadataConfigurationAdd] = None,
    delete: Optional[MetadataConfigurationDelete] = None,
) -> UpdateMetadataConfigurationOutput

Adds or deletes text search configurations on a vector index. Specify either add or delete, but not both. The vector index must be in ENHANCED mode.

Permissions

You must have the s3vectors:UpdateMetadataConfiguration permission to use this operation.

Parameters:

Raises:

  • AccessDeniedException –

    Access denied.

  • InternalServerException –

    The request failed due to an internal server error.

  • RequestTimeoutException –

    The request timed out. Retry your request.

  • TooManyRequestsException –

    The request was denied due to request throttling.

  • ValidationException –

    The requested action isn't valid.

  • ConflictException –

    The request failed because a vector bucket name or a vector index name already exists. Vector bucket names must be unique within your Amazon Web Services account for each Amazon Web Services Region. Vector index names must be unique within your vector bucket. Choose a different vector bucket name or vector index name, and try again.

  • NotFoundException –

    The request was rejected because the specified resource can't be found.

  • ServiceUnavailableException –

    The service is unavailable. Wait briefly and retry your request. If it continues to fail, increase your waiting time between retries.

  • UnknownServiceError –

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

Source code in docs_src/capo_s3vectors/_services/s3_vectors.py
def update_metadata_configuration(
    self,
    *,
    config_overrides: Optional[S3VectorsClientConfig] = None,
    vector_bucket_name: Optional[
        "capo_s3vectors.types.vector_bucket_name.VectorBucketName"
    ] = None,
    index_name: Optional["capo_s3vectors.types.index_name.IndexName"] = None,
    index_arn: Optional["capo_s3vectors.types.index_arn.IndexArn"] = None,
    add: Optional[
        "capo_s3vectors.types.metadata_configuration_add.MetadataConfigurationAdd"
    ] = None,
    delete: Optional[
        "capo_s3vectors.types.metadata_configuration_delete.MetadataConfigurationDelete"
    ] = None,
) -> "capo_s3vectors.types.update_metadata_configuration_output.UpdateMetadataConfigurationOutput":
    """<p>Adds or deletes text search configurations on a vector index. Specify either <code>add</code> or <code>delete</code>, but not both. The vector index must be in <code>ENHANCED</code> mode.</p> <dl> <dt>Permissions</dt> <dd> <p>You must have the <code>s3vectors:UpdateMetadataConfiguration</code> permission to use this operation.</p> </dd> </dl>

    Args:
        vector_bucket_name: <p>The name of the vector bucket that contains the vector index.</p>
        index_name: <p>The name of the vector index to update.</p>
        index_arn: <p>The Amazon Resource Name (ARN) of the vector index to update.</p>
        add: <p>Text search configurations to add to the vector index.</p>
        delete: <p>Text search configurations to delete from the vector index.</p>

    Raises:
        capo_s3vectors.errors.access_denied_exception.AccessDeniedException: <p>Access denied.</p>
        capo_s3vectors.errors.internal_server_exception.InternalServerException: <p>The request failed due to an internal server error.</p>
        capo_s3vectors.errors.request_timeout_exception.RequestTimeoutException: <p>The request timed out. Retry your request.</p>
        capo_s3vectors.errors.too_many_requests_exception.TooManyRequestsException: <p>The request was denied due to request throttling.</p>
        capo_s3vectors.errors.validation_exception.ValidationException: <p>The requested action isn't valid.</p>
        capo_s3vectors.errors.conflict_exception.ConflictException: <p>The request failed because a vector bucket name or a vector index name already exists. Vector bucket names must be unique within your Amazon Web Services account for each Amazon Web Services Region. Vector index names must be unique within your vector bucket. Choose a different vector bucket name or vector index name, and try again.</p>
        capo_s3vectors.errors.not_found_exception.NotFoundException: <p>The request was rejected because the specified resource can't be found.</p>
        capo_s3vectors.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is unavailable. Wait briefly and retry your request. If it continues to fail, increase your waiting time between retries.</p>
        capo_s3vectors.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_s3vectors.types.update_metadata_configuration_input.UpdateMetadataConfigurationInput]",
    ) -> OperationResponse[
        "capo_s3vectors.types.update_metadata_configuration_output.UpdateMetadataConfigurationOutput"
    ]:
        import capo_s3vectors._operations.s3_vectors.update_metadata_configuration

        output, http_response = (
            capo_s3vectors._operations.s3_vectors.update_metadata_configuration.update_metadata_configuration(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateMetadataConfiguration")
    )
    input_: capo_s3vectors.types.update_metadata_configuration_input.UpdateMetadataConfigurationInput = {}
    if vector_bucket_name is not None:
        input_["vector_bucket_name"] = vector_bucket_name
    if index_name is not None:
        input_["index_name"] = index_name
    if index_arn is not None:
        input_["index_arn"] = index_arn
    if add is not None:
        input_["add"] = add
    if delete is not None:
        input_["delete"] = delete

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