All Products
Search
Document Center

Object Storage Service:SubmitLanceTableCleanupTask

Last Updated:Nov 02, 2026

Submits a Lance historical version cleanup task. The body must be non-empty, and at least one valid cleanup condition must be provided.

Permission notes

API

Action

Description

SubmitLanceTableCleanupTask

oss:PutTableMaintenanceConfiguration

Submits a historical version cleanup task.

Request syntax

POST /lance/oss/v1/table/{id}/cleanup HTTP/1.1
Host: {tableBucketHost}
Date: GMT Date
Authorization: SignatureValue
Content-Type: application/json

{
  "retain_versions": 2,
  "delete_unverified": false,
  "error_if_tagged_old_versions": false
}

Request parameters

For the common conventions of the interface (access address, table identifier, request and response headers, permissions, async submission and quota, task status, and error codes), see Lance table maintenance.

Parameter

Location

Required

Description

older_than

body

Conditionally required

string. Default value is an empty string. The time condition for historical version cleanup. Only whether the value is non-empty is checked on submission. For format requirements, see the combination constraint below.

retain_versions

body

Conditionally required

int64. Default value is 0. The number of versions to retain; cannot be negative. Must be greater than 0 when no non-empty older_than is provided.

delete_unverified

body

No

boolean. Default value is false. Currently only false is allowed; true returns 400 / InvalidInput / 13.

error_if_tagged_old_versions

body

No

boolean. Default value is false. Currently only false is allowed; true returns 400 / InvalidInput / 13.

Combination constraint: older_than is non-empty, or retain_versions > 0; at least one must be satisfied. Both can also be provided at the same time.

older_than format

older_than supported units: For one week, write 7d or 168h; 1w is not supported. 0d and 007d are supported. Decimals, negative numbers, compound units, uppercase letters, and spaces are not supported (for example, 1.5d, -7d, 1h30m, 7D, 7 d).

Unit

Meaning

Example

d

Day

7d

h

Hour

168h

m

Minute

30m

s

Second

45s

Submission validation examples:

Request body

Submission result

{"retain_versions":2}

Accepted; remaining default values are filled in

{"retain_versions":0}

Rejected; missing cleanup condition

{} or empty body

Rejected

{"retain_versions":-1}

Rejected

{"retain_versions":2,"delete_unverified":true}

Rejected

{"retain_versions":2,"error_if_tagged_old_versions":true}

Rejected

Response

HTTP/1.1 200 OK
Content-Type: application/json
x-oss-table-id: {table_id}

{
  "task_id": "123xxxxxxxxxxxxxxxxxxx",
  "status": "submitted"
}

When querying, this corresponds to task_type=lance_cleanup.

Error codes

This interface uses the unified Lance JSON error format. For common error codes and the error response structure, see Lance table maintenance in the common conventions.