생명주기 프로파일 생성
새 생명주기 프로파일을 생성합니다. 기존 프로파일의 설정은 생명주기 프로파일 수정 API로 변경할 수 있습니다.
필요 권한
관리자 이상의 계정으로 이용할 수 있습니다.
HTTP 요청
POST /api/sonar/lifecycle-profiles
cURL 예시
curl -H "Authorization: Bearer <API_KEY>" \
-d 'name=default' \
-d 'description=default lifecycle profile' \
-d 'configs={"hot": {"retention": 10}, "cold": {"base_path": "/cold", "retention": 375, "options": {"quota_per_node": 200, "quota_per_node_unit": "tb", "direct_copy": false}}}' \
-X POST \
https://HOSTNAME/api/sonar/lifecycle-profiles
요청 매개변수
| 키 | 필수 | 타입 | 설명 | 비고 |
|---|---|---|---|---|
| guid | X | 문자열 | 생명주기 프로파일 GUID | 36자. 미지정 시 무작위 생성 |
| name | O | 문자열 | 생명주기 프로파일 화면 표시 이름 | 최소 1자, 최대 50자 |
| description | X | 문자열 | 생명주기 프로파일 설명 | 최대 2,000자 |
| configs | X | 문자열 키/값 | 스토리지 계층별 설정 값 | JSON 형식 문자열 |
Tip
현재 name이 "default"인 프로파일만 실제 스토리지 관리에 적용됩니다.
configs는 JSON 형식의 문자열이며 아래의 속성을 포함합니다:
- hot/warm/cold (맵): 스토리지 계층(Hot, Warm, Cold)별 설정
- base_path (문자열): 데이터를 저장할 기본 경로. warm/cold 계층에서는 필수이며, hot 계층에서는 지정할 수 없습니다.
- retention (32비트 정수): 일 단위 데이터 보관 기간. 생성 날짜 기준으로 보관 기간이 지나면 하위 계층으로 이동합니다. 0 이상의 값을 지정합니다.
- options (맵): 생명주기 프로파일 선택 옵션
- quota_per_node (32비트 정수): 노드 단위로 할당된 저장 공간. 0 이상의 값을 지정하며, 설정 시 quota_per_node_unit도 함께 지정해야 합니다.
- quota_per_node_unit (문자열): quota_per_node의 단위.
%,mb,gb,tb중 하나(대소문자 구분 없음)를 지정합니다. quota_per_node 설정 시 필수입니다. - direct_copy (불리언): 롤오버할 때 직접 복사 여부
- rollover_on_diskfull (불리언): 디스크 공간 부족 시 롤오버 수행 여부
정상 응답
{}
오류 응답
name이 누락된 경우
HTTP 상태 코드 400 응답
{
"error_code": "null-argument",
"error_msg": "name should be not null"
}
name 값의 길이가 잘못된 경우
HTTP 상태 코드 400 응답
{
"error_code": "invalid-argument",
"error_msg": "'name' must be shorter than or equal to 50 characters."
}
description 값의 길이가 잘못된 경우
HTTP 상태 코드 400 응답
{
"error_code": "invalid-argument",
"error_msg": "'description' must be shorter than or equal to 2000 characters."
}
guid가 GUID 형식이 아닌 경우
HTTP 상태 코드 400 응답
{
"error_code": "invalid-param-type",
"error_msg": "guid should be guid type."
}
configs가 올바른 JSON 형식이 아닌 경우
HTTP 상태 코드 400 응답
{
"error_code": "invalid-argument",
"error_msg": "'configs' parameter should follow valid JSON syntax"
}
base_path를 Hot 계층에 설정한 경우
HTTP 상태 코드 400 응답
{
"error_code": "invalid-argument",
"error_msg": "'base_path' cannot be set in the 'hot' tier."
}
Warm 또는 Cold 계층에 base_path가 누락된 경우
HTTP 상태 코드 400 응답
{
"error_code": "invalid-argument",
"error_msg": "`base_path` is required: warm"
}
retention 값이 음수인 경우
HTTP 상태 코드 400 응답
{
"error_code": "invalid-argument",
"error_msg": "'retention' must be grater than 0: warm"
}
quota_per_node 값이 음수인 경우
HTTP 상태 코드 400 응답
{
"error_code": "invalid-argument",
"error_msg": "'quota_per_node' must be grater than 0"
}
quota_per_node_unit이 누락된 경우
HTTP 상태 코드 500 응답
{
"error_code": "illegal-state",
"error_msg": "`quota_per_node_unit` must also be set, if `quota_per_node` is configured."
}
지원되지 않는 quota_per_node_unit 값인 경우
HTTP 상태 코드 400 응답
{
"error_code": "invalid-argument",
"error_msg": "unsupported 'quota_per_node_unit' type:invalid_unit"
}
guid가 중복된 경우
HTTP 상태 코드 500 응답
{
"error_code": "illegal-state",
"error_msg": "duplicated profile guid: 4ab572a7-f052-4f90-82db-320444e229a3"
}
name이 중복된 경우
HTTP 상태 코드 500 응답
{
"error_code": "illegal-state",
"error_msg": "duplicated profile name: default"
}
권한이 없는 경우
HTTP 상태 코드 500 응답
{
"error_code": "illegal-state",
"error_msg": "no-permission"
}