Drop Table Partitions

Drops the table data within a specified period. Administrator privileges are required to call this API.

HTTP Request

DELETE /api/sonar/tables/:table/partitions
Request using cURL
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
KeyRequiredTypeDescriptionNote
tableOStringTable nameCase-sensitive. Minimum 1 to maximum 50 characters
startOStringStart dateyyyy-MM-dd format
endOStringEnd dateyyyy-MM-dd format. The end date is included in the range.
Note
Table names can only contain numbers, upper and lower case alphabets, and underscores.

Success Response

{}

Error Responses

Required argument is missing

HTTP status code 400

{
    "error_code": "null-argument",
    "error_msg": "start should be not null"
}
Invalid date format

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."
}
Invalid table name

HTTP status code 400

{
    "error_code": "invalid-argument",
    "error_msg": "'table' must begin with a letter and may contain alphanumeric and underscore characters: 0123"
}
No privileges to drop table partition

HTTP status code 500

{
    "error_code": "illegal-state",
    "error_msg": "no-permission"
}
Table is not found

HTTP status code 500

{
    "error_code": "illegal-state",
    "error_msg": "table not found: test"
}