Cloud Marketplace 구매용 API인 Cloud Commerce Consumer Procurement API를 사용하여 오퍼를 구매할 수 있습니다.
현재 이 API는 미리보기 상태이며 지출 기반 약정만 API를 통해 구매할 수 있습니다. 이 사용 안내에서는 지출 기반 약정을 구매하는 방법을 설명합니다.
시작하기 전에
Google Cloud 프로젝트에 대해 Cloud Commerce Consumer Procurement API를 사용 설정합니다.
약정 구매를 위해 사용하려는 Cloud Billing 계정에 대해 다음 Identity and Access Management(IAM) 역할 중 하나가 있는지 확인합니다.
대상 Cloud Billing 계정 또는 결제 계정이 배치된 Google Cloud 조직에 대한 결제 관리자(
roles/billing.admin
)입니다.대상 Cloud Billing 계정 또는 결제 계정이 배치된 Google Cloud 조직에 대한 소비자 조달 주문 관리자(
roles/consumerprocurement.orderAdmin
)입니다.
구매하려는 오퍼 식별
지출 기반 약정을 구매하려면 구매하려는 제품 및 할인 조건을 나타내는 오퍼 이름을 사용합니다.
구매할 수 있는 오퍼는 다음과 같습니다.
제품 | 조건 | 오퍼 이름 |
---|---|---|
VMWare Engine | 1년 | services/vmwareengine.googleapis.com/standardOffers/094acb28-d4fc-49fb-9490-0c469cc7048e |
VMWare Engine | 3년 | services/vmwareengine.googleapis.com/standardOffers/f179581e-c899-4271-9462-9f9e0ed1526c |
Compute Engine 가변형 약정 | 1년 | services/compute.googleapis.com/standardOffers/ffe0f6a3-2f98-437e-8d49-fc443a05d3c2 |
Compute Engine 가변형 약정 | 3년 | services/compute.googleapis.com/standardOffers/062a285d-8989-4ce7-8f9a-bed8d183236f |
오퍼 매개변수 식별
약정에는 2개의 매개변수가 있습니다.
- 약정 금액(
hourly_commit
): 이 약정을 구매한 후 매 시간 Cloud Billing 계정에 적용되는 크레딧입니다. - 리전(
region
): 이 약정의 크레딧이 적용되는 리전입니다.
약정을 구매할 때는 매개변수를 둘 다 지정해야 합니다.
제품에는 해당 매개변수에 대해 특정 값 및 제약조건이 있습니다. 예를 들어 VMWare Engine을 구매하려면 다음 값 및 제약조건을 참조할 수 있습니다.
제품 | 최소 약정 | 최대 약정 | 리전 |
---|---|---|---|
VMWare Engine | 시간당 $5 | 시간당 $10,000 | asia-northeast1 asia-south1 asia-southeast1 australia-southeast1 europe-west2 europe-west3 europe-west4 northamerica-northeast northamerica-northeast1 southamerica-east1 us-central1 us-east4 us-west2 |
오퍼 구매
오퍼를 구매하려면 billingAccounts.orders.place
를 호출하고 다음 매개변수를 제공합니다.
약정의 화폐 가치를 나타내는
hourly_commit
약정을 구매할
region
주문하려면 다음 명령어를 실행합니다.
curl 'https://cloudcommerceconsumerprocurement.googleapis.com/v1alpha1/billingAccounts/BILLING_ACCOUNT_ID/orders:place' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ACCESS_TOKEN' \
--header 'X-Goog-User-Project: CONSUMER_PROJECT_ID' \
-d '@-' <<EOF
{
"displayName": "DISPLAY_NAME",
"lineItemInfo": [{
"parameters": [{
"name": "hourly_commit",
"value": {
"doubleValue": HOURLY_COMMIT
}
}, {
"name": "region",
"value": {
"stringValue": "REGION"
}
}],
"offer": "OFFER_NAME"
}]
}
EOF
그러면 장기 실행 작업 이름이 반환됩니다.
{
"name": "OPERATION_NAME"
}
반환된 장기 실행 작업이 성공적으로 완료되었는지 확인하기 위해 다음 명령어를 실행합니다.
curl 'https://cloudcommerceconsumerprocurement.googleapis.com/v1alpha1/OPERATION_NAME' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ACCESS_TOKEN' \
--header 'X-Goog-User-Project: CONSUMER_PROJECT_ID'
장기 실행 작업은 1초 이내에 완료되어야 합니다.
주문 보기
Google Cloud Console에서 직접 또는 billingAccounts.orders.get
을 호출하여 약정의 현재 상태를 확인할 수 있습니다.
생성된 주문의 name
필드는 주문 이름을 지정합니다.
cURL
주문을 보려면 다음 명령어를 실행합니다.
curl 'https://cloudcommerceconsumerprocurement.googleapis.com/v1alpha1/ORDER_NAME' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ACCESS_TOKEN' \
--header 'X-Goog-User-Project: CONSUMER_PROJECT_ID'
Console
- https://console.cloud.google.com/billing으로 이동합니다.
- Cloud Billing 계정을 선택합니다.
- 사이드바에서 약정을 선택합니다.
- 구매한 약정이 표시된 테이블에 나타납니다.