Skip to content

get_bucket_metadata_table_configuration async

get_bucket_metadata_table_configuration(
    bucket: BucketName,
    *,
    config_overrides: Optional[AsyncS3ClientConfig] = None,
    expected_bucket_owner: Optional[AccountId] = None,
) -> GetBucketMetadataTableConfigurationOutput

We recommend that you retrieve your S3 Metadata configurations by using the V2 GetBucketMetadataTableConfiguration API operation. We no longer recommend using the V1 GetBucketMetadataTableConfiguration API operation.

If you created your S3 Metadata configuration before July 15, 2025, we recommend that you delete and re-create your configuration by using CreateBucketMetadataConfiguration so that you can expire journal table records and create a live inventory table.

Retrieves the V1 S3 Metadata configuration for 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 GetBucketMetadataConfiguration API operation with V1 or V2 metadata table configurations. However, if you try to use the V1 GetBucketMetadataTableConfiguration API operation with V2 configurations, you will receive an HTTP 405 Method Not Allowed error.

Make sure that you update your processes to use the new V2 API operations (CreateBucketMetadataConfiguration, GetBucketMetadataConfiguration, and DeleteBucketMetadataConfiguration) instead of the V1 API operations.

Permissions

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

The following operations are related to GetBucketMetadataTableConfiguration:

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 corresponds to the metadata table configuration that you want to retrieve.

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

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

Raises:

Source code in docs_src/capo_s3/_services/async_s3.py
async def get_bucket_metadata_table_configuration(
    self,
    bucket: "capo_s3.types.bucket_name.BucketName",
    *,
    config_overrides: Optional[AsyncS3ClientConfig] = None,
    expected_bucket_owner: Optional["capo_s3.types.account_id.AccountId"] = None,
) -> "capo_s3.types.get_bucket_metadata_table_configuration_output.GetBucketMetadataTableConfigurationOutput":
    """<important> <p> We recommend that you retrieve your S3 Metadata configurations by using the V2 <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetadataTableConfiguration.html">GetBucketMetadataTableConfiguration</a> API operation. We no longer recommend using the V1 <code>GetBucketMetadataTableConfiguration</code> API operation. </p> <p>If you created your S3 Metadata configuration before July 15, 2025, we recommend that you delete and re-create your configuration by using <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucketMetadataConfiguration.html">CreateBucketMetadataConfiguration</a> so that you can expire journal table records and create a live inventory table.</p> </important> <p> Retrieves the V1 S3 Metadata configuration for 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>GetBucketMetadataConfiguration</code> API operation with V1 or V2 metadata table configurations. However, if you try to use the V1 <code>GetBucketMetadataTableConfiguration</code> API operation with V2 configurations, you will receive an HTTP <code>405 Method Not Allowed</code> error.</p> <p>Make sure that you update your processes to use the new V2 API operations (<code>CreateBucketMetadataConfiguration</code>, <code>GetBucketMetadataConfiguration</code>, and <code>DeleteBucketMetadataConfiguration</code>) instead of the V1 API operations. </p> </note> <dl> <dt>Permissions</dt> <dd> <p>To use this operation, you must have the <code>s3:GetBucketMetadataTableConfiguration</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> </dd> </dl> <p>The following operations are related to <code>GetBucketMetadataTableConfiguration</code>:</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucketMetadataTableConfiguration.html">CreateBucketMetadataTableConfiguration</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetadataTableConfiguration.html">DeleteBucketMetadataTableConfiguration</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 corresponds to the metadata table configuration that you want to retrieve. </p>
        expected_bucket_owner: <p> The expected owner of the general purpose bucket that you want to retrieve the metadata table configuration for. </p>

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

    async def _handler(
        req: "AsyncOperationRequest[capo_s3.types.get_bucket_metadata_table_configuration_request.GetBucketMetadataTableConfigurationRequest]",
    ) -> AsyncOperationResponse[
        "capo_s3.types.get_bucket_metadata_table_configuration_output.GetBucketMetadataTableConfigurationOutput"
    ]:
        import capo_s3._operations.amazon_s3.get_bucket_metadata_table_configuration

        (
            output,
            http_response,
        ) = await capo_s3._operations.amazon_s3.get_bucket_metadata_table_configuration.async_get_bucket_metadata_table_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

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

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