Menghentikan satu atau beberapa instans ECS. Anda dapat menentukan metode penghentian, mode penghentian, dan mode operasi batch.
Deskripsi operasi
Operasi ini bersifat asinkron. Setelah pemanggilan berhasil, instans memasuki status Stopping. Panggil DescribeInstanceStatus untuk mengkueri status instans. Ketika status yang dikembalikan adalah Stopped, instans telah berhenti.
Sebelum memulai
Setelah instans dihentikan, instans menjadi tidak tersedia. Pastikan penghentian instans tidak memengaruhi bisnis Anda. Panggil StartInstance atau StartInstances untuk memulai instans.
Instans yang terkunci karena alasan keamanan tidak dapat dihentikan dengan memanggil operasi ini. Untuk informasi selengkapnya, lihat Dampak kunci keamanan Sumber daya pada pemanggilan API.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:StopInstances |
update |
*Instance
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| DryRun |
boolean |
No |
Apakah akan mengirimkan permintaan dry run. Nilai valid:
Catatan
Jika parameter BatchOptimization diatur ke
Nilai default: false. |
false |
| RegionId |
string |
Yes |
ID wilayah instans. Anda dapat memanggil DescribeRegions untuk mengkueri daftar wilayah terbaru. |
cn-hangzhou |
| ForceStop |
boolean |
No |
Apakah akan menghentikan instans secara paksa. Nilai valid:
Nilai default: false. |
false |
| StoppedMode |
string |
No |
Mode penghentian. Nilai valid:
Nilai default: Jika Anda mengaktifkan mode hemat untuk instans yang terhubung ke VPC dan kondisi terpenuhi, nilai default adalah |
KeepCharging |
| BatchOptimization |
string |
No |
Mode operasi batch. Nilai valid:
Nilai default: AllTogether. |
AllTogether |
| InstanceId |
array |
Yes |
ID instans. Panjang array: 1 hingga 100. |
i-bp67acfmxazb4p**** |
|
string |
No |
ID instans. |
i-bp67acfmxazb4p**** |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
ID permintaan. |
1C488B66-B819-4D14-8711-C4EAAA13AC01 |
| InstanceResponses |
object |
||
| InstanceResponse |
array<object> |
Array objek InstanceResponse yang berisi status sebelum dan setelah operasi serta hasil operasi untuk setiap instans. |
|
|
object |
|||
| Code |
string |
Kode kesalahan hasil operasi instans. Nilai kembali 200 menunjukkan bahwa operasi berhasil. Untuk informasi selengkapnya, lihat daftar kode kesalahan di bawah ini. |
200 |
| Message |
string |
Paket kesalahan yang dikembalikan untuk operasi instans. Nilai kembali |
success |
| InstanceId |
string |
ID instans |
i-bp67acfmxazb4p**** |
| CurrentStatus |
string |
Status instans saat ini. |
Stopping |
| PreviousStatus |
string |
Status instans sebelum operasi. |
Running |
Contoh
Respons sukses
JSONformat
{
"RequestId": "1C488B66-B819-4D14-8711-C4EAAA13AC01",
"InstanceResponses": {
"InstanceResponse": [
{
"Code": "200",
"Message": "success",
"InstanceId": "i-bp67acfmxazb4p****",
"CurrentStatus": "Stopping",
"PreviousStatus": "Running"
}
]
}
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter.KMSKeyId.CMKNotEnabled | The CMK needs to be added ECS tag | |
| 400 | InvalidParameter.KMSKeyId.KMSUnauthorized | ECS service account have no right to access your KMS. | |
| 400 | DRYRUN.SUCCESS | This request is a dryrun request with successful result. | |
| 400 | InvalidParameter.Encrypted.KmsNotEnable | Failed to perform this operation because KMS is not activated. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | InvalidInstanceId.NotFound | InstanceId should not be null. | |
| 403 | InvalidParameter.TooManyInstanceIds | Instance ids cannot be more than 100. | |
| 403 | Abs.InvalidInstanceIds.MalFormed | The specified instanceIds is not valid. | |
| 403 | InstanceLockedForSecurity | %s | |
| 403 | InstanceExpiredOrInArrears | %s | |
| 403 | IncorrectInstanceStatus | %s | |
| 403 | InvalidInstanceId.NotSupport | %s | |
| 403 | InsufficientBalance | Your account does not have enough balance. | |
| 403 | InstanceNotReady | The specified instance is not ready for use. | |
| 403 | InvalidOperation.KMSKeyIdNotFound | The specified KMSKeyId not found, %s. | |
| 403 | InvalidOperation.KMSServiceNotOpen | KMS service is currently not open. | |
| 403 | OperationDenied.SystemInstanceNotSupport | The system instance does not support the %s operation because %s. | |
| 404 | InvalidInstanceId.NotFound | %s | |
| 404 | InvalidInstanceIds.NotFound | The specified InstanceIds does not exist. | |
| 503 | LimitedOperation.ServiceUnavailable | The service is currently unavailable. Please try again later. | |
| 409 | InvalidOperation.Conflict | Request was denied due to conflict with a previous request, please try again later. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.