Skip to content

rename_table async

rename_table(
    table_bucket_arn: TableBucketARN,
    namespace: NamespaceName,
    name: TableName,
    *,
    config_overrides: Optional[AsyncS3TablesClientConfig] = None,
    new_namespace_name: Optional[NamespaceName] = None,
    new_name: Optional[TableName] = None,
    version_token: Optional[VersionToken] = None,
) -> None

Renames a table or a namespace. For more information, see S3 Tables in the Amazon Simple Storage Service User Guide.

Permissions

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

Parameters:

  • table_bucket_arn (TableBucketARN) –

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

  • namespace (NamespaceName) –

    The namespace associated with the table.

  • name (TableName) –

    The current name of the table.

  • new_namespace_name (Optional[NamespaceName], default: None ) –

    The new name for the namespace.

  • new_name (Optional[TableName], default: None ) –

    The new name for the table.

  • version_token (Optional[VersionToken], default: None ) –

    The version token of the table.

Raises:

Source code in docs_src/capo_s3tables/_services/async_s3_tables.py
async def rename_table(
    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",
    *,
    config_overrides: Optional[AsyncS3TablesClientConfig] = None,
    new_namespace_name: Optional[
        "capo_s3tables.types.namespace_name.NamespaceName"
    ] = None,
    new_name: Optional["capo_s3tables.types.table_name.TableName"] = None,
    version_token: Optional[
        "capo_s3tables.types.version_token.VersionToken"
    ] = None,
) -> None:
    """<p>Renames a table or a namespace. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-tables.html">S3 Tables</a> in the <i>Amazon Simple Storage Service User Guide</i>.</p> <dl> <dt>Permissions</dt> <dd> <p>You must have the <code>s3tables:RenameTable</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 associated with the table. </p>
        name: <p>The current name of the table.</p>
        new_namespace_name: <p>The new name for the namespace.</p>
        new_name: <p>The new name for the table.</p>
        version_token: <p>The version token of 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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_s3tables.types.rename_table_request.RenameTableRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_s3tables._operations.s3_table_buckets.rename_table

        (
            output,
            http_response,
        ) = await capo_s3tables._operations.s3_table_buckets.rename_table.async_rename_table(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RenameTable")
    )
    input_: capo_s3tables.types.rename_table_request.RenameTableRequest = {
        "table_bucket_arn": table_bucket_arn,
        "namespace": namespace,
        "name": name,
    }
    if new_namespace_name is not None:
        input_["new_namespace_name"] = new_namespace_name
    if new_name is not None:
        input_["new_name"] = new_name
    if version_token is not None:
        input_["version_token"] = version_token

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