용량
IBM Cloudant를 사용하여 현재 및 대상 프로비저닝된 처리량 용량 설정을 보고, 대상 프로비저닝된 처리량 용량 설정을 지정하고, 사용된 프로비저닝된 처리량 용량의 현재 이용량을 볼 수 있습니다.
더 자세한 정보를 원하시면, IBM Cloudant 용량을 어떻게 할당하고 사용하는지에 대한 프로비저닝된 처리량 용량 과 UI에서 용량을 확인하고 변경하는 방법을 참조하세요.
용량 API를 사용하려면 API 엔드포인트에 액세스하기 위해 IBM Cloudant 레거시 인증 관리자 역할 또는 IAM 관리자 역할이 필요합니다. 다음 curl 예제에서는 단순화하기 위해 인증 측면을 생략합니다. 두 가지 유형의 인증을 사용하는 방법에 대한 자세한 정보는 인증 개요 절을 참조하십시오.
현재 및 대상 프로비저닝된 처리량 용량 설정 보기
/_api/v2/user/capacity/throughput 엔드포인트에 대한 GET을 사용하여 IBM Cloudant 인스턴스에 할당된 프로비저닝된 처리량 용량의 크기 및 대상 프로비저닝된 처리량 용량의 크기를 확인할 수 있습니다. 대상 용량을 변경하는 경우 현재 용량이 대상 용량을 충족하도록 비동기적으로 변경됩니다. 용량 변경의 크기 및 IBM Cloudant 인스턴스에 저장된 데이터의 양을 통해 현재
및 대상 용량을 일치시킬 때까지 소요되는 시간을 판별합니다. 현재 및 대상 용량이 동일한 경우 용량 변경이 완료됩니다.
- 메소드
GET- 경로
/_api/v2/user/capacity/throughput- 응답
- 현재 및 대상 용량 설정 모두입니다. 각각의 용량에는 용량 블록 수와 처리량 용량의 총 읽기/초, 쓰기/초 및 글로벌 조회/초가 포함되어 있습니다.
다음과 같이 HTTP를 사용하여 현재 및 대상 용량을 검색하는 요청 예제를 참조하십시오.
GET /_api/v2/user/capacity/throughput
현재 및 대상 용량을 검색하려면 다음 예제 요청을 참조하십시오.
curl "$SERVICE_URL/_api/v2/user/capacity/throughput"
import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.cloudant.v1.model.CapacityThroughputInformation;
Cloudant service = Cloudant.newInstance();
CapacityThroughputInformation response =
service.getCapacityThroughputInformation().execute().getResult();
System.out.println(response);
const { CloudantV1 } = require('@ibm-cloud/cloudant');
const service = CloudantV1.newInstance({});
service.getCapacityThroughputInformation().then(response => {
console.log(response.result);
});
from ibmcloudant.cloudant_v1 import CloudantV1
service = CloudantV1.new_instance()
response = service.get_capacity_throughput_information().get_result()
print(response)
getCapacityThroughputInformationOptions := service.NewGetCapacityThroughputInformationOptions()
capacityThroughputInformation, response, err := service.GetCapacityThroughputInformation(getCapacityThroughputInformationOptions)
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(capacityThroughputInformation, "", " ")
fmt.Println(string(b))
이전 Go 예제에서는 다음 가져오기 블록이 필요합니다.
import (
"encoding/json"
"fmt"
"github.com/IBM/cloudant-go-sdk/cloudantv1"
)
모든 Go 예제에서는 service 오브젝트가 초기화되어야 합니다. 자세한 정보는 API 문서 인증 섹션 예제를 참조하십시오.
리턴되는 구조에는 다음과 같은 필드가 포함되어 있습니다.
current- 할당된 현재 용량을 자세히 설명하고, 용량 블록 수와 처리량 요청 클래스의 명세를 모두 표시합니다.
target- 할당된 대상 용량을 자세히 설명하고, 용량 블록 수와 처리량 요청 클래스의 명세를 모두 표시합니다.
blocks- 프로비저닝 처리 용량 블록의 수이며, 여기서 블록은 100 읽기/초, 50 쓰기/초 및 5 글로벌 쿼리/초입니다.
throughput- 읽기/초, 쓰기/초 및 글로벌 쿼리/초의 특정 수의 명세입니다.
다음과 같이 현재 및 대상 용량이 포함된 JSON 응답 예제를 참조하십시오.
{
"current": {
"throughput": {
"read": 500,
"write": 250,
"blocks": 5,
"query": 25
}
},
"target": {
"throughput": {
"read": 1000,
"write": 500,
"blocks": 10,
"query": 50
}
}
}
대상 프로비저닝된 처리량 용량 설정
/_api/v2/user/capacity/throughput 엔드포인트에 대한 PUT을 사용하여 IBM Cloudant 인스턴스에 대한 대상 프로비저닝된 처리량 용량을 설정할 수 있습니다. 대상 용량을 변경하는 경우 현재 용량이 대상 용량을 충족하도록 비동기적으로 변경됩니다.
- 메소드
PUT- 경로
/_api/v2/user/capacity/throughput- 응답
- 용량 블록 수 및 총 읽기/초 읽기, 쓰기/초 및 글로벌 쿼리/초를 포함하여 현재 및 대상 용량 설정 둘 다
다음과 같이 HTTP를 사용하여 대상 용량을 설정하는 요청 예제를 참조하십시오.
PUT $SERVICE_URL/_api/v2/user/capacity/throughput
Content-Type: application/json
다음과 같이 대상 용량을 설정하는 JSON 오브젝트 예제를 참조하십시오.
{
"blocks": $NUMBER_OF_BLOCKS
}
여기서 블록은 프로비저닝된 처리량 용량의 100회 읽기/초, 50회 쓰기/초 및 5회 글로벌 조회/초로 구성되어 있습니다. $NUMBER_OF_BLOCKS 필드는 1 - 100 범위의 정수여야 합니다. 더 큰 용량이 필요한 경우 IBM Cloudant 지원 센터에 문의하여 얻을 수 있습니다.
대상 용량을 설정하려면 다음 예제 요청을 참조하십시오.
curl -X PUT "$SERVICE_URL/_api/v2/user/capacity/throughput" -H "Content-Type: application/json" --data '{"blocks": 1}'
import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.cloudant.v1.model.CapacityThroughputInformation;
import com.ibm.cloud.cloudant.v1.model.PutCapacityThroughputConfigurationOptions;
Cloudant service = Cloudant.newInstance();
PutCapacityThroughputConfigurationOptions options =
new PutCapacityThroughputConfigurationOptions.Builder()
.blocks(1)
.build();
CapacityThroughputInformation response =
service.putCapacityThroughputConfiguration(options).execute().getResult();
System.out.println(response);
const { CloudantV1 } = require('@ibm-cloud/cloudant');
const service = CloudantV1.newInstance({});
service.putCapacityThroughputConfiguration({
blocks: 1,
}).then(response => {
console.log(response.result);
});
from ibmcloudant.cloudant_v1 import CloudantV1
service = CloudantV1.new_instance()
response = service.put_capacity_throughput_configuration(
blocks=1
).get_result()
print(response)
putCapacityThroughputConfigurationOptions := service.NewPutCapacityThroughputConfigurationOptions(
1,
)
capacityThroughputConfiguration, response, err := service.PutCapacityThroughputConfiguration(putCapacityThroughputConfigurationOptions)
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(capacityThroughputConfiguration, "", " ")
fmt.Println(string(b))
이전 Go 예제에서는 다음 가져오기 블록이 필요합니다.
import (
"encoding/json"
"fmt"
"github.com/IBM/cloudant-go-sdk/cloudantv1"
)
리턴되는 구조에는 다음과 같은 필드가 포함되어 있습니다.
current- 할당된 현재 용량을 자세히 설명하고, 용량 블록 수와 처리량 요청 클래스의 명세를 모두 표시합니다.
target- 대상 용량 세트를 자세히 설명하고, 용량 블록 수와 처리량 요청 클래스의 명세를 모두 표시합니다.
blocks- 프로비저닝 처리 용량 블록의 수이며, 여기서 블록은 100 읽기/초, 50 쓰기/초 및 5 글로벌 쿼리/초입니다.
throughput- 읽기/초, 쓰기/초 및 글로벌 쿼리/초의 특정 수의 명세입니다.
다음과 같이 대상 용량이 설정된 JSON 응답 예제를 참조하십시오.
{
"current": {
"throughput": {
"read": 500,
"write": 250,
"blocks": 5,
"query": 25
}
},
"target": {
"throughput": {
"read": 1000,
"write": 500,
"blocks": 10,
"query": 50
}
}
}
사용된 프로비저닝된 처리량 용량의 현재 이용량 보기
/_api/v2/user/current/throughput 엔드포인트에 대한 GET 메소드를 사용하여 IBM Cloudant 인스턴스에 대해 프로비저닝된 처리량 용량의 현재 이용량을 확인할 수 있습니다. 현재 이용량은 지정된 시간(초) 동안 인스턴스에 대해 수행된 읽기, 쓰기 및 글로벌 조회의 양을 보여줍니다. 이 엔드포인트를 사용할 때는, IBM Cloudant 인스턴스의 처리량 사용 패턴을 보다 포괄적으로
파악하기 위해 해당 데이터를 시간 경과에 따라 지속적으로 집계하는 것이 권장됩니다.
- 메소드
GET- 경로
/_api/v2/user/current/throughput- 응답
- 할당된 처리 용량 중 현재 사용 중인 양을 읽기, 쓰기 및 전체 쿼리 수별로 세분화한 현황입니다.
다음과 같이 HTTP를 사용하여 현재 용량 이용량을 검색하는 요청 예제를 참조하십시오.
GET $SERVICE_URL/_api/v2/user/current/throughput
현재 용량 이용량을 검색하려면 다음 예제 요청을 참조하십시오.
curl "$SERVICE_URL/_api/v2/user/current/throughput"
import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.cloudant.v1.model.CurrentThroughputInformation;
Cloudant service = Cloudant.newInstance();
CurrentThroughputInformation response =
service.getCurrentThroughputInformation().execute().getResult();
System.out.println(response);
const { CloudantV1 } = require('@ibm-cloud/cloudant');
const service = CloudantV1.newInstance({});
service.getCurrentThroughputInformation().then(response => {
console.log(response.result);
});
from ibmcloudant.cloudant_v1 import CloudantV1
service = CloudantV1.new_instance()
response = service.get_current_throughput_information().get_result()
print(response)
getCurrentThroughputInformationOptions := service.NewGetCurrentThroughputInformationOptions()
currentThroughputInformation, response, err := service.GetCurrentThroughputInformation(getCurrentThroughputInformationOptions)
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(currentThroughputInformation, "", " ")
fmt.Println(string(b))
이전 Go 예제에서는 다음 가져오기 블록이 필요합니다.
import (
"encoding/json"
"fmt"
"github.com/IBM/cloudant-go-sdk/cloudantv1"
)
리턴되는 구조에는 다음과 같은 필드가 포함되어 있습니다.
throughput- 현재 읽기, 쓰기 및 전역 쿼리 사용 건수의 내역.
다음과 같이 현재 용량 이용량에 대한 JSON 응답 예제를 참조하십시오.
{
"throughput": {
"read": 133,
"write": 42,
"query": 13
}
}