All Products
Search
Document Center

:DescribeCloudAssistantStatus

最終更新日:Oct 30, 2023

Queries whether Cloud Assistant Agent is installed on one or more instances. If Cloud Assistant Agent is installed, the system queries the total number of Cloud Assistant commands that are run, the number of Cloud Assistant commands that are being run, and the time when Cloud Assistant commands were last run.

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. Run commands on or send files to the instances only when the return value is true.

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 DescribeRegions to query the most recent region list.

OSType String No Windows

The operating system type of the instance. Valid values:

  • Windows
  • Linux
  • FreeBSD
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. Valid values: 1 to 50.

Default value: 10.

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

The ID of instance N. The instance can be an Elastic Compute Service (ECS) instance or a managed instance. 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 the installation status of Cloud Assistant Agent 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. This parameter is empty if Cloud Assistant Agent is not installed or is not running on the instance.

ActiveTaskCount Long 0

The number of tasks that were being 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
  • FreeBSD
SupportSessionManager Boolean true

Indicates whether Cloud Assistant supports Session Manager on the instance. If Session Manager is not supported, the version of Cloud Assistant is outdated. Update Cloud Assistant Agent to the latest version.

To support Session Manager, the Cloud Assistant version must be no earlier than the following ones:

  • 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 response

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. Instance IDs must be specified.
400 InvalidParam.PageSize The specified parameter is invalid. Invalid PageSize value.
400 InvalidParam.PageNumber The specified parameter is invalid. Invalid PageNumber value.
403 InstanceIds.ExceedLimit The number of instance IDs exceeds the upper limit. The maximum number of instance IDs is exceeded.
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.