테이블 보관주기 설정
지정한 테이블의 데이터 보관 기간을 설정합니다.
필요 권한
관리자 이상의 계정으로 이용할 수 있습니다.
HTTP 요청
PUT /api/sonar/tables/:table/retention
cURL 예시
curl -H "Authorization: Bearer <API_KEY>" \
-X PUT \
"https://HOSTNAME/api/sonar/tables/demo/retention?period=180"
요청 매개변수
경로 매개변수
| 키 | 타입 | 설명 | 비고 |
|---|---|---|---|
| table | 문자열 | 테이블 이름 | 최소 1자, 최대 50자 |
요청 본문 매개변수
| 키 | 필수 | 타입 | 설명 | 비고 |
|---|---|---|---|---|
| period | O | 32비트 정수 | 보관 일수 | 최소 0 (무제한), 최대 36500 |
Note
테이블 이름은 영문자로 시작해야 하며, 영문 대소문자, 숫자, 밑줄(_), 하이픈(-)만 사용 가능합니다.
정상 응답
{}
오류 응답
table 값의 길이가 잘못된 경우
HTTP 상태 코드 400 응답
{
"error_code": "invalid-argument",
"error_msg": "'table' must be shorter than or equal to 50 characters."
}
table 이름이 규칙을 벗어난 경우
HTTP 상태 코드 400 응답
{
"error_code": "invalid-argument",
"error_msg": "table name must begin with a letter and may contain alphanumeric and underscore characters: 0123"
}
period가 누락된 경우
HTTP 상태 코드 400 응답
{
"error_code": "null-argument",
"error_msg": "period should be not null"
}
period 값이 범위를 벗어난 경우
HTTP 상태 코드 400 응답
{
"error_code": "invalid-argument",
"error_msg": "'period' must be less than or equal to 36500."
}
테이블이 존재하지 않는 경우
HTTP 상태 코드 500 응답
{
"error_code": "illegal-state",
"error_msg": "table not found: demo"
}
권한이 없는 경우
HTTP 상태 코드 500 응답
{
"error_code": "illegal-state",
"error_msg": "no-permission"
}