Mengkueri apakah Agen Asisten Cloud terinstal pada satu atau beberapa instans. Jika Asisten Cloud terinstal, operasi ini juga mengkueri jumlah total perintah Asisten Cloud yang telah dieksekusi, jumlah perintah yang sedang dieksekusi, dan pengatur waktu ketika perintah terbaru dieksekusi.
Deskripsi operasi
Deskripsi
Kami menyarankan Anda memanggil operasi ini untuk mengkueri status Asisten Cloud pada instans, lalu menjalankan perintah atau mengirim file ketika CloudAssistantStatus bernilai true, terutama untuk instans yang baru dibeli.
Saat mengkueri halaman pertama hasil, tetapkan hanya
MaxResultsuntuk menentukan jumlah entri maksimum yang akan dikembalikan. NilaiNextTokenyang dikembalikan dalam tanggapan digunakan sebagai token untuk mengkueri halaman berikutnya. Saat mengkueri halaman berikutnya, tetapkan parameterNextTokenke nilaiNextTokenyang dikembalikan dalam pemanggilan sebelumnya, dan tetapkanMaxResultsuntuk menentukan jumlah entri maksimum yang akan dikembalikan.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:DescribeCloudAssistantStatus |
get |
*Instance
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
ID wilayah instans. Anda dapat memanggil DescribeRegions untuk mengkueri daftar wilayah terbaru Alibaba Cloud. |
cn-hangzhou |
| RegionId |
string |
Yes |
The region ID of the instance. You can call DescribeRegions to query the most recent region list of Alibaba Cloud. |
cn-hangzhou |
| OSType |
string |
No |
Tipe sistem operasi instans. Nilai valid:
|
Windows |
| PageNumber |
integer |
No |
Catatan
Parameter ini akan dihapus di masa mendatang. Kami menyarankan Anda menggunakan NextToken dan MaxResults untuk melakukan kueri berhalaman. |
1 |
| PageSize |
integer |
No |
Catatan
Parameter ini akan dihapus di masa mendatang. Kami menyarankan Anda menggunakan NextToken dan MaxResults untuk melakukan kueri berhalaman. |
10 |
| MaxResults |
integer |
No |
Jumlah entri maksimum per halaman. Jika parameter InstanceId ditentukan, parameter ini tidak valid. Nilai maksimum: 50. Nilai default: 10. |
10 |
| NextToken |
string |
No |
Token kueri. Tetapkan nilai ke nilai NextToken yang dikembalikan dalam pemanggilan sebelumnya. |
AAAAAdDWBF2 |
| InstanceId |
array |
No |
Daftar ID instans. |
i-bp1iudwa5b1tqa**** |
|
string |
No |
ID instans. Anda dapat menentukan ID Instance ECS dan ID Instans terkelola. Anda dapat menentukan hingga 100 ID instans. |
i-bp1iudwa5b1tqa**** |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| PageSize |
integer |
Jumlah entri per halaman. |
1 |
| RequestId |
string |
ID permintaan. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| PageNumber |
integer |
Nomor halaman saat ini. |
1 |
| TotalCount |
integer |
Jumlah total instans. |
1 |
| NextToken |
string |
Token kueri yang dikembalikan dalam pemanggilan ini. |
AAAAAdDWBF2 |
| InstanceCloudAssistantStatusSet |
object |
||
| InstanceCloudAssistantStatus |
array<object> |
Kumpulan status instalasi Asisten Cloud pada instans. |
|
|
object |
|||
| CloudAssistantStatus |
string |
Indicates whether Cloud Assistant is running on the instance. Valid values:
|
true |
| LastInvokedTime |
string |
The time when commands were last run. |
2021-03-15T08:00:00Z |
| CloudAssistantVersion |
string |
The version number of Cloud Assistant Agent. This parameter is empty if Cloud Assistant Agent is not installed or is not running on the instance. |
2.2.0.106 |
| ActiveTaskCount |
integer |
The number of tasks that Cloud Assistant was running on the instance. |
0 |
| InvocationCount |
integer |
The number of tasks that Cloud Assistant completed on the instance. |
2 |
| InstanceId |
string |
The ID of the instance. |
i-bp1iudwa5b1tqa**** |
| LastHeartbeatTime |
string |
The last heartbeat time of Cloud Assistant. The value is updated every minute on average. The interval can be 55, 60, or 65 seconds. |
2021-03-15T09:00:00Z |
| OSType |
string |
The operating system type of the instance. Valid values:
|
Linux |
| SupportSessionManager |
boolean |
Indicates whether Cloud Assistant supports Session Manager on the instance. If Session Manager is not supported, the version of Cloud Assistant Agent is outdated. Update Cloud Assistant Agent to the latest version. To support Session Manager, the version of Cloud Assistant Agent cannot be earlier than the following versions:
|
true |
Contoh
Respons sukses
JSONformat
{
"PageSize": 1,
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"PageNumber": 1,
"TotalCount": 1,
"NextToken": "AAAAAdDWBF2",
"InstanceCloudAssistantStatusSet": {
"InstanceCloudAssistantStatus": [
{
"CloudAssistantStatus": "true",
"LastInvokedTime": "2021-03-15T08:00:00Z",
"CloudAssistantVersion": "2.2.0.106",
"ActiveTaskCount": 0,
"InvocationCount": 2,
"InstanceId": "i-bp1iudwa5b1tqa****",
"LastHeartbeatTime": "2021-03-15T09:00:00Z",
"OSType": "Linux",
"SupportSessionManager": true
}
]
}
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | RegionId.ApiNotSupported | The api is not supported in this region. | |
| 400 | MissingParam.InstanceId | The parameter instanceId is missing or empty. | |
| 400 | InvalidParam.PageSize | The specified parameter is invalid. | |
| 400 | InvalidParam.PageNumber | The specified parameter is invalid. | |
| 400 | InvalidParameter.NextToken | The specified parameter NextToken is not valid. | |
| 400 | InvalidParameter.MaxResults | The specified parameter MaxResults is not valid. | |
| 500 | InternalError.Dispatch | An error occurred when you dispatched the request. | |
| 500 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | |
| 403 | InstanceIds.ExceedLimit | The number of instance IDs exceeds the upper limit. | |
| 403 | Operation.Forbidden | The operation is not permitted. | |
| 404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | |
| 404 | InvalidInstance.NotFound | The specified instance does not exist. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.