Sets or updates the maintenance configuration for a Table Bucket to automatically clean up unreferenced data files in Iceberg tables.
Usage notes
-
Only the
icebergUnreferencedFileRemovalmaintenance type is supported, which automatically deletes unreferenced Iceberg data files. -
Use the
statusfield to enable (enabled) or disable (disabled) this maintenance feature. -
unreferencedDaysspecifies how long unreferenced files are retained, andnonCurrentDaysspecifies 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 |
|
type |
string |
Yes |
icebergUnreferencedFileRemoval |
The maintenance type. Currently, only |
|
value |
container |
No |
- |
The status and settings for the maintenance configuration. |
|
status |
string |
No |
enabled |
The status of the maintenance feature. Valid values: |
|
settings |
container |
No |
- |
The detailed settings for the maintenance type. Parent node: Child node: |
|
icebergUnreferencedFileRemoval |
container |
No |
- |
Specifies the settings for Iceberg unreferenced file removal. Parent node: Child nodes: |
|
unreferencedDays |
integer |
No |
5 |
The number of days to retain unreferenced files. Valid values: 1 to 2,147,483,647. Parent node: |
|
nonCurrentDays |
integer |
No |
15 |
The number of days to retain non-current version files. Valid values: 1 to 2,147,483,647. Parent node: |
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. |