Menghentikan satu atau beberapa Instance ECS. Anda dapat menentukan metode penghentian, mode penghentian, dan mode operasi Batch yang berbeda.
Deskripsi operasi
Ini adalah operasi asinkron. Instans tidak langsung dihentikan setelah panggilan berhasil. Setelah panggilan berhasil, instans memasuki status Stopping. Anda dapat memanggil 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. Anda dapat memanggil StartInstance atau StartInstances untuk memulai instans.
Instans yang terkunci karena alasan keamanan tidak dapat dihentikan dengan memanggil operasi ini. Untuk informasi lebih lanjut, lihat Dampak kunci keamanan Sumber daya pada operasi 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 |
Array ID instans. Panjang array: 1 hingga 100. |
i-bp67acfmxazb4p**** |
|
string |
No |
ID instans. |
i-bp67acfmxazb4p**** |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| 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 keberhasilan. Untuk informasi lebih lanjut, lihat bagian kode kesalahan. |
200 |
| CurrentStatus |
string |
Status instans saat ini. |
Stopping |
| InstanceId |
string |
ID instans. |
i-bp67acfmxazb4p**** |
| Message |
string |
Paket kesalahan yang dikembalikan untuk operasi instans. Nilai kembali |
success |
| PreviousStatus |
string |
Status instans sebelum operasi. |
Running |
| RequestId |
string |
ID permintaan. |
1C488B66-B819-4D14-8711-C4EAAA13AC01 |
Contoh
Respons sukses
JSONformat
{
"InstanceResponses": {
"InstanceResponse": [
{
"Code": "200",
"CurrentStatus": "Stopping",
"InstanceId": "i-bp67acfmxazb4p****",
"Message": "success",
"PreviousStatus": "Running"
}
]
},
"RequestId": "1C488B66-B819-4D14-8711-C4EAAA13AC01"
}
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. | ECS tidak memiliki izin untuk mengakses Key Management Service (KMS) Anda. |
| 400 | DRYRUN.SUCCESS | This request is a dryrun request with successful result. | Permintaan dry run telah diperiksa dan lulus. |
| 400 | InvalidParameter.Encrypted.KmsNotEnable | The operation failed because KMS is not activated. Please activate KMS in the KMS console and try again. | |
| 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. | Panjang daftar InstanceIds melebihi 100. |
| 403 | Abs.InvalidInstanceIds.MalFormed | The specified instanceIds is not valid. | Parameter InstanceId yang ditentukan tidak valid. |
| 403 | InstanceLockedForSecurity | %s | |
| 403 | InstanceExpiredOrInArrears | %s | |
| 403 | IncorrectInstanceStatus | %s | Status instans saat ini tidak mendukung operasi ini. |
| 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 does not exist. Please verify that the key ID is correct and that the key resides in the current region. | |
| 403 | InvalidOperation.KMSServiceNotOpen | KMS service is currently not open. | Key Management Service (KMS) belum diaktifkan. |
| 403 | OperationDenied.SystemInstanceNotSupport | The system instance does not support the %s operation because %s. | |
| 403 | OperationDenied.KMSKeyUnauthorized | The operation is denied due to missing KMS key authorization. Please check the KMS key permissions and ensure the key is properly authorized for this operation. | |
| 404 | InvalidInstanceId.NotFound | %s | |
| 404 | InvalidInstanceIds.NotFound | The specified InstanceIds does not exist. | InstanceId tertentu tidak ada. Periksa apakah nilai parameter InstanceId benar. Anda dapat memanggil DescribeInstances untuk mengkueri status instans tertentu. |
| 503 | LimitedOperation.ServiceUnavailable | The service is currently unavailable. Please try again later. | Layanan saat ini tidak tersedia. Coba lagi nanti. |
| 409 | InvalidOperation.Conflict | Request was denied due to conflict with a previous request, please try again later. | Operasi ini tidak diizinkan karena adanya konflik tugas. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.