Set Table Retention

HTTP Request

PUT /api/sonar/tables/:table/retention
Request using cURL
curl -H "Authorization: Bearer <API_KEY>" \
     -X PUT \
     "https://HOSTNAME/api/sonar/tables/demo/retention?period=180"
Request Parameters
KeyRequiredTypeDescriptionNote
tableOStringTable nameCase-sensitive. Minimum 1 to maximum 50 characters
periodO32-bit integerRetention period (days)Minimum: 0 (unlimited), Maximum: 36500
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": "period should be not null"
}
Retention period out of valid range

HTTP status code 400

{
    "error_code": "invalid-argument",
    "error_msg": "'period' must be less than or equal to 36500."
}
Table is not found

HTTP status code 500

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