PutTableBucketMaintenanceConfiguration

更新时间:
复制 MD 格式

Sets or updates the maintenance configuration for a Table Bucket to automatically clean up unreferenced data files in Iceberg tables.

Usage notes

  • Only the icebergUnreferencedFileRemoval maintenance type is supported, which automatically deletes unreferenced Iceberg data files.

  • Use the status field to enable (enabled) or disable (disabled) this maintenance feature.

  • unreferencedDays specifies how long unreferenced files are retained, and nonCurrentDays specifies how long non-current version files are retained.

Permissions

API

Action

Description

PutTableBucketMaintenanceConfiguration

oss:PutTableBucketMaintenanceConfiguration

Sets the maintenance configuration for a Table Bucket.

Request syntax

PUT /buckets/{tableBucketARN}/maintenance/{type} HTTP/1.1
Content-type: application/json
Host: cn-hangzhou.oss-tables.aliyuncs.com
Date: GMT Date
Authorization: SignatureValue

{
   "value": {
      "status": "string",
      "settings": {
         "icebergUnreferencedFileRemoval": {
            "unreferencedDays": number,
            "nonCurrentDays": number
         }
      }
   }
}

Request parameters

Parameter

Type

Required

Example

Description

tableBucketARN

string

Yes

acs:osstables:cn-hangzhou:1234567890:bucket/my-table-bucket

The Alibaba Cloud Resource Name (ARN) of the Table Bucket. The format is acs:osstables:{region}:{accountId}:bucket/{bucketName}.

type

string

Yes

icebergUnreferencedFileRemoval

The maintenance type. Currently, only icebergUnreferencedFileRemoval is supported.

value

container

No

-

The status and settings for the maintenance configuration.

status

string

No

enabled

The status of the maintenance feature. Valid values: enabled and disabled. Parent node: value

settings

container

No

-

The detailed settings for the maintenance type.

Parent node: value.

Child node: icebergUnreferencedFileRemoval

icebergUnreferencedFileRemoval

container

No

-

Specifies the settings for Iceberg unreferenced file removal.

Parent node: settings.

Child nodes: unreferencedDays, nonCurrentDays

unreferencedDays

integer

No

5

The number of days to retain unreferenced files. Valid values: 1 to 2,147,483,647.

Parent node: icebergUnreferencedFileRemoval

nonCurrentDays

integer

No

15

The number of days to retain non-current version files. Valid values: 1 to 2,147,483,647.

Parent node: icebergUnreferencedFileRemoval

Examples

Request example

PUT /buckets/acs%3Aosstables%3Acn-hangzhou%3A1234567890%3Abucket%2Fmy-table-bucket/maintenance/icebergUnreferencedFileRemoval HTTP/1.1
Content-Type: application/json
Host: cn-hangzhou.oss-tables.aliyuncs.com
Date: GMT Date
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/osstables/aliyun_v4_request,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c****

{
   "value": {
      "status": "enabled",
      "settings": {
         "icebergUnreferencedFileRemoval": {
            "unreferencedDays": 5,
            "nonCurrentDays": 15
         }
      }
   }
}

Response example

HTTP/1.1 204 No Content
Server: AliyunOSS
x-oss-request-id: 5C06A3B67B8B5A3DA422****
x-oss-server-time: 3

SDKs

The following SDKs support this operation:

ossutil command-line tool

To call this operation from the command line, use the ossutil command put-table-bucket-maintenance-configuration.

Error codes

Error code

HTTP status code

Description

BadRequestException

400

The request is invalid or malformed.

ForbiddenException

403

You are not authorized to perform this operation.

NotFoundException

404

The specified resource does not exist.