All Products
Search
Document Center

Object Storage Service:PutTableMaintenanceConfiguration

Last Updated:May 09, 2026

Mengatur konfigurasi pemeliharaan otomatis untuk tabel tertentu. Jenis yang didukung adalah icebergCompaction (kompaksi tabel Iceberg), yang menggabungkan file kecil untuk meningkatkan performa kueri, dan icebergSnapshotManagement (manajemen snapshot Iceberg), yang menghapus snapshot kedaluwarsa guna mengurangi beban penyimpanan.

Usage notes

  • Anda hanya dapat mengonfigurasi satu jenis pemeliharaan per panggilan.

Permissions

API

Action

Description

PutTableMaintenanceConfiguration

oss:PutTableMaintenanceConfiguration

Mengatur konfigurasi maintenance tabel dan memeriksa kebijakan tabel.

Request syntax

PUT /tables/{tableBucketARN}/{namespace}/{name}/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": {
         "icebergCompaction": {
            "targetFileSizeMB": number,
            "strategy": "string"
         }
      }
   }
}

Request parameters

Parameter

Type

Required

Example

Description

tableBucketARN

string

Yes

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

Nama Sumber Daya Alibaba Cloud (ARN) dari bucket tabel. Formatnya adalah acs:osstables:{region}:{uid}:bucket/{bucketName}.

namespace

string

Yes

my_namespace

Nama namespace tabel.

name

string

Yes

my_table

Nama tabel.

type

string

Yes

icebergCompaction

Jenis maintenance. Nilai yang valid: icebergCompaction (kompaksi tabel Iceberg) atau icebergSnapshotManagement (manajemen snapshot Iceberg).

value

container

Yes

-

Kontainer untuk konfigurasi maintenance.

Parent node: None

Child nodes: status, settings

status

string

No

enabled

Status konfigurasi maintenance. Nilai yang valid: enabled atau disabled.

Parent node: value

settings

container

No

-

Kontainer untuk parameter konfigurasi.

Parent node: value

Child nodes: icebergCompaction, icebergSnapshotManagement

icebergCompaction

container

No

-

Kontainer untuk konfigurasi detail kompaksi tabel Iceberg.

Parent node: settings

Child nodes: targetFileSizeMB, strategy

targetFileSizeMB

integer

No

100

Ukuran file target dalam MB setelah kompaksi. Nilainya harus berupa bilangan bulat antara 1 hingga 2.147.483.647.

Parent node: icebergCompaction

strategy

string

No

auto

Strategi kompaksi. Nilai yang valid: auto, binpack, sort, atau z-order.

Parent node: icebergCompaction

icebergSnapshotManagement

container

No

-

Kontainer untuk konfigurasi detail manajemen snapshot Iceberg.

Parent node: settings

Child nodes: minSnapshotsToKeep, maxSnapshotAgeHours

minSnapshotsToKeep

integer

No

3

Jumlah minimum snapshot yang harus dipertahankan. Nilainya harus berupa bilangan bulat antara 1 hingga 2.147.483.647.

Parent node: icebergSnapshotManagement

maxSnapshotAgeHours

integer

No

72

Usia maksimum snapshot dalam jam sebelum memenuhi syarat untuk dihapus. Nilainya harus berupa bilangan bulat antara 1 hingga 2.147.483.647.

Parent node: icebergSnapshotManagement

Examples

Example 1: Configure Iceberg table compaction

Request sample

PUT /tables/acs%3Aosstables%3Acn-hangzhou%3A1234567890%3Abucket%2Fmy-table-bucket/my_namespace/my_table/maintenance/icebergCompaction HTTP/1.1
Content-type: application/json
Host: cn-hangzhou.oss-tables.aliyuncs.com
Date: Thu, 10 Apr 2025 08:00:00 GMT
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/osstables/aliyun_v4_request,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c****

{
   "value": {
      "status": "enabled",
      "settings": {
         "icebergCompaction": {
            "targetFileSizeMB": 100,
            "strategy": "auto"
         }
      }
   }
}

Response sample

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

Example 2: Configure Iceberg snapshot management

Request sample

PUT /tables/acs%3Aosstables%3Acn-hangzhou%3A1234567890%3Abucket%2Fmy-table-bucket/my_namespace/my_table/maintenance/icebergSnapshotManagement HTTP/1.1
Content-type: application/json
Host: cn-hangzhou.oss-tables.aliyuncs.com
Date: Thu, 10 Apr 2025 08:00:00 GMT
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/osstables/aliyun_v4_request,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c****

{
   "value": {
      "status": "enabled",
      "settings": {
         "icebergSnapshotManagement": {
            "minSnapshotsToKeep": 3,
            "maxSnapshotAgeHours": 72
         }
      }
   }
}

Response sample

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

SDKs

Anda dapat memanggil operasi ini menggunakan SDK berikut:

ossutil CLI

Perintah ossutil yang sesuai adalah put-table-maintenance-configuration.

Error codes

Error code

HTTP status code

Description

BadRequestException

400

Permintaan tidak valid atau rusak.

ForbiddenException

403

Anda tidak memiliki izin untuk melakukan permintaan ini.

NotFoundException

404

Resource yang diminta tidak ada.