Membeli instans terjadwal, mendukung pembelian instans terjadwal tingkat wilayah atau zona untuk mengimbangi tagihan instans pay-as-you-go dengan spesifikasi yang sesuai.
Deskripsi operasi
Sebelum menggunakan antarmuka ini, pastikan Anda telah sepenuhnya memahami metode penagihan dan harga instans terjadwal.
Sebelum menggunakan antarmuka ini, pastikan Anda telah sepenuhnya memahami aturan penagihan instans terjadwal. Untuk detail, lihat Instans Terjadwal.
Di semua wilayah, Anda dapat memiliki maksimal 20 instans terjadwal tingkat wilayah.
Dalam zona tunggal, Anda dapat memiliki maksimal 20 instans terjadwal tingkat zona.
Contoh Permintaan
Membeli instans terjadwal tingkat wilayah dengan durasi 1 tahun di wilayah Hangzhou untuk mengimbangi tagihan 3 instans pay-as-you-go dengan tipe instans ecs.g5.large dan sistem operasi Linux.
"RegionId":"cn-hangzhou", //Atur wilayah ke Hangzhou
"InstanceType":"ecs.g5.large", //Atur tipe instans
"Scope":"Region", //Atur cakupan instans terjadwal ke tingkat wilayah
"InstanceAmount":3, //Menunjukkan bahwa instans terjadwal dapat mencocokkan 3 instans pay-as-you-go dengan spesifikasi yang sama secara bersamaan
"OfferingType":"All Upfront", //Nilai default, menunjukkan bahwa tipe pembayaran adalah lunas di muka
"Platform":"Linux", //Sistem operasi image yang digunakan oleh instans adalah Linux atau sistem operasi mirip Unix
"Period":1, //Durasi pembelian instans terjadwal adalah 1 tahun
"PeriodUnit":"Year", //Atur unit durasi ke tahun
Membeli instans terjadwal tingkat zona dengan durasi 2 tahun di zona H wilayah Hangzhou untuk mengimbangi tagihan 5 instans pay-as-you-go dengan tipe instans ecs.g5.large dan sistem operasi Windows.
"RegionId":"cn-hangzhou",
"ZoneId":"cn-hangzhou-h", //Atur zona ke zona H
"InstanceType":"ecs.g5.large",
"Scope":"Zone", //Atur cakupan instans terjadwal ke tingkat zona
"InstanceAmount":5, //Menunjukkan bahwa instans terjadwal dapat mencocokkan 5 instans pay-as-you-go dengan spesifikasi yang sama secara bersamaan
"OfferingType":"All Upfront",
"Platform":"Windows", //Sistem operasi image yang digunakan oleh instans adalah Windows
"Period":2, //Durasi pembelian instans terjadwal adalah 2 tahun
"PeriodUnit":"Year", //Atur unit durasi ke tahun
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:PurchaseReservedInstancesOffering |
create |
*ReservedInstance
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
ID wilayah. Anda dapat memanggil DescribeRegions untuk mendapatkan daftar wilayah Alibaba Cloud terbaru. |
cn-hangzhou |
| Tag |
array<object> |
No |
Array tag. Panjang array: 0 hingga 20. |
|
|
object |
No |
|||
| Key |
string |
No |
Kunci tag instans terjadwal. Tidak boleh berupa string kosong. Mendukung hingga 128 karakter. Tidak boleh diawali dengan |
TestKey |
| Value |
string |
No |
Nilai tag instans terjadwal. Tidak boleh berupa string kosong. Mendukung hingga 128 karakter. Tidak boleh diawali dengan |
TestValue |
| ResourceGroupId |
string |
No |
ID kelompok sumber daya. |
rg-bp199lyny9b3**** |
| ZoneId |
string |
No |
ID zona. Parameter ini berlaku dan wajib diisi ketika |
cn-hangzhou-g |
| ReservedInstanceName |
string |
No |
Nama instans terjadwal. Panjangnya harus 2 hingga 128 karakter dan dapat berisi huruf Inggris atau karakter Tionghoa. Harus diawali dengan huruf besar atau kecil atau karakter Tionghoa. Tidak boleh diawali dengan http:// atau https://. Dapat berisi angka, titik dua (:), garis bawah (_), dan tanda hubung (-). |
testReservedInstanceName |
| InstanceType |
string |
Yes |
Tipe instans yang dapat dicocokkan oleh instans terjadwal. Catatan
Tipe instans yang berlaku terus diperbarui. Untuk detail, lihat Ikhtisar Instans Terjadwal. |
ecs.g5.large |
| Scope |
string |
No |
Cakupan instans terjadwal. Nilai valid:
Nilai default: Region. |
Zone |
| InstanceAmount |
integer |
No |
Jumlah instans pay-as-you-go dengan spesifikasi yang sama yang dapat dicocokkan secara bersamaan oleh instans terjadwal. Nilai valid: 1 hingga 50. Nilai default: 1. |
3 |
| OfferingType |
string |
No |
Tipe pembayaran instans terjadwal. Nilai valid:
Nilai default: All Upfront. |
All Upfront |
| Description |
string |
No |
Deskripsi instans terjadwal. Panjangnya harus 2 hingga 256 karakter dan tidak boleh diawali dengan http:// atau https://. Nilai default: kosong. |
testDescription |
| Platform |
string |
No |
Tipe sistem operasi image yang digunakan oleh instans. Nilai valid:
Nilai default: Linux. |
Linux |
| Period |
integer |
No |
Durasi pembelian instans terjadwal. Nilai valid: 1 dan 3. Nilai default: 1. |
1 |
| PeriodUnit |
string |
No |
Unit durasi pembelian instans terjadwal. Nilai valid: Year. Nilai default: Year. . |
Year |
| ClientToken |
string |
No |
Digunakan untuk memastikan idempotensi permintaan. Hasilkan nilai dari klien Anda untuk memastikan nilai tersebut unik di antara permintaan yang berbeda. ClientToken hanya mendukung karakter ASCII dan tidak boleh melebihi 64 karakter. Untuk informasi lebih lanjut, lihat Cara memastikan idempotensi. |
123e4567-e89b-12d3-a456-426655440000 |
| AutoRenew |
boolean |
No |
Apakah akan mengaktifkan perpanjangan otomatis. Nilai valid:
|
true |
| AutoRenewPeriod |
integer |
No |
Durasi setiap perpanjangan otomatis, dalam bulan. Parameter ini hanya berlaku ketika AutoRenew diatur ke True. Nilai valid AutoRenewPeriod: 12 dan 36. Ketika PeriodUnit=Year, nilai default adalah 1. |
1 |
| StartTime |
string |
No |
Pengatur waktu efektif yang ditentukan untuk instans terjadwal. Direpresentasikan sesuai dengan ISO 8601 dan menggunakan waktu UTC+0. Format: Catatan
Jika pengatur waktu efektif tidak ditentukan, secara default berlaku mulai dari waktu tepat pada jam saat ini. Misalnya, jika Anda berhasil membeli pada 2024-11-01 13:45:35, pengatur waktu efektifnya adalah 2024-11-01 13:00:00. |
2024-07-04T15Z |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
ID permintaan. |
8C314443-AF0D-4766-9562-C83B7F1A3C8B |
| ReservedInstanceIdSets |
object |
||
| ReservedInstanceId |
array |
Daftar ID instans terjadwal. |
|
|
string |
ID instans terjadwal. |
ecsri-2ze53qonjqxg7r**** |
|
| OrderId |
string |
ID pesanan. |
23841229**** |
Contoh
Respons sukses
JSONformat
{
"RequestId": "8C314443-AF0D-4766-9562-C83B7F1A3C8B",
"ReservedInstanceIdSets": {
"ReservedInstanceId": [
"ecsri-2ze53qonjqxg7r****"
]
},
"OrderId": "23841229****"
}
Respons error
JSONformat
{
"RequestId": "51AB7717-6E1A-4D1D-A44D-54CBxxxxxxxx",
"ReservedInstanceId":"ri-instance"
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidStartTime.ScopeNotMatch | Zonal reservedInstance not supported for scheduled creating. | |
| 400 | InvalidInstanceType.ValueUnauthorized | The specified InstanceType is not authorized. | |
| 400 | InvalidDescription.Malformed | The specified parameter "Description" is not valid. | |
| 400 | InvalidParameter.Conflict | The specified region and cluster do not match. | |
| 400 | InvalidTagKey.Malformed | The specified Tag.n.Key is not valid. | |
| 400 | InvalidPeriodUnit.ValueNotSupported | The specified parameter PeriodUnit is not valid. | |
| 400 | InvalidTagValue.Malformed | The specified Tag.n.Value is not valid. | |
| 400 | InvalidChargeType.ValueNotSupported | ChargeType is not valid. | |
| 400 | InvalidParameter.Scope | The specified parameter 'Scope' is invalid. | |
| 400 | InvalidReservedInstanceStatus.ValueNotSupported | ReservedInstance status is not supported. | |
| 400 | InvalidReservedInstanceOfferingType.ValueNotSupported | The OfferingType is not supported. | |
| 400 | InvalidReservedInstanceOfferingClass.ValueNotSupported | The OfferingClass is not supported. | |
| 400 | MissingParameter.ZoneId | The specified zoneId should be not empty. | |
| 400 | MissingParameter.InstanceType | The instanceType should be not empty. | |
| 400 | MissingParameter.ReservedInstanceId | The ids of reservedInstance can not be empty. | |
| 400 | MissingParameter.ReservedInstanceConfiguration | The configurations of reservedInstance can not be empty. | |
| 400 | InvalidParameter.SplitOrMerge | The Many-to-many of modification is not supported. | |
| 400 | MissingParameter.InstanceTypeAndAmountBothEmpty | The instanceType and amount can not be both empty. | |
| 400 | InvalidReservedInstancePlatform.ValueNotSupported | The Platform is not supported. | |
| 400 | InvalidParameter.ReservedInstanceName | ReservedInstanceName is invalid. | |
| 400 | InvalidReservedInstanceZone.ValueNotSupported | The zoneId is not exist. | |
| 400 | OperationDenied | The specified InstanceType or Zone is not authorized for current user. | |
| 400 | InvalidInstanceType.ValueNotSupported | The specified InstanceType beyond the permitted range. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | OperationDenied | The creation of Host to the specified Zone is not allowed. | |
| 403 | OperationDenied.NoStock | The requested resource is sold out in the specified zone; try other types of resources or other regions and zones. | |
| 403 | NodeControllerUnavailable | The Node Controller is temporarily unavailable. | |
| 403 | InvalidParameter.ResourceOwnerAccount | ResourceOwnerAccount is Invalid. | |
| 403 | Zone.NotOpen | The specified zone is not granted to you to buy resources yet. | |
| 403 | Zone.NotOnSale | The specified zone is not available for purchase. | |
| 403 | Account.Arrearage | Your account has been in arrears. | |
| 403 | InvalidStartTime.MalFormed | The specified StartTime is not valid. | |
| 403 | InvalidStartTime.NotSupported | The specified startTime is not supported. | |
| 403 | RegionUnauthorized | You are not authorized to perform the operation in the specified region. | |
| 404 | InvalidZoneId.NotFound | The ZoneId provided does not exist in our records. | |
| 404 | PaymentMethodNotFound | No payment method has been registered on the account. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.