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 an instance before you run commands or send files to the instance, especially for newly purchased instances. Run commands or send files only when the CloudAssistantStatus parameter is set to true.
When paged query the first page, specify only the MaxResults parameter to limit the number of entries to return. The NextToken value in the response is used as the token to query the next page. When paged query the next page, set the NextToken parameter to the NextToken value obtained from the previous response and specify the MaxResults parameter to limit the number of entries to return.
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. Use NextToken and MaxResults for paging in a paged query. |
1 |
| PageSize |
integer |
No |
Note
This parameter will be taken offline soon. Use NextToken and MaxResults for paging in a paged query. |
10 |
| MaxResults |
integer |
No |
The maximum number of entries per page for paging in a paged query. This parameter is invalid if the InstanceId parameter settings are specified. Maximum value: 50. Default value: 10. |
10 |
| NextToken |
string |
No |
The pagination token. Set the value to the NextToken value returned from the previous 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 |
|||
| PageSize |
integer |
The number of entries per page. |
1 |
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| PageNumber |
integer |
The current page number. |
1 |
| TotalCount |
integer |
The total number of instances. Note
If you use the MaxResults and NextToken parameters for paging in a paged query, the returned TotalCount value is meaningless. |
1 |
| NextToken |
string |
The pagination token returned by the current call. |
AAAAAdDWBF2 |
| InstanceCloudAssistantStatusSet |
object |
||
| InstanceCloudAssistantStatus |
array<object> |
The result set of the Cloud Assistant installation status of the instances. |
|
|
object |
|||
| CloudAssistantStatus |
string |
Indicates whether Cloud Assistant is running on the instance. Valid values:
|
true |
| LastInvokedTime |
string |
The time when the last command was executed. The time follows the ISO 8601 standard and is displayed in UTC. |
2021-03-15T08:00:00Z |
| 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 |
| ActiveTaskCount |
integer |
The number of running Cloud Assistant tasks on the instance. |
0 |
| InvocationCount |
integer |
The number of completed Cloud Assistant tasks on the instance. |
2 |
| InstanceId |
string |
The instance ID. |
i-bp1iudwa5b1tqa**** |
| LastHeartbeatTime |
string |
The last heartbeat time of Cloud Assistant. This value is updated every minute on average, with a random fluctuation of up to 5 seconds (the shortest interval is 55 seconds and the longest is 65 seconds). The time follows the ISO 8601 standard and is displayed in UTC. |
2021-03-15T09: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 |
Examples
Success response
JSON format
{
"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
}
]
}
}
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.