Memulai beberapa instans ECS secara batch. Anda dapat menetapkan parameter untuk memilih mode operasi batch yang berbeda untuk startup yang fleksibel.
Deskripsi operasi
Ini adalah operasi asinkron. Setelah pemanggilan berhasil, instans masuk ke status Starting. Anda dapat memanggil DescribeInstanceStatus untuk mengkueri status instans. Ketika status yang dikembalikan adalah Running, instans telah dimulai.
Sebelum memulai
Instans yang terkunci karena alasan keamanan tidak dapat dimulai dengan memanggil operasi ini. Untuk informasi lebih lanjut, lihat China site (Dampak kunci keamanan resource pada pemanggilan API).
Instans ECS harus berada dalam status Stopped (
Stopped).Instans dalam mode hemat mungkin gagal dimulai karena resource tidak mencukupi.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:StartInstances |
update |
*Instance
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| DryRun |
boolean |
No |
Apakah akan menjalankan dry run saja. Nilai valid:
Catatan
Jika BatchOptimization diatur ke
Nilai default: false. |
false |
| RegionId |
string |
Yes |
ID wilayah instans. Anda dapat memanggil DescribeRegions untuk mengkueri daftar wilayah terbaru. |
cn-hangzhou |
| 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 |
|||
| RequestId |
string |
ID permintaan. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
| InstanceResponses |
object |
||
| InstanceResponse |
array<object> |
Array objek InstanceResponse yang berisi status sebelum dan setelah operasi serta hasil operasi untuk setiap instans. |
|
|
object |
|||
| Code |
string |
The error code that is returned for the operation on the ECS instance. The value 200 indicates that the operation is successful. For more information, see the "Error codes" section in this topic. |
200 |
| Message |
string |
The error message that is returned for the operation on the ECS instance. The value success indicates that the operation is successful. For more information, see the "Error codes" section in this topic. |
success |
| InstanceId |
string |
The ID of the ECS instance. |
i-bp67acfmxazb4p**** |
| CurrentStatus |
string |
The status of the ECS instance after the operation is called. |
Starting |
| PreviousStatus |
string |
The status of the ECS instance before the operation is called. |
Stopped |
Contoh
Respons sukses
JSONformat
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
"InstanceResponses": {
"InstanceResponse": [
{
"Code": "200",
"Message": "success",
"InstanceId": "i-bp67acfmxazb4p****",
"CurrentStatus": "Starting",
"PreviousStatus": "Stopped"
}
]
}
}
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 | Invalid.PrivatePoolOptions.NoStock | The PrivatePool has been used up. | |
| 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 | InstanceExpired | %s | |
| 403 | InstanceLockedForSecurity | %s | |
| 403 | InstanceExpiredOrInArrears | %s | |
| 403 | IncorrectInstanceStatus | %s | |
| 403 | InvalidInstance.NotFoundSystemDisk | %s | |
| 403 | OperationDenied.SpotPriceLowerThanPublicPrice | The spot instance price is lower than public price. | |
| 403 | InsufficientBalance | Your account does not have enough balance. | |
| 403 | InstanceNotReady | The specified instance is not ready for use. | |
| 403 | OperationDenied.HostRepairing | %s | |
| 403 | OperationDenied.NoStock | The requested resource is sold out in the specified zone, try other types of resources or other regions and zones. | |
| 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.