Fungsi utama API ini adalah memisahkan, menggabungkan, atau mengubah cakupan Instans terjadwal dengan mengubah konfigurasi seperti Tipe instans, Jumlah, dan zona Instans terjadwal.
Deskripsi operasi
API ini adalah API asinkron. Setelah pemanggilan API berhasil, ID Instans terjadwal yang baru dibuat akan dikembalikan. Instans terjadwal asli masuk ke status Updating dan akhirnya menjadi Expired. Pada pengatur waktu yang sama, Instans terjadwal dalam status Creating dibuat dan akhirnya menjadi Effective. Anda dapat memanggil DescribeReservedInstances untuk mengkueri.
Instans terjadwal hanya dapat diubah ketika berada dalam status Effective.
Pastikan daya komputasi Instans terjadwal tidak berubah sebelum dan setelah modifikasi. Jika tidak, permintaan modifikasi akan gagal.
Pemisahan, penggabungan, dan perubahan cakupan Instans terjadwal tidak dapat dilakukan secara bersamaan.
Untuk informasi selengkapnya, lihat Membagi, menggabungkan, atau mengubah Instans terjadwal.
Contoh permintaan
Pemisahan: Membagi satu Instans terjadwal di wilayah Hangzhou, Tipe instans ecs.g5.xlarge, dan Jumlah pencocokan 2 menjadi dua Instans terjadwal dengan Tipe instans ecs.g5.large dan Jumlah pencocokan 1.
"RegionId":"cn-hangzhou", //Atur wilayah ke Hangzhou
"ReservedInstanceId":["ecsri-bp1hd03e9uv19e75****"], //ID Instans terjadwal yang akan dipisahkan
"Configuration":[
{
"ReservedInstanceName":"testReservedInstanceName1", //Nama Instans terjadwal yang dimodifikasi
"InstanceType":"ecs.g5.large", //Atur Tipe instans yang dimodifikasi
"Scope":"Region", //Cakupan Instans terjadwal tidak dapat diubah
"InstanceAmount":1 //Menunjukkan bahwa Instans terjadwal dapat mencocokkan 1 instans pay-as-you-go dengan tipe yang sama pada pengatur waktu yang sama
},
{
"ReservedInstanceName":"testReservedInstanceName2",
"InstanceType":"ecs.g5.large",
"Scope":"Region",
"InstanceAmount":1
}
]
Penggabungan: Menggabungkan dua Instans terjadwal di zona H wilayah Hangzhou dengan Tipe instans ecs.g5.xlarge dan Jumlah pencocokan 4 menjadi satu Instans terjadwal dengan Tipe instans ecs.g5.4xlarge dan Jumlah pencocokan 2.
"RegionId":"cn-hangzhou", //Atur wilayah ke Hangzhou
"ReservedInstanceId":["ecsri-bp1hd03e9uv16b75****","ecsri-bp1hd03e9uv16b76****"], //ID Instans terjadwal yang akan digabungkan
"Configuration":[
{
"ReservedInstanceName":"testReservedInstanceName", //Nama Instans terjadwal yang dimodifikasi
"InstanceType":"ecs.g5.4xlarge", //Atur Tipe instans yang dimodifikasi
"Scope":"Zone", //Cakupan Instans terjadwal tidak dapat diubah
"ZoneId":"cn-hangzhou-h", //
"InstanceAmount":2 //Menunjukkan bahwa Instans terjadwal dapat mencocokkan 2 instans pay-as-you-go dengan tipe yang sama pada pengatur waktu yang sama
}
]
Ubah cakupan: Mengubah satu Instans terjadwal di zona H wilayah Hangzhou dengan Tipe instans ecs.g5.xlarge dan Jumlah pencocokan 6 menjadi satu Instans terjadwal di wilayah Hangzhou dengan Tipe instans ecs.g5.2xlarge dan Jumlah pencocokan 3.
"RegionId":"cn-hangzhou", //Atur wilayah ke Hangzhou
"ReservedInstanceId":["ecsri-bp1hd03e9uv16b77****"], //ID Instans terjadwal yang cakupan perlu diubah
"Configuration":[
{
"ReservedInstanceName":"testReservedInstanceName", //Nama Instans terjadwal setelah perubahan cakupan
"InstanceType":"ecs.g5.2xlarge", //Atur Tipe instans yang dimodifikasi
"Scope":"Region", //Cakupan Instans terjadwal setelah perubahan
"InstanceAmount":3 //Menunjukkan bahwa Instans terjadwal dapat mencocokkan 3 instans pay-as-you-go dengan tipe yang sama pada pengatur waktu yang sama
}
]
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:ModifyReservedInstances |
update |
*ReservedInstance
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
ID wilayah tempat Instans terjadwal berada. Anda dapat memanggil DescribeRegions untuk mengkueri daftar wilayah Alibaba Cloud terbaru. |
cn-hangzhou |
| ReservedInstanceId |
array |
Yes |
ID Instans terjadwal. Panjang array: 1 hingga 20. |
ReservedInstanceId.1="ecsri-bp1cx3****",ReservedInstanceId.2="ecsri-bp15xx2****"...... |
|
string |
No |
ID Instans terjadwal. |
ecsri-bp15xx2**** |
|
| Configuration |
array<object> |
No |
Informasi konfigurasi Instans terjadwal. Panjang array: 1 hingga 100. |
|
|
object |
No |
Informasi konfigurasi Instans terjadwal. |
||
| ReservedInstanceName |
string |
No |
Nama Instans terjadwal. Panjang nama harus 2 hingga 128 karakter. Harus diawali dengan huruf atau karakter Tionghoa dan tidak boleh diawali dengan http:// atau https://. Nama dapat berisi angka, titik dua (:), garis bawah (_), atau tanda hubung (-). |
testReservedInstanceName |
| ZoneId |
string |
No |
ID zona tempat Instans terjadwal berada. Parameter ini wajib diisi ketika parameter Anda dapat memanggil DescribeZones untuk mendapatkan daftar zona. |
cn-hangzhou-i |
| Scope |
string |
Yes |
Cakupan Instans terjadwal. Nilai valid:
Nilai default: Region. |
Zone |
| InstanceType |
string |
Yes |
Tipe instans yang dapat dicocokkan oleh Instans terjadwal. Catatan
Tipe instans yang berlaku terus diperbarui. Untuk informasi selengkapnya, lihat Ikhtisar Instans terjadwal. |
ecs.c5.4xlarge |
| InstanceAmount |
integer |
Yes |
Jumlah instans pay-as-you-go dengan tipe yang sama yang dapat dicocokkan oleh Instans terjadwal pada pengatur waktu yang sama. Nilai valid: ≥1. |
1 |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
ID permintaan. |
ED9E4A5F-FF4D-4C96-BE80-6B4227060DD7 |
| ReservedInstanceIdSets |
object |
||
| ReservedInstanceId |
array |
Daftar ID Instans terjadwal. |
|
|
string |
ID Instans terjadwal. |
"ecsri-bp1cx3****" |
Contoh
Respons sukses
JSONformat
{
"RequestId": "ED9E4A5F-FF4D-4C96-BE80-6B4227060DD7",
"ReservedInstanceIdSets": {
"ReservedInstanceId": [
"\"ecsri-bp1cx3****\""
]
}
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidInstanceType.ValueUnauthorized | The specified InstanceType is not authorized. | |
| 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 | OperationDenied | The specified InstanceType or Zone is not authorized for current user. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | OperationDenied.NoStock | The requested resource is sold out in the specified zone; try other types of resources or other regions and zones. | |
| 403 | OperationDenied | Sales of this resource are temporarily suspended in the specified region; please try again later. | |
| 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 | InvalidReservedInstanceName.Malformed | The specified parameter ReservedInstanceName is invalid. | |
| 403 | InvalidParameter.Scope | The specified parameter 'Scope' is invalid. | |
| 403 | InvalidReservedInstanceStatus.ValueNotSupported | ReservedInstance status is not supported. | |
| 403 | InvalidReservedInstanceOfferingType.ValueNotSupported | The OfferingType is not supported. | |
| 403 | InvalidReservedInstanceOfferingClass.ValueNotSupported | The OfferingClass is not supported. | |
| 403 | MissingParameter.ZoneId | The specified zoneId should be not empty. | |
| 403 | MissingParameter.InstanceType | The instanceType should be not empty. | |
| 403 | MissingParameter.ReservedInstanceId | The ids of reservedInstance can not be empty. | |
| 403 | MissingParameter.ReservedInstanceConfiguration | The configurations of reservedInstance can not be empty. | |
| 403 | InvalidParameter.SplitOrMerge | The Many-to-many of modification is not supported. | |
| 403 | MissingParameter.InstanceTypeAndAmountBothEmpty | The instanceType and amount can not be both empty. | |
| 403 | InvalidReservedInstancePlatform.ValueNotSupported | The Platform is not supported. | |
| 403 | InvalidParameter.ReservedInstanceName | The reservedInstanceName is invalid. | |
| 403 | InvalidReservedInstanceZone.ValueNotSupported | The zoneId is not exist. | |
| 403 | InvalidParameter.ValueNotSupported | The instanceTypeFamily of the instance to be changed must be consistent. | |
| 403 | IncorrectInstanceStatus | The status of specified reservedInstance must be active. | |
| 403 | InvalidPlatform.ValueNotSupported | The platform of reservedInstance is invalid. | |
| 403 | InvalidScope.ValueNotSupported | The scope of reservedInstance is invalid. The valid value is Zone or Region. | |
| 403 | InvalidConfiguration.ValueNotSupported | The modification Configuration should not be empty. | |
| 403 | InvalidZoneId.ValueNotSupported | The specified zoneId should be same. | |
| 403 | InvalidParameter | The parameter is invalid.Please check it. | |
| 403 | InvalidInstanceAmount.ValueNotSupported | The instanceAmount is invalid. | |
| 403 | OperationDenied.OnlyModifyName | It is not allowed to modify the ReservedInstanceName only. | |
| 403 | InvalidReservedInstanceId.NotFound | The specified parameter ReservedInstanceId is invalid. | |
| 404 | InvalidZoneId.NotFound | The ZoneId provided does not exist in our records. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.