VPC 환경에서 이용 가능합니다.
Ncloud 표준 표현을 적용한 API입니다.
클러스터의 로그 로테이션 설정을 변경합니다. 요청에 포함된 로그 유형만 변경됩니다.
요청
요청 형식을 설명합니다. 요청 형식은 다음과 같습니다.
| 메서드 | URI |
|---|---|
| PATCH | /mysql/v1/clusters/{clusterName}/log-config |
요청 헤더
Cloud DB Serverless API에서 공통으로 사용하는 헤더에 대한 정보는 Cloud DB Serverless 요청 헤더를 참조해 주십시오.
요청 경로 파라미터
요청 경로 파라미터에 대한 설명은 다음과 같습니다.
| 필드 | 타입 | 필수 여부 | 설명 |
|---|---|---|---|
clusterName |
String | Required | 클러스터 이름
|
요청 바디
요청 바디에 대한 설명은 다음과 같습니다.
| 필드 | 타입 | 필수 여부 | 설명 |
|---|---|---|---|
rotations |
Object | Required | 로그 유형별 로테이션 설정: rotations
|
rotations
rotations에 대한 설명은 다음과 같습니다.
| 필드 | 타입 | 필수 여부 | 설명 |
|---|---|---|---|
rotationType |
String | Required | 로테이션 기준
|
fileCount |
Integer | Required | 보관 파일 수
|
megaBytes |
Integer | Conditional | 파일 크기 상한 (MB)
|
요청 예시
요청 예시는 다음과 같습니다.
curl --location --request PATCH 'https://clouddb-serverless.apigw.ntruss.com/mysql/v1/clusters/test-cluster-01/log-config' \
--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/merge-patch+json' \
--data '{
"rotations": {
"ERROR": {
"rotationType": "SIZE",
"fileCount": 10,
"megaBytes": 100
}
}
}'
응답
응답 형식을 설명합니다.
응답 헤더
응답 헤더에 대한 설명은 다음과 같습니다.
| 필드 | 필수 여부 | 설명 |
|---|---|---|
accept-patch |
- | 서버가 지원하는 PATCH 요청 미디어 타입
|
응답 바디
응답 바디에 대한 설명은 다음과 같습니다.
| 필드 | 타입 | 필수 여부 | 설명 |
|---|---|---|---|
logConfig |
Object | - | 로그 로테이션 설정 |
logConfig.rotations |
Object | - | 로그 유형별 로테이션 설정: logConfig.rotations
|
logConfig.rotations
logConfig.rotations에 대한 설명은 다음과 같습니다.
| 필드 | 타입 | 필수 여부 | 설명 |
|---|---|---|---|
rotationType |
String | - | 로테이션 기준
|
fileCount |
Integer | - | 보관 파일 수
|
megaBytes |
Integer | - | 파일 크기 상한 (MB)
|
응답 상태 코드
응답 상태 코드에 대한 설명은 다음과 같습니다.
| HTTP 상태 코드 | 코드 | 메시지 | 설명 |
|---|---|---|---|
| 200 | - | - | 변경된 로그 로테이션 설정 |
| 400 | InvalidParameter |
The specified parameter is invalid. |
파라미터 값이 허용 범위나 형식을 벗어난 경우 |
| 400 | InvalidState |
Indicates that the specified state is not a valid state for an event source. |
클러스터가 로그 설정을 변경할 수 있는 상태가 아닌 경우 |
참고
Cloud DB Serverless API에서 공통으로 사용하는 응답 상태 코드에 대한 정보는 Cloud DB Serverless 응답 상태 코드를 참조해 주십시오.
응답 예시
응답 예시는 다음과 같습니다.
{
"logConfig": {
"rotations": {
"ERROR": {
"rotationType": "SIZE",
"fileCount": 10,
"megaBytes": 100
},
"GENERAL": {
"rotationType": "DAILY",
"fileCount": 7,
"megaBytes": null
},
"SLOW_QUERY": {
"rotationType": "DAILY",
"fileCount": 7,
"megaBytes": null
}
}
}
}