Drop Table Partitions
Drops the table data within a specified period. This operation requires administrator privileges.
Required Permissions
Requires the ADMIN role or higher.
HTTP Request
DELETE /api/sonar/tables/:table/partitions
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
-X DELETE "https://HOSTNAME/api/sonar/tables/demo/partitions?start=2022-01-01&end=2022-12-31"
Request Parameters
| Key | Required | Type | Description | Note |
|---|---|---|---|---|
| table | Yes | String | Table name | Minimum 1 to maximum 50 characters |
| start | Yes | String | Start date | yyyy-MM-dd format |
| end | Yes | String | End date | yyyy-MM-dd format. The end date is included in the range. |
Note
Table names must start with a letter and may contain alphanumeric characters, underscores, and hyphens.
Success Response
{}
Error Responses
table parameter is missing
HTTP status code 400
{
"error_code": "null-argument",
"error_msg": "table should be not null"
}
table parameter length is invalid
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "'table' must be shorter than or equal to 50 characters."
}
table name violates naming rules
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "'table' must begin with a letter and may contain alphanumeric and underscore characters: 0123"
}
start parameter is missing
HTTP status code 400
{
"error_code": "null-argument",
"error_msg": "start should be not null"
}
end parameter is missing
HTTP status code 400
{
"error_code": "null-argument",
"error_msg": "end should be not null"
}
start, end date format is invalid
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "'end' should be yyyy-MM-dd format."
}
start date is later than end date
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "date range is unacceptable."
}
Table is not found
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "table not found: test"
}
Permission denied
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "no-permission"
}