생명주기 프로파일 수정

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

필요 권한

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

HTTP 요청

PUT /api/sonar/lifecycle-profiles/:guid
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 PUT "https://HOSTNAME/api/sonar/lifecycle-profiles/b76c3c81-c961-404f-a0eb-fae2f12f5bd8"
요청 매개변수
경로 매개변수
타입설명비고
guid문자열생명주기 프로파일 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)

정상 응답

{}

오류 응답

필수 매개변수가 누락된 경우

HTTP 상태 코드 400 응답

{
  "error_code": "null-argument",
  "error_msg": "name should be not null"
}
매개변수 값의 길이가 잘못된 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-argument",
  "error_msg": "'name' must be less than or equal to 50 characters."
}
매개변수 타입이 잘못된 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-param-type",
  "error_msg": "guid should be guid type."
}
생명주기 설정 값이 잘못된 경우

HTTP 상태 코드 400 응답

{
  "error_code": "invalid-argument",
  "error_msg": "`quota_per_node_unit` must also be set, if `quota_per_node` is configured."
}
존재하지 않는 생명주기 프로파일 guid인 경우

HTTP 상태 코드 500 응답

{
  "error_code": "profile-not-found",
  "error_msg": null
}
변경하려는 name 값이 이미 존재하는 경우

HTTP 상태 코드 500 응답

{
  "error_code": "illegal-state",
  "error_msg": "duplicated profile name: default"
}
configs JSON 파싱 오류가 발생한 경우

HTTP 상태 코드 500 응답

{
  "error_code": "illegal-state",
  "error_msg": "invalid-configs"
}
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"
}