Mengkueri daftar Instans terjadwal yang Anda beli di wilayah tertentu. Mendukung pengambilan informasi detail Instans terjadwal berdasarkan parameter seperti tag dan atribut Instans terjadwal.
Deskripsi operasi
Kasus penggunaan
Mengkueri semua Instans terjadwal di wilayah tertentu.
Mengkueri informasi detail Instans terjadwal berdasarkan ID atau nama Instans terjadwal.
Memfilter dan mengkueri Instans terjadwal yang dibeli berdasarkan tipe instans atau keluarga instans.
Memfilter dan mengkueri Instans terjadwal yang dibeli berdasarkan cakupan (dalam OAuth) atau status Instans terjadwal.
Contoh permintaan
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:DescribeReservedInstances |
get |
ReservedInstance
ReservedInstance
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
ID wilayah Instans terjadwal. Anda dapat memanggil DescribeRegions untuk mendapatkan daftar wilayah Alibaba Cloud terbaru. |
cn-hangzhou |
| PageNumber |
integer |
No |
Nomor halaman daftar Instans terjadwal. Nilai awal: 1. Nilai default: 1. |
1 |
| PageSize |
integer |
No |
Jumlah baris per halaman dalam kueri terpaginasi. Nilai maksimum: 100. Nilai default: 10. |
50 |
| Tag |
array<object> |
No |
Array tag. Panjang array: 1 hingga 20. |
|
|
object |
No |
Tag. |
||
| Key |
string |
No |
Kunci tag Instans terjadwal. String kosong tidak diperbolehkan. Mendukung hingga 128 karakter. Tidak dapat dimulai dengan aliyun atau acs:, dan tidak dapat mengandung http:// atau https://. Catatan
Saat menggunakan satu tag untuk memfilter Sumber daya, jumlah Sumber daya yang dikueri di bawah tag ini tidak boleh melebihi 1.000. Saat menggunakan beberapa tag untuk memfilter Sumber daya, jumlah Sumber daya yang terikat ke beberapa tag secara bersamaan tidak boleh melebihi 1.000. Jika jumlah Sumber daya melebihi 1.000, gunakan API ListTagResources untuk mengkueri. |
TestKey |
| Value |
string |
No |
Nilai tag Instans terjadwal. String kosong tidak diperbolehkan. Mendukung hingga 128 karakter. Tidak dapat dimulai dengan |
TestValue |
| RegionId |
string |
Yes |
The region ID of the reserved instance. You can call DescribeRegions to obtain the latest Alibaba Cloud region list. |
cn-hangzhou |
| ZoneId |
string |
No |
ID zona instans. Parameter ini berlaku dan wajib diisi ketika Scope diatur ke Zone. Anda dapat memanggil DescribeZones untuk mendapatkan daftar zona. |
cn-hangzhou-z |
| ReservedInstanceName |
string |
No |
Nama Instans terjadwal. Catatan
Pencocokan tepat. Pemfilteran kueri fuzzy saat ini tidak didukung. |
testReservedInstanceName |
| LockReason |
string |
No |
Tipe penguncian. Nilai valid:
|
security |
| InstanceType |
string |
No |
Tipe instans yang sesuai dengan Instans terjadwal. Untuk nilai, lihat Instance Family. Catatan
Tipe instans yang dipilih saat membeli Instans terjadwal. Selama Offset aktual, Instans terjadwal tingkat wilayah mendukung Offset konversi antar ukuran berbeda dalam keluarga instans yang sama. |
ecs.g5.large |
| InstanceTypeFamily |
string |
No |
Keluarga instans yang sesuai dengan Instans terjadwal. Untuk nilai, lihat Instance Family. |
ecs.g5 |
| Scope |
string |
No |
Cakupan (dalam OAuth) Instans terjadwal. Nilai valid:
|
Region |
| OfferingType |
string |
No |
Tipe pembayaran Instans terjadwal. Nilai valid:
|
All Upfront |
| AllocationType |
string |
No |
Tipe alokasi. Nilai valid:
Nilai default: Normal. |
Normal |
| ReservedInstanceId |
array |
No |
Array ID Instans terjadwal. Panjang array: 1 hingga 100. |
ri-bpzhex2ulpzf53**** |
|
string |
No |
ID Instans terjadwal. |
ri-bpzhex2ulpzf53**** |
|
| Status |
array |
No |
Array status Instans terjadwal. |
Active |
|
string |
No |
Status Instans terjadwal. Nilai valid:
|
Active |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| PageSize |
integer |
Jumlah baris per halaman yang diatur di input. |
1 |
| RequestId |
string |
ID permintaan. |
E572643C-6A29-49D6-9D4E-6CFA4E063A3E |
| PageNumber |
integer |
Nomor halaman daftar Instans terjadwal. |
1 |
| TotalCount |
integer |
Jumlah total Instans terjadwal. |
1 |
| ReservedInstances |
object |
||
| ReservedInstance |
array<object> |
Daftar informasi detail Instans terjadwal. |
|
|
array<object> |
Informasi detail Instans terjadwal. |
||
| Status |
string |
The status. |
Active |
| CreationTime |
string |
The creation time. |
2018-12-10T12:07Z |
| ReservedInstanceName |
string |
The name. |
riZbpzhex2ulpzf53**** |
| ReservedInstanceId |
string |
The reserved instance ID. |
ri-bpzhex2ulpzf53**** |
| InstanceType |
string |
The instance type of the pay-as-you-go instances that can be matched to the reserved instance. |
ecs.g5.large |
| InstanceAmount |
integer |
The number of pay-as-you-go instances that are of the same instance type as the reserved instance and can be matched to the reserved instance. |
10 |
| RegionId |
string |
The region ID. |
cn-hangzhou |
| OfferingType |
string |
The payment option. |
All Upfront |
| StartTime |
string |
The effective time. |
2018-12-10T12:00Z |
| Description |
string |
The description. |
testDescription |
| AllocationStatus |
string |
Indicates the sharing status of the reserved instance when the AllocationType parameter is set to Shared. Valid values:
|
allocated |
| ExpiredTime |
string |
The expiration time. |
2019-12-10T12:07Z |
| ResourceGroupId |
string |
The resource group ID. |
EcsDocTest |
| ZoneId |
string |
The zone ID. |
cn-hangzhou-z |
| Platform |
string |
The operating system of the image used by the instance. Valid values:
|
Linux |
| Scope |
string |
The scope. |
region |
| OperationLocks |
object |
||
| OperationLock |
array<object> |
Details about the lock status of the reserved instance. |
|
|
object |
Details about the lock status of the reserved instance. |
||
| LockReason |
string |
The reason why the instance is locked. |
security |
| Tags |
object |
||
| Tag |
array<object> |
The tags of the reserved instance. |
|
|
object |
The tag of the reserved instance. |
||
| TagValue |
string |
The tag value. |
TestValue |
| TagKey |
string |
The tag key. |
TestKey |
Contoh
Respons sukses
JSONformat
{
"PageSize": 1,
"RequestId": "E572643C-6A29-49D6-9D4E-6CFA4E063A3E",
"PageNumber": 1,
"TotalCount": 1,
"ReservedInstances": {
"ReservedInstance": [
{
"Status": "Active",
"CreationTime": "2018-12-10T12:07Z",
"ReservedInstanceName": "riZbpzhex2ulpzf53****",
"ReservedInstanceId": "ri-bpzhex2ulpzf53****",
"InstanceType": "ecs.g5.large",
"InstanceAmount": 10,
"RegionId": "cn-hangzhou",
"OfferingType": "All Upfront",
"StartTime": "2018-12-10T12:00Z",
"Description": "testDescription",
"AllocationStatus": "allocated",
"ExpiredTime": "2019-12-10T12:07Z",
"ResourceGroupId": "EcsDocTest",
"ZoneId": "cn-hangzhou-z",
"Platform": "Linux",
"Scope": "region",
"OperationLocks": {
"OperationLock": [
{
"LockReason": "security"
}
]
},
"Tags": {
"Tag": [
{
"TagValue": "TestValue",
"TagKey": "TestKey"
}
]
}
}
]
}
}
Respons error
JSONformat
{
"code":"200",
"data":{
"data":[
{
"CreationTime":"2018-12-10T12:07Z",
"ExpiredTime":"2019-12-10T16:00Z",
"InstanceAmount":1,
"ReservedInstanceId":"ri-0xzhex2ulpzf53rxme2j",
"InstanceType":"ecs.g5.large",
"OfferingType":"All Upfront",
"RegionId":"cn-hangzhou-test-307",
"ReservedInstanceName":"riZ0xzhex2ulpzf53rxme2jZ",
"Scope":"region",
"StartTime":"2018-12-10T12:00Z",
"Status":"active"
}
],
"PageNumber":1,
"PageSize":50,
"Total":1
},
"httpStatusCode":200,
"message":"successful",
"requestId":"E572643C-6A29-49D6-9D4E-6CFA4E063A3E",
"success":true
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | MissingParamter.RegionId | The regionId should not be null. | |
| 400 | InvalidRegion.NotFound | The specified parameter RegionId is not valid. | |
| 400 | InvalidZone.NotFound | The specified parameter ZoneId is not valid. | |
| 400 | InvalidReservedInstanceOfferingType.ValueNotSupported | the OfferingType is not supported | |
| 400 | InvalidReservedInstanceOfferingClass.ValueNotSupported | the OfferingClass is not supported | |
| 400 | OperationDenied | The specified InstanceType or Zone is not authorized for current user. | |
| 400 | InvalidEndTime.ValueNotSupported | The specified endTime is out of the permitted range. | |
| 400 | InvalidReservedInstanceLockReason.ValueNotSupported | The specified LockReason is not supported. | |
| 400 | InvalidReservedInstanceStatus.ValueNotSupported | The specified Status is not supported. | |
| 400 | InvalidAllocationType.ValueNotSupported | The specified AllocationType is not supported. | |
| 403 | RAM.ApiNotSupported | This call is not supported from ram accessing. | |
| 404 | InvalidRegionId.NotFound | The specified RegionId does not exist in our records. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.