Queries the information about Cloud Assistant on one or more instances. The information includes whether Cloud Assistant works as expected, the version of Cloud Assistant, the latest heartbeat time of Cloud Assistant, and the number of tasks that were executed.

Usage notes

Before you run commands on or send files to instances, especially new instances, we recommend that you query the status of Cloud Assistant on the instances by calling this operation and checking the return value of CloudAssistantStatus. If the return value is true, run commands on or send files to the instances.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeCloudAssistantStatus

The operation that you want to perform. Set the value to DescribeCloudAssistantStatus.

RegionId String Yes cn-hangzhou

The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list.

OSType String No Windows

The operating system type of the instance. Valid values:

  • Windows
  • Linux
PageNumber Long No 1

The page number.

Pages start from page 1.

Default value: 1.

PageSize Long No 10

The number of entries per page. If you specify InstanceId, this parameter does not take effect.

Maximum value: 50.

Default value: 10.

InstanceId.N String No i-bp1iudwa5b1tqa****

The IDs of instances, including Elastic Compute Service (ECS) instances and managed instances.

You can specify up to 100 instance IDs in a single request.

Response parameters

Parameter Type Example Description
PageSize Long 1

The number of entries per page.

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The request ID.

PageNumber Long 1

The page number.

TotalCount Long 1

The total number of instances.

InstanceCloudAssistantStatusSet Array of InstanceCloudAssistantStatus

Details about Cloud Assistant on the instances.

InstanceCloudAssistantStatus
CloudAssistantStatus String true

Indicates whether Cloud Assistant is running on the instance. Valid values:

  • true: Heartbeats are detected within 2 minutes.
  • false: Heartbeats are not detected within 2 minutes.
LastInvokedTime String 2021-03-15T08:00:00Z

The time when commands were last run.

CloudAssistantVersion String 2.2.0.106

The version number of Cloud Assistant Agent. If Cloud Assistant Agent is not installed or run, this parameter is left empty.

ActiveTaskCount Long 0

The number of tasks that were run by Cloud Assistant on the instance.

InvocationCount Long 2

The number of tasks that were completed by Cloud Assistant on the instance.

InstanceId String i-bp1iudwa5b1tqa****

The instance ID.

LastHeartbeatTime String 2021-03-15T09:00:00Z

The last heartbeat time of Cloud Assistant. The value is updated every minute on average. The interval can be 55, 60, or 65 seconds.

OSType String Linux

The operating system type of the instance. Valid values:

  • Windows
  • Linux
SupportSessionManager Boolean true

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 the version to the latest one.

Earliest versions of Session Manager that are supported by Cloud Assistant:

  • Linux: 2.2.3.189
  • Windows: 2.1.3.189

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=DescribeCloudAssistantStatus
&InstanceId.1=i-bp1iudwa5b1tqa****
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeCloudAssistantStatusResponse>
    <TotalCount>1</TotalCount>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
    <PageSize>1</PageSize>
    <PageNumber>1</PageNumber>
    <InstanceCloudAssistantStatusSet>
        <InstanceCloudAssistantStatus>
            <CloudAssistantVersion>2.2.0.106</CloudAssistantVersion>
            <SupportSessionManager>true</SupportSessionManager>
            <InstanceId>i-bp1iudwa5b1tqa****</InstanceId>
            <CloudAssistantStatus>true</CloudAssistantStatus>
            <OSType>Linux</OSType>
            <InvocationCount>2</InvocationCount>
            <ActiveTaskCount>0</ActiveTaskCount>
            <LastInvokedTime>2021-03-15T08:00:00Z</LastInvokedTime>
            <LastHeartbeatTime>2021-03-15T09:00:00Z</LastHeartbeatTime>
        </InstanceCloudAssistantStatus>
    </InstanceCloudAssistantStatusSet>
</DescribeCloudAssistantStatusResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "TotalCount" : 1,
  "RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "PageSize" : 1,
  "PageNumber" : 1,
  "InstanceCloudAssistantStatusSet" : {
    "InstanceCloudAssistantStatus" : [ {
      "CloudAssistantVersion" : "2.2.0.106",
      "SupportSessionManager" : true,
      "InstanceId" : "i-bp1iudwa5b1tqa****",
      "CloudAssistantStatus" : "true",
      "OSType" : "Linux",
      "InvocationCount" : 2,
      "ActiveTaskCount" : 0,
      "LastInvokedTime" : "2021-03-15T08:00:00Z",
      "LastHeartbeatTime" : "2021-03-15T09:00:00Z"
    } ]
  }
}

Error codes

HTTP status code Error code Error message Description
400 RegionId.ApiNotSupported The api is not supported in this region. This operation cannot be performed in the specified region. Check whether the region ID is valid.
400 MissingParam.InstanceId The parameter instanceId is missing or empty. InstanceId is required.
403 InstanceIds.ExceedLimit The number of instance IDs exceeds the upper limit. The maximum number of instance IDs is exceeded.
403 InvalidParam.PageSize The specified parameter is invalid. Invalid PageSize value.
403 InvalidParam.PageNumber The specified parameter is invalid. Invalid PageNumber value.
403 Operation.Forbidden The operation is not permitted. The operation is not supported.
404 InvalidInstance.NotFound The specified instance does not exist. The specified instance is not found.
500 InternalError.Dispatch An error occurred when you dispatched the request. An error occurred while the request was being sent. Try again later.
500 ServiceUnavailable The request has failed due to a temporary failure of the server. The request failed due to a temporary failure of the backend server.

For a list of error codes, see Service error codes.