Menghentikan satu atau beberapa instans ECS. Anda dapat menentukan metode penghentian, mode penghentian, dan mode operasi batch yang berbeda.
Deskripsi operasi
Ini adalah operasi asinkron. Instans tidak langsung berhenti setelah pemanggilan berhasil. Setelah pemanggilan berhasil, instans masuk ke 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 bahwa 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 lebih lanjut, 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 mengirim permintaan dry run. Nilai valid:
Catatan
Jika parameter
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 kondisinya terpenuhi, nilai defaultnya 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 keberhasilan. Untuk informasi lebih lanjut, lihat bagian kode kesalahan. |
200 |
| Message |
string |
Pesan kesalahan 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. | Layanan ECS tidak memiliki izin untuk mengakses KMS Anda. |
| 400 | DRYRUN.SUCCESS | This request is a dryrun request with successful result. | Permintaan ini adalah permintaan DryRun (simulasi). Kode kesalahan ini menunjukkan bahwa permintaan telah lulus validasi. |
| 400 | InvalidParameter.Encrypted.KmsNotEnable | Failed to perform this operation because KMS is not activated. | Anda harus mengaktifkan layanan hosting kunci KMS. |
| 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. | ID instans yang ditentukan tidak valid. |
| 403 | InstanceLockedForSecurity | %s | |
| 403 | InstanceExpiredOrInArrears | %s | |
| 403 | IncorrectInstanceStatus | %s | Operasi tidak diizinkan karena status instans tidak mendukungnya. |
| 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. | Kunci enkripsi KMS yang terkait tidak dapat ditemukan. Verifikasi bahwa kunci enkripsi KMS valid. |
| 403 | InvalidOperation.KMSServiceNotOpen | KMS service is currently not open. | Layanan 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 yang ditentukan tidak ada. Periksa apakah nilai parameter InstanceId benar. Anda dapat memanggil DescribeInstances untuk mengkueri status instans yang ditentukan. |
| 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. | Terdapat tugas yang berkonflik dalam daftar port. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.