容量予約を作成するには、インスタンスタイプ、総数量、開始時刻、可用性ゾーンを指定します。
操作説明
API
キャパシティ予約サービスでは、アベイラビリティーゾーンやインスタンスタイプなどの属性を指定して、コンピューティングリソースを予約できます。これにより、システムは一致するリソースをプライベートプールに予約します。詳細については、「即時キャパシティ予約の概要」をご参照ください。
- 現在、このサービスは即時開始モードのみをサポートしています。即時キャパシティ予約を購入すると、予約したインスタンスタイプに対して標準の従量課金レートで課金されます。この課金は、従量課金インスタンスを起動したかどうかに関わらず適用され、予約を解放するか、予約の有効期限が切れるまで継続します。
インスタンスの作成時に CreateInstance API または RunInstances API を呼び出して、プライベートプールオプションを指定できます。既存のインスタンスに対してこの設定を変更するには、ModifyInstanceAttachmentAttributes API を呼び出します。インスタンスがプライベートプールに一致すると、インスタンスタイプ、クラウドディスク、パブリック帯域幅など、設定されたリソースに対して課金されます。
予約済みのキャパシティに従量課金インスタンスを起動しない場合、予約したインスタンスタイプに対してのみ課金されます。
即時キャパシティ予約における、一致したインスタンスと未使用のキャパシティ両方の時間単位の請求には、Savings Plans および Regional Reserved Instance Coupons を適用できます。ただし、Zonal Reserved Instance Coupons はサポートされていません。最初に Savings Plans または Reserved Instance Coupons を購入することを推奨します。これらのプランを適用した上でキャパシティ予約サービスを利用すると、追加費用なしでキャパシティが保証されます。
API を使用して作成できるのは、即時キャパシティ予約のみです。即時キャパシティ予約またはスケジュールされたキャパシティ予約を作成するには、ECS コンソールを使用してください。詳細については、「リソース予約サービス」をご参照ください。
今すぐお試しください
テスト
RAM 認証
|
アクション |
アクセスレベル |
リソースタイプ |
条件キー |
依存アクション |
|
ecs:CreateCapacityReservation |
create |
*CapacityReservation
|
なし | なし |
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| RegionId |
string |
必須 |
キャパシティ予約を作成するリージョンの ID です。DescribeRegions API を呼び出して、Alibaba Cloud リージョンの最新リストを取得できます。 |
cn-hangzhou |
| ResourceGroupId |
string |
任意 |
キャパシティ予約が属するリソースグループの ID です。 |
rg-bp67acfmxazb4p**** |
| Tag |
array<object> |
任意 |
キャパシティ予約に追加するタグです。 |
|
|
object |
任意 |
タグです。 |
||
| Key |
string |
任意 |
キャパシティ予約のタグキーです。最大 20 個のタグを指定できます。タグキーに空文字列は指定できません。タグキーの長さは最大 128 文字で、 |
TestKey |
| Value |
string |
任意 |
キャパシティ予約のタグ値です。最大 20 個のタグを指定できます。タグ値は空文字列にすることも可能です。タグ値の長さは最大 128 文字で、 |
TestValue |
| ClientToken |
string |
任意 |
リクエストのべき等性を確保するためにクライアントが生成するトークンです。同じトークンを使用してリクエストを再試行できます。 |
0c593ea1-3bea-11e9-b96b-88e9fe637760 |
| PrivatePoolOptions.Name |
string |
任意 |
キャパシティ予約の名前です。名前は 2~128 文字である必要があります。先頭は英字または漢字とし、 |
crpTestName |
| Description |
string |
任意 |
キャパシティ予約の説明です。説明は 2~256 文字である必要があり、 デフォルト値:空文字列。 |
This is description. |
| PrivatePoolOptions.MatchCriteria |
string |
任意 |
キャパシティ予約が有効になった後に生成されるプライベートプールのタイプです。有効な値:
デフォルト値: Open。 |
Open |
| InstanceAmount |
integer |
必須 |
指定したインスタンスタイプについて、予約するインスタンスの数です。 |
2 |
| InstanceType |
string |
必須 |
キャパシティを予約するインスタンスタイプです。DescribeInstanceTypes API を呼び出して、ECS のインスタンスタイプを確認できます。 |
ecs.g6.xlarge |
| StartTime |
string |
任意 |
キャパシティ予約が有効になる時刻です。時刻は ISO 8601 標準の 説明
このパラメータを指定しない場合、キャパシティ予約はすぐに有効になります。 |
2021-10-30T05:32:00Z |
| EndTime |
string |
任意 |
キャパシティ予約の終了時刻です。時刻は ISO 8601 標準の |
2021-10-30T06:32:00Z |
| EndTimeType |
string |
任意 |
キャパシティ予約のリリースモードです。有効な値:
|
Unlimited |
| Platform |
string |
任意 |
インスタンスで使用するイメージのオペレーティングシステムです。このパラメータは、リージョンレベルのリザーブドインスタンスの
デフォルト値: Linux。 説明
このパラメータは現在使用できません。 |
Linux |
| ZoneId |
array |
必須 |
cn-hangzhou-h |
|
|
string |
任意 |
キャパシティ予約を作成するゾーンの ID です。キャパシティ予約は 1 つのゾーン内のリソースのみを予約できるため、指定できるゾーン ID は 1 つだけです。 |
cn-hangzhou-h |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
|||
| PrivatePoolOptionsId |
string |
キャパシティ予約の ID。 |
crp-bp67acfmxazb4**** |
| RequestId |
string |
リクエスト ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
例
成功レスポンス
JSONJSON
{
"PrivatePoolOptionsId": "crp-bp67acfmxazb4****",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
エラーコード
|
HTTP ステータスコード |
エラーコード |
エラーメッセージ |
説明 |
|---|---|---|---|
| 400 | InvalidParameter.RegionId | The specified RegionId is invalid. | |
| 400 | NoStock | The stock in the availability zone is insufficient. | |
| 400 | MissingParameter | The input parameter StartTime is missing. | |
| 400 | OperationDenied | The specified instanceType or zone is not available or not authorized. | |
| 400 | MissingParameter.RegionId | The specified RegionId should not be null. | |
| 400 | InvalidStartTime.NotSupported | The specified StartTime should be within 180 calendar days from the current date, and you must specify a precision to hour. | |
| 400 | InvalidStartTime.MalFormed | The specified StartTime is out of the permitted range. | |
| 400 | Invalid.PrivatePoolOptionsName.MalFormed | The specified PrivatePoolOptions.Name is not valid. | |
| 400 | Invalid.ZoneId | The specified ZoneId is not valid. | |
| 400 | Invalid.InstanceType | The specified InstanceType is not valid. | |
| 400 | DedicatedHostNotSupported | DedicatedHost is not supported for PrivatePool. | |
| 400 | SpotNotSupported | Spot is not supported for PrivatePool. | |
| 400 | ClassicNetworkNotSupported | Classic network is not supported for PrivatePool. | |
| 400 | Invalid.InstanceId | Instance does not exist. | |
| 400 | Invalid.PrivatePoolOptions.MatchCriteria | Target mode does not support this operation. | |
| 400 | MissingParameter.PrivatePoolOptions.Id | The specified PrivatePoolOptions.Id should not be null. | |
| 400 | Invalid.PrivatePoolOptions.Id | The PrivatePool does not exist. | |
| 400 | Invalid.InstanceChargeType | The InstanceChargeType does not match the PrivatePool. | |
| 400 | Invalid.PrivatePoolOptions.status | The PrivatePool has been used up. | |
| 400 | InvalidPlatform.ValueNotSupported | The Platform does not match the PrivatePool. | |
| 400 | InvalidAliUid | The PrivatePool does not belong to the user of the Instance. | |
| 400 | MissingParameter.PackageType | The specified parameter "PackageType" can not be empty. | |
| 400 | MissingParameter.PrivatePoolOptions.Ids | The specified parameter "PrivatePoolOptions.Ids" can not be empty. | |
| 400 | MissingParameter.InstanceCpuCoreCount | The specified parameter "InstanceCpuCoreCount" can not be empty. | |
| 400 | MissingParameter.InstanceAmount | The specified parameter "InstanceAmount" can not be empty. | |
| 400 | MissingParameter.InstanceCpuCoreCountOrInstanceAmount | The specified parameter "InstanceCpuCoreCount" and "InstanceAmount" must not be empty at the same time. | |
| 400 | Invalid.TooManyPrivatePoolOptions.Ids | Too many PrivatePoolOptions.Ids in this request. | |
| 400 | Invalid.TooManyZoneIds | Too many ZoneIds in the request. | |
| 400 | Invalid.TooManyInstanceTypes | Too many InstanceTypes in the request. | |
| 400 | Invalid.TooManyUnpaidPrivatePool | Too many PrivatePools create but still unpaid. | |
| 400 | Invalid.InstanceCpuCoreCountOrInstanceAmount | Both InstanceCpuCoreCount and InstanceAmount are provided. | |
| 400 | Invalid.PrivatePoolOptions.Ids | The specified parameter "PrivatePoolOptions.Ids" exist invalid element Id. | |
| 400 | Invalid.PackageType | The specified parameter "PackageType" is invalid. | |
| 400 | Invalid.PrivatePool.Purchase | The PrivatePool has already paid. | |
| 400 | Invalid.AssuranceTimes.NotSupported | The value of AssuranceTimes is not supported. | |
| 400 | RepeatStartPrivatePool | PrivatePool has already been started. | |
| 400 | Invalid.TimeSlot | The param time slot is invalid. | |
| 400 | Invalid.EndTime | The specified parameter "EndTime" is not valid. | |
| 400 | StartTime.NotNeed | The specified parameter "StartTime" should leave empty. | |
| 400 | AccountForbidden.ProductCreationLimited | The commodity must be officially operated by Aliyun and in pay-as-you-go billing method. | |
| 400 | RegionUnauthorized | There is no authority to create private pool in the specified region. | |
| 400 | PriceNotFound | The price of your queried resource is not available now, please try other resources. | |
| 500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | |
| 403 | Zone.NotOpen | The specified zone is not granted to you to buy resources yet. | |
| 403 | InvalidResourceType.NotSupported | %s | |
| 403 | OperationDenied.NoStock | The resource is out of stock in the specified zone. Please try other types, or choose other regions and zones. | |
| 403 | InvalidInstanceType.NotSupported | The specified InstanceType is invalid. | |
| 403 | Invalid.ZoneIds | At least one of the specified ZoneIds are invalid. | |
| 403 | Zone.NotOnSale | The specified zone is not available for purchase. | |
| 404 | InvalidZoneId.NotFound | The specified zoneId does not exist. | |
| 404 | InvalidResourceGroup.NotFound | The ResourceGroup provided does not exist in our records. |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。