updateClusterTerminationProtection

Prev Next

이 가이드는 API 명세를 기반으로 자동 생성했습니다.

VPC 환경에서 이용 가능합니다.

Ncloud API 표준 규격을 적용한 API입니다.

클러스터의 반납 보호를 설정합니다. enabled: true이면 클러스터 삭제 요청이 거부됩니다. 동기 처리되어 응답에 반영된 설정이 담기며, 현재 값은 GET /clusters/{clusterId}의 terminationProtection으로도 확인할 수 있습니다.

요청

요청 형식을 설명합니다. 요청 형식은 다음과 같습니다.

메서드 URI
PUT /vnks/v3/clusters/{clusterId}/termination-protection

요청 헤더

Ncloud Kubernetes Service API에서 공통으로 사용하는 헤더에 대한 정보는 Ncloud Kubernetes Service 요청 헤더를 참조해 주십시오.

요청 경로 파라미터

요청 경로 파라미터에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
clusterId String (uuid) Required 클러스터 ID (UUID)
  • <예시> a1b2c3d4-e5f6-7890-abcd-ef1234567890

요청 바디

요청 바디에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
terminationProtection Object Required 클러스터 반납 보호 설정
  • <예시> {"enabled": false}
terminationProtection.enabled Boolean Required 클러스터 반납 보호 사용 여부
  • true | false
    • true: 클러스터 삭제 요청이 거부됨
    • false: 삭제 가능
  • <예시> false

요청 예시

요청 예시는 다음과 같습니다.

curl --location --request PUT 'https://kr-nks.apigw.ntruss.com/vnks/v3/clusters/a1b2c3d4-e5f6-7890-abcd-ef1234567890/termination-protection' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
--header 'Content-Type: application/json' \
--data '{
  "terminationProtection": {
    "enabled": false
  }
}'

응답

응답 형식을 설명합니다.

응답 헤더

응답 헤더에 대한 설명은 다음과 같습니다.

필드 필수 여부 설명
retry-after - 재시도 권장 대기 시간(초) (429 응답)

Ncloud Kubernetes Service API에서 공통으로 사용하는 헤더에 대한 정보는 Ncloud Kubernetes Service 응답 헤더를 참조해 주십시오.

응답 바디

응답 바디에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
terminationProtection Object Required 클러스터 반납 보호 설정
  • <예시> {"enabled": false}
terminationProtection.enabled Boolean Required 클러스터 반납 보호 사용 여부
  • true | false
    • true: 클러스터 삭제 요청이 거부됨
    • false: 삭제 가능
  • <예시> false

응답 상태 코드

호출에 실패하면 기본 오류 응답 형식의 응답 바디를 반환하며, 오류 코드는 error.errorCode 값입니다.

응답 상태 코드에 대한 설명은 다음과 같습니다.

HTTP 상태 코드 코드 메시지 설명
200 - - 반납 보호 설정 변경 성공
400 BadRequest The request is malformed or contains an error such as an invalid parameter value or a missing required parameter. 요청을 해석할 수 없습니다 — 본문이 유효한 JSON이 아니거나 필수 항목이 빠진 경우입니다. 요청 형식을 확인한 뒤 다시 보내십시오.
400 InvalidParameter The specified parameter is invalid. 요청 본문이 스키마·제약 조건을 위반했습니다. 필드별 사유는 error.fieldErrors에 담깁니다. 값을 고쳐 다시 요청하십시오.
400 InvalidState The request cannot be processed in the current state. 클러스터가 삭제 중입니다. 삭제 중인 클러스터에는 이 요청을 처리할 수 없습니다.
403 Forbidden You do not have sufficient permissions to perform this action. 이 Action을 수행할 권한이 없습니다. 자원 존재 여부와 무관하게 권한 검사를 먼저 수행하므로 Sub Account 정책에 해당 Action 권한이 있는지 확인하십시오.
404 ClusterNotFound The cluster does not exist. 지정한 클러스터가 없습니다. clusterId를 확인하십시오.
409 ResourceNotReady The resource is not ready. 클러스터가 아직 생성 중입니다. 생성이 끝난 뒤 다시 요청하십시오.
409 ConcurrentAccess The resource is being modified by another request. Retry your request later. 클러스터에서 변경 작업이 진행 중입니다. 작업이 끝난 뒤 다시 요청하십시오.
415 UnsupportedMediaType The content type of the request body is not supported. 요청 Content-Type이 application/json이 아닙니다. Content-Type: application/json으로 다시 보내십시오.
502 BadGateway The server received an invalid response from an upstream service. Retry your request later. NKS 내부 처리 서비스가 오류를 반환했습니다. 잠시 후 재시도하십시오.
참고

Ncloud Kubernetes Service API에서 공통으로 사용하는 응답 상태 코드에 대한 정보는 Ncloud Kubernetes Service 응답 상태 코드를 참조해 주십시오.

응답 예시

응답 예시는 다음과 같습니다.

{
  "terminationProtection": {
    "enabled": false
  }
}