테이블 생성
새로운 테이블을 생성합니다. 이 작업은 테이블 관리자 권한을 요구합니다.
필요 권한
관리자 이상의 계정으로 이용할 수 있습니다.
HTTP 요청
POST /api/sonar/tables
cURL 예시
curl -H "Authorization: Bearer <API_KEY>" \
-d table=demo \
-d compression=snappy \
-d layout=columnar \
-d retention=365 \
-X POST \
https://HOSTNAME/api/sonar/tables
요청 매개변수
| 키 | 필수 | 타입 | 설명 | 비고 |
|---|---|---|---|---|
| table | O | 문자열 | 테이블 이름 | 최소 1자, 최대 50자 |
| compression | X | 문자열 | 압축 알고리즘 | deflate 또는 snappy. 기본값 snappy |
| layout | X | 문자열 | 블록 레이아웃 | row 또는 columnar. 기본값 columnar |
| crypto_profile_guid | X | 문자열 | 암호화 프로파일 GUID | 36자 GUID |
| encryption | X | 불리언 | 암호화 사용 여부 | 기본값 false (무결성 검증만) |
| retention | X | 32비트 정수 | 일 단위 보관 주기 | 최소 0 (무제한), 최대 36500. 기본값 0 |
| group_guid | X | 문자열 | 테이블 그룹 GUID | 36자 GUID |
Note
테이블 이름은 영문자로 시작해야 하며, 영문 대소문자, 숫자, 밑줄(_), 하이픈(-)만 사용 가능합니다.
정상 응답
{}
오류 응답
table이 누락된 경우
HTTP 상태 코드 400 응답
{
"error_code": "null-argument",
"error_msg": "table should be not null"
}
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' must begin with a letter and may contain alphanumeric and underscore characters: 0123"
}
compression 값이 잘못된 경우
HTTP 상태 코드 400 응답
{
"error_code": "invalid-argument",
"error_msg": "'compression' should be one of deflate or snappy."
}
layout 값이 잘못된 경우
HTTP 상태 코드 400 응답
{
"error_code": "invalid-argument",
"error_msg": "'layout' should be one of row or columnar."
}
crypto_profile_guid가 GUID 형식이 아닌 경우
HTTP 상태 코드 400 응답
{
"error_code": "invalid-param-type",
"error_msg": "crypto_profile_guid should be guid type."
}
retention 값이 범위를 벗어난 경우
HTTP 상태 코드 400 응답
{
"error_code": "invalid-argument",
"error_msg": "'retention' must be less than or equal to 36500."
}
group_guid가 GUID 형식이 아닌 경우
HTTP 상태 코드 400 응답
{
"error_code": "invalid-param-type",
"error_msg": "group_guid should be guid type."
}
테이블 이름이 중복된 경우
HTTP 상태 코드 500 응답
{
"error_code": "illegal-state",
"error_msg": "duplicated table name: demo"
}
암호화 프로파일이 존재하지 않는 경우
HTTP 상태 코드 500 응답
{
"error_code": "illegal-state",
"error_msg": "crypto profile not found: 6f238ab0-7c11-4dc3-9543-ebb3d1cdde12"
}
테이블 그룹이 존재하지 않는 경우
HTTP 상태 코드 500 응답
{
"error_code": "illegal-state",
"error_msg": "table group not found: 54157629-74f7-4d80-be5a-8cb8f0c71087"
}
테이블 생성 권한이 없는 경우
HTTP 상태 코드 500 응답
{
"error_code": "illegal-state",
"error_msg": "no-permission"
}