Skip to content

delete_bucket_metadata_configuration

delete_bucket_metadata_configuration(
    bucket: BucketName,
    *,
    config_overrides: Optional[S3ClientConfig] = None,
    expected_bucket_owner: Optional[AccountId] = None,
) -> None

Deletes an S3 Metadata configuration from a general purpose bucket. For more information, see Accelerating data discovery with S3 Metadata in the Amazon S3 User Guide.

You can use the V2 DeleteBucketMetadataConfiguration API operation with V1 or V2 metadata configurations. However, if you try to use the V1 DeleteBucketMetadataTableConfiguration API operation with V2 configurations, you will receive an HTTP 405 Method Not Allowed error.

Permissions

To use this operation, you must have the s3:DeleteBucketMetadataTableConfiguration permission. For more information, see Setting up permissions for configuring metadata tables in the Amazon S3 User Guide.

The IAM policy action name is the same for the V1 and V2 API operations.

The following operations are related to DeleteBucketMetadataConfiguration:

You must URL encode any signed header values that contain spaces. For example, if your header value is my file.txt, containing two spaces after my, you must URL encode this value to my%20%20file.txt.

Parameters:

  • bucket (BucketName) –

    The general purpose bucket that you want to remove the metadata configuration from.

  • expected_bucket_owner (Optional[AccountId], default: None ) –

    The expected bucket owner of the general purpose bucket that you want to remove the metadata table configuration from.

Raises:

Source code in docs_src/capo_s3/_services/s3.py
def delete_bucket_metadata_configuration(
    self,
    bucket: "capo_s3.types.bucket_name.BucketName",
    *,
    config_overrides: Optional[S3ClientConfig] = None,
    expected_bucket_owner: Optional["capo_s3.types.account_id.AccountId"] = None,
) -> None:
    """<p> Deletes an S3 Metadata configuration from a general purpose bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-overview.html">Accelerating data discovery with S3 Metadata</a> in the <i>Amazon S3 User Guide</i>. </p> <note> <p>You can use the V2 <code>DeleteBucketMetadataConfiguration</code> API operation with V1 or V2 metadata configurations. However, if you try to use the V1 <code>DeleteBucketMetadataTableConfiguration</code> API operation with V2 configurations, you will receive an HTTP <code>405 Method Not Allowed</code> error.</p> </note> <dl> <dt>Permissions</dt> <dd> <p>To use this operation, you must have the <code>s3:DeleteBucketMetadataTableConfiguration</code> permission. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-permissions.html">Setting up permissions for configuring metadata tables</a> in the <i>Amazon S3 User Guide</i>. </p> <note> <p>The IAM policy action name is the same for the V1 and V2 API operations.</p> </note> </dd> </dl> <p>The following operations are related to <code>DeleteBucketMetadataConfiguration</code>:</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucketMetadataConfiguration.html">CreateBucketMetadataConfiguration</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetadataConfiguration.html">GetBucketMetadataConfiguration</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UpdateBucketMetadataInventoryTableConfiguration.html">UpdateBucketMetadataInventoryTableConfiguration</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UpdateBucketMetadataJournalTableConfiguration.html">UpdateBucketMetadataJournalTableConfiguration</a> </p> </li> </ul> <important> <p>You must URL encode any signed header values that contain spaces. For example, if your header value is <code>my file.txt</code>, containing two spaces after <code>my</code>, you must URL encode this value to <code>my%20%20file.txt</code>.</p> </important>

    Args:
        bucket: <p> The general purpose bucket that you want to remove the metadata configuration from. </p>
        expected_bucket_owner: <p> The expected bucket owner of the general purpose bucket that you want to remove the metadata table configuration from. </p>

    Raises:
        capo_s3.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_s3.types.delete_bucket_metadata_configuration_request.DeleteBucketMetadataConfigurationRequest]",
    ) -> OperationResponse[None]:
        import capo_s3._operations.amazon_s3.delete_bucket_metadata_configuration

        output, http_response = (
            capo_s3._operations.amazon_s3.delete_bucket_metadata_configuration.delete_bucket_metadata_configuration(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteBucketMetadataConfiguration")
    )
    input_: capo_s3.types.delete_bucket_metadata_configuration_request.DeleteBucketMetadataConfigurationRequest = {
        "bucket": bucket
    }
    if expected_bucket_owner is not None:
        input_["expected_bucket_owner"] = expected_bucket_owner

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