Skip to content

update_table_metadata_location

update_table_metadata_location(
    table_bucket_arn: TableBucketARN,
    namespace: NamespaceName,
    name: TableName,
    version_token: VersionToken,
    metadata_location: MetadataLocation,
    *,
    config_overrides: Optional[S3TablesClientConfig] = None,
) -> UpdateTableMetadataLocationResponse

Updates the metadata location for a table. The metadata location of a table must be an S3 URI that begins with the table's warehouse location. The metadata location for an Apache Iceberg table must end with .metadata.json, or if the metadata file is Gzip-compressed, .metadata.json.gz.

Permissions

You must have the s3tables:UpdateTableMetadataLocation permission to use this operation.

Parameters:

  • table_bucket_arn (TableBucketARN) –

    The Amazon Resource Name (ARN) of the table bucket.

  • namespace (NamespaceName) –

    The namespace of the table.

  • name (TableName) –

    The name of the table.

  • version_token (VersionToken) –

    The version token of the table.

  • metadata_location (MetadataLocation) –

    The new metadata location for the table.

Raises:

Source code in docs_src/capo_s3tables/_services/s3_tables.py
def update_table_metadata_location(
    self,
    table_bucket_arn: "capo_s3tables.types.table_bucket_arn.TableBucketARN",
    namespace: "capo_s3tables.types.namespace_name.NamespaceName",
    name: "capo_s3tables.types.table_name.TableName",
    version_token: "capo_s3tables.types.version_token.VersionToken",
    metadata_location: "capo_s3tables.types.metadata_location.MetadataLocation",
    *,
    config_overrides: Optional[S3TablesClientConfig] = None,
) -> "capo_s3tables.types.update_table_metadata_location_response.UpdateTableMetadataLocationResponse":
    """<p>Updates the metadata location for a table. The metadata location of a table must be an S3 URI that begins with the table's warehouse location. The metadata location for an Apache Iceberg table must end with <code>.metadata.json</code>, or if the metadata file is Gzip-compressed, <code>.metadata.json.gz</code>.</p> <dl> <dt>Permissions</dt> <dd> <p>You must have the <code>s3tables:UpdateTableMetadataLocation</code> permission to use this operation. </p> </dd> </dl>

    Args:
        table_bucket_arn: <p>The Amazon Resource Name (ARN) of the table bucket. </p>
        namespace: <p>The namespace of the table.</p>
        name: <p>The name of the table.</p>
        version_token: <p>The version token of the table. </p>
        metadata_location: <p>The new metadata location for the table. </p>

    Raises:
        capo_s3tables.errors.bad_request_exception.BadRequestException: <p>The request is invalid or malformed.</p>
        capo_s3tables.errors.conflict_exception.ConflictException: <p>The request failed because there is a conflict with a previous write. You can retry the request.</p>
        capo_s3tables.errors.forbidden_exception.ForbiddenException: <p>The caller isn't authorized to make the request.</p>
        capo_s3tables.errors.internal_server_error_exception.InternalServerErrorException: <p>The request failed due to an internal server error.</p>
        capo_s3tables.errors.not_found_exception.NotFoundException: <p>The request was rejected because the specified resource could not be found.</p>
        capo_s3tables.errors.too_many_requests_exception.TooManyRequestsException: <p>The limit on the number of requests per second was exceeded.</p>
        capo_s3tables.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_s3tables.types.update_table_metadata_location_request.UpdateTableMetadataLocationRequest]",
    ) -> OperationResponse[
        "capo_s3tables.types.update_table_metadata_location_response.UpdateTableMetadataLocationResponse"
    ]:
        import capo_s3tables._operations.s3_table_buckets.update_table_metadata_location

        output, http_response = (
            capo_s3tables._operations.s3_table_buckets.update_table_metadata_location.update_table_metadata_location(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateTableMetadataLocation")
    )
    input_: capo_s3tables.types.update_table_metadata_location_request.UpdateTableMetadataLocationRequest = {
        "table_bucket_arn": table_bucket_arn,
        "namespace": namespace,
        "name": name,
        "version_token": version_token,
        "metadata_location": metadata_location,
    }

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