생명주기 프로파일 생성

새 생명주기 프로파일을 생성합니다. 이 작업은 관리자 권한을 요구합니다.

필요 권한

관리자 이상의 계정으로 이용할 수 있습니다.

HTTP 요청

POST /api/sonar/lifecycle-profiles
cURL 예시
curl -H "Authorization: Bearer <API_KEY>" \
    -d name="default" \
    -d description="default profile" \
    -d configs="{"hot": {"retention": 10}, "cold": {"base_path": "/cold", "retention": 375, "options": {"quota_per_node_unit": "tb", "quota_per_node": 200, "direct_copy": false}}}" \
    -X POST "https://HOSTNAME/api/sonar/lifecycle-profiles"
요청 매개변수
필수타입설명비고
guidX문자열생명주기 프로파일 GUID36자. 기본값은 무작위 생성
nameO문자열생명주기 프로파일 화면 표시 이름최소 1자, 최대 50자
descriptionX문자열생명주기 프로파일 설명최대 2,000자
configsX문자열 키/값설정 값JSON 형식 문자열
Tip
현재 name이 "default"인 프로파일만 사용됩니다.

configs는 JSON 형식의 문자열이며 아래의 속성을 포함합니다:

  • hot/warm/cold (맵): 스토리지 계층(Hot, Warm, Cold)별 설정
    • base_path (문자열, 필수): 데이터를 저장할 기본 경로. warm/cold 계층에서만 지정할 수 있으며, hot 계층에서는 사용할 수 없습니다.
    • retention (32비트 정수, 필수): 일 단위 데이터 보관 기간. 생성 날짜 기준으로 보관 기간이 지나면 하위 계층으로 이동(1~9999일)
    • options (맵, 선택): 생명주기 프로파일 선택 옵션
      • quota_per_node (32비트 정수, 선택): 노드 단위로 할당된 저장 공간. 설정 시 quota_per_node_unit도 함께 지정해야 합니다.
      • quota_per_node_unit (문자열, 선택): quota_per_node의 단위. mb, gb, tb 중 하나를 입력하세요. quota_per_node 설정 시 필수입니다.
      • direct_copy (불리언, 선택): 롤오버할 때 직접 복사 여부. 기본값은 계층별로 다릅니다(warm: false, cold: true).
      • rollover_on_diskfull (불리언, 선택): 디스크 공간 부족 시 롤오버 수행 여부(기본값: false)

정상 응답

{}

오류 응답

guid 매개변수 타입이 잘못된 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-param-type",
  "error_msg": "guid should be guid type."
}
guid가 중복된 경우

HTTP 상태 코드 500 응답

{
  "error_code": "illegal-state",
  "error_msg": "duplicated profile guid: 4ab572a7-f052-4f90-82db-320444e229a3"
}
name 매개변수 값의 길이가 잘못된 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-argument",
  "error_msg": "'name' must be less than or equal to 50 characters."
}
name이 중복된 경우

HTTP 상태 코드 500 응답

{
  "error_code": "illegal-state",
  "error_msg": "duplicated profile name: default"
}
description 매개변수 값의 길이가 잘못된 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-argument",
  "error_msg": "'description' must be less than or equal to 2000 characters."
}
configs JSON 파싱 오류가 발생한 경우

HTTP 상태 코드 500 응답

{
  "error_code": "illegal-state",
  "error_msg": "invalid-configs"
}
base_path를 Hot 스토리지 계층에 설정한 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-argument",
  "error_msg": "'base_path' cannot be set in the 'hot' tier."
}
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"
}
생명주기 프로파일 생성 권한이 없는 경우

HTTP 상태 코드 500 응답

{
  "error_code": "illegal-state",
  "error_msg": "no-permission"
}