Mengkueri atribut perpanjangan otomatis satu atau beberapa Instance ECS langganan, termasuk apakah perpanjangan otomatis diaktifkan dan periode perpanjangan.
Deskripsi operasi
Hanya instans langganan yang didukung. Error akan dikembalikan jika Anda memanggil operasi ini untuk instans pay-as-you-go.
Sebelum Anda mengatur perpanjangan otomatis atau perpanjangan manual, Anda dapat mengkueri status perpanjangan instans untuk memeriksa apakah perpanjangan otomatis sudah diaktifkan.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:DescribeInstanceAutoRenewAttribute |
list |
Instance
Instance
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
No |
ID instans. Anda dapat mengkueri hingga 100 instans langganan di setiap permintaan. Pisahkan beberapa ID instans dengan koma (,). Catatan
Setidaknya salah satu dari InstanceId dan RenewalStatus harus ditentukan. |
i-bp18x3z4hc7bixhx****,i-bp1g6zv0ce8oghu7**** |
| RegionId |
string |
Yes |
ID wilayah instans. Anda dapat memanggil operasi DescribeRegions untuk mengkueri daftar wilayah terbaru. |
cn-hangzhou |
| RenewalStatus |
string |
No |
Status perpanjangan otomatis instans. Nilai valid:
|
AutoRenewal |
| PageSize |
string |
No |
Jumlah entri per halaman. Unit: baris. Nilai maksimum: 100. Nilai default: 10. |
10 |
| PageNumber |
string |
No |
Nomor halaman daftar informasi Sumber daya yang dikembalikan. Nilai awal: 1. Nilai default: 1. |
1 |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
ID permintaan. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| PageNumber |
integer |
Nomor halaman. |
1 |
| PageSize |
integer |
Jumlah entri per halaman. |
10 |
| TotalCount |
integer |
Jumlah total instans yang dikembalikan. |
6 |
| InstanceRenewAttributes |
object |
||
| InstanceRenewAttribute |
array<object> |
Kumpulan InstanceRenewAttribute yang mendeskripsikan properti perpanjangan instans. |
|
|
object |
|||
| PeriodUnit |
string |
The unit of the auto-renewal duration. |
week |
| Duration |
integer |
The auto-renewal duration. |
1 |
| RenewalStatus |
string |
The auto-renewal state of the instance. Valid values:
|
Normal |
| InstanceId |
string |
The ID of the instance. |
i-bp18x3z4hc7bixhx**** |
| AutoRenewEnabled |
boolean |
Indicates whether auto-renewal is enabled. |
false |
| EnableExpectedRenewDay |
boolean |
Contoh
Respons sukses
JSONformat
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"PageNumber": 1,
"PageSize": 10,
"TotalCount": 6,
"InstanceRenewAttributes": {
"InstanceRenewAttribute": [
{
"PeriodUnit": "week",
"Duration": 1,
"RenewalStatus": "Normal",
"InstanceId": "i-bp18x3z4hc7bixhx****",
"AutoRenewEnabled": false,
"EnableExpectedRenewDay": false
}
]
}
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Throttling | Request was denied due to request throttling. | |
| 403 | MissingParameter.InstanceId | InstanceId should not be null. | |
| 403 | InvalidParameter.ToManyInstanceIds | InstanceId should be less than 100. | |
| 403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | |
| 403 | ChargeTypeViolation | Pay-As-You-Go instances do not support this operation. | |
| 403 | InvalidParameter.RenewalStatus | The specified parameter RenewalStatus is not valid. | |
| 403 | InvalidParameter.RenewalStatusInstanceId | The parameter RenewalStatus and InstanceId can not be both empty. | |
| 403 | InvalidParameter.PageSize | The specified parameter PageSize is not valid. | |
| 403 | InvalidParameter.PageNumber | The specified parameter PageNumber is not valid. | |
| 403 | InvalidParameter.InvalidInstanceId | The specified InstanceId does not exist. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.