DescribeCloudAssistantStatus
Queries whether Cloud Assistant Agent is installed on one or more instances. If Cloud Assistant is installed, this operation also queries the total number of executed Cloud Assistant commands, the number of commands being executed, and the time when the last command was executed.
Operation description
Operation description
Call this operation to query the Cloud Assistant status of instances before executing commands or sending files, especially for newly purchased instances. Execute commands or send files only when CloudAssistantStatus is true.
When paged query the first page, specify only
MaxResultsto limit the number of returned entries. TheNextTokenvalue in the response is used as the token to query the next page. When paged query the next page, set theNextTokenparameter to theNextTokenvalue obtained from the previous response and specifyMaxResultsto limit the number of returned entries.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:DescribeCloudAssistantStatus |
get |
*Instance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list. |
cn-hangzhou |
| OSType |
string |
No |
The operating system type of the instance. Valid values:
|
Windows |
| PageNumber |
integer |
No |
Note
This parameter will be taken offline soon. We recommend that you use NextToken and MaxResults to perform paged queries. |
1 |
| PageSize |
integer |
No |
Note
This parameter will be taken offline soon. We recommend that you use NextToken and MaxResults to perform paged queries. |
10 |
| MaxResults |
integer |
No |
The maximum number of entries to return on each page during a paged query. This parameter is invalid if the InstanceId parameter Settings are configured. Maximum value: 50. Default value: 10. |
10 |
| NextToken |
string |
No |
The pagination token. Set the value to the NextToken value returned from the previous API call. |
AAAAAdDWBF2 |
| InstanceId |
array |
No |
The list of instance IDs. |
i-bp1iudwa5b1tqa**** |
|
string |
No |
The list of instance IDs, which can include ECS instance IDs and managed instance IDs. You can specify up to 100 instance IDs. |
i-bp1iudwa5b1tqa**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| InstanceCloudAssistantStatusSet |
object |
||
| InstanceCloudAssistantStatus |
array<object> |
The result set of the Cloud Assistant installation status for the instances. |
|
|
object |
|||
| ActiveTaskCount |
integer |
The number of running Cloud Assistant tasks on the instance. |
0 |
| CloudAssistantStatus |
string |
Indicates whether Cloud Assistant is running on the instance. Valid values:
|
true |
| CloudAssistantVersion |
string |
The version number of Cloud Assistant Agent. If Cloud Assistant Agent is not installed or running, this value is empty. |
2.2.0.106 |
| InstanceId |
string |
The instance ID. |
i-bp1iudwa5b1tqa**** |
| InvocationCount |
integer |
The number of completed Cloud Assistant tasks on the instance. |
2 |
| LastHeartbeatTime |
string |
The time of the last Cloud Assistant heartbeat. This value is updated approximately every minute, with a random fluctuation of up to 5 seconds (minimum 55 seconds, maximum 65 seconds). The time is displayed in ISO 8601 format in UTC. |
2021-03-15T09:00:00Z |
| LastInvokedTime |
string |
The time when the last command was executed. The time is displayed in ISO 8601 format in UTC. |
2021-03-15T08:00:00Z |
| OSType |
string |
The operating system type of the instance. Valid values:
|
Linux |
| SupportSessionManager |
boolean |
Indicates whether Cloud Assistant on the instance supports the session management feature. If not, the Cloud Assistant version is outdated. Update the client to the latest version. The minimum Cloud Assistant versions that support the session management feature are as follows:
|
true |
| NextToken |
string |
The pagination token returned by this call. |
AAAAAdDWBF2 |
| PageNumber |
integer |
The current page number. |
1 |
| PageSize |
integer |
The number of entries per page. |
1 |
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| TotalCount |
integer |
The total number of instances. Note
When you use the MaxResults and NextToken parameters for paged queries, the returned TotalCount value is meaningless. |
1 |
Examples
Success response
JSON format
{
"InstanceCloudAssistantStatusSet": {
"InstanceCloudAssistantStatus": [
{
"ActiveTaskCount": 0,
"CloudAssistantStatus": "true",
"CloudAssistantVersion": "2.2.0.106",
"InstanceId": "i-bp1iudwa5b1tqa****",
"InvocationCount": 2,
"LastHeartbeatTime": "2021-03-15T09:00:00Z",
"LastInvokedTime": "2021-03-15T08:00:00Z",
"OSType": "Linux",
"SupportSessionManager": true
}
]
},
"NextToken": "AAAAAdDWBF2",
"PageNumber": 1,
"PageSize": 1,
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"TotalCount": 1
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | RegionId.ApiNotSupported | The api is not supported in this region. | The API operation cannot be called in the specified region. Check whether the specified RegionId parameter is valid. |
| 400 | MissingParam.InstanceId | The parameter instanceId is missing or empty. | The instance ID is 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. | The specified parameter NextToken is illegal. |
| 400 | InvalidParameter.MaxResults | The specified parameter MaxResults is not valid. | The specified parameter MaxResults is illegal. |
| 500 | InternalError.Dispatch | An error occurred when you dispatched the request. | An error occurred while the request is being sent. Try again later. |
| 500 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | |
| 403 | InvalidParameterCharacter | The specified parameter %s contains illegal characters. | |
| 403 | InstanceIds.ExceedLimit | The number of instance IDs exceeds the upper limit. | The number of specified instance IDs exceeds the upper limit. |
| 403 | Operation.Forbidden | The operation is not permitted. | The operation is not supported. |
| 404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | Region information error |
| 404 | InvalidInstance.NotFound | The specified instance does not exist. | The specified instance does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.