All Products
Search
Document Center

Elastic Compute Service:DescribeCloudAssistantStatus

Last Updated:Nov 14, 2024

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

Operation description

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.

  • You can use one of the following methods to check the responses:

    • Method 1: During a paged query, when you call the DescribeCloudAssistantStatus operation to retrieve the first page of results, set MaxResults to specify the maximum number of entries to return in the call. The return value of NextToken is a pagination token, which can be used in the next request to retrieve a new page of results. When you call the DescribeCloudAssistantStatus operation to retrieve a new page of results, set NextToken to the NextToken value returned in the previous call and set MaxResults to specify the maximum number of entries to return in this call.
    • Method 2: Use PageSize to specify the number of entries to return on each page and then use PageNumber to specify the number of the page to return. You can use only one of the preceding methods. If you specify MaxResults or NextToken, the PageSize and PageNumber request parameters do not take effect and the TotalCount response parameter is invalid.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ecs:DescribeCloudAssistantStatusget
*Instance
acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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

cn-hangzhou
OSTypestringNo

The operating system type of the instance. Valid values:

  • Windows
  • Linux
  • FreeBSD
Windows
PageNumberlongNo

The page number.

Pages start from page 1.

Default value: 1.

1
PageSizelongNo

The number of entries per page. If you specify InstanceId, this parameter does not take effect. Valid values: 1 to 50.

Default value: 10.

10
MaxResultsintegerNo

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

Valid values: 1 to 50.

Default value: 10.

10
NextTokenstringNo

The pagination token that is used in the next request to retrieve a new page of results. You must specify the token that is obtained from the previous query as the value of NextToken.

AAAAAdDWBF2
InstanceIdarrayNo

The instance ID.

stringNo

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.

i-bp1iudwa5b1tqa****

Response parameters

ParameterTypeDescriptionExample
object
PageSizelong

The number of entries per page.

1
RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
PageNumberlong

The page number.

1
TotalCountlong

The total number of instances.

1
NextTokenstring

A pagination token. It can be used in the next request to retrieve a new page of results.

AAAAAdDWBF2
InstanceCloudAssistantStatusSetarray<object>

Details about the installation status of Cloud Assistant on the instances.

InstanceCloudAssistantStatusobject
CloudAssistantStatusstring

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

  • true: Heartbeats are detected in the last 2 minutes.
  • false: No heartbeats are detected in the last 2 minutes.
true
LastInvokedTimestring

The time when commands were last run.

2021-03-15T08:00:00Z
CloudAssistantVersionstring

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
ActiveTaskCountlong

The number of tasks that Cloud Assistant was running on the instance.

0
InvocationCountlong

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

2
InstanceIdstring

The ID of the instance.

i-bp1iudwa5b1tqa****
LastHeartbeatTimestring

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
OSTypestring

The operating system type of the instance. Valid values:

  • Windows
  • Linux
  • FreeBSD
Linux
SupportSessionManagerboolean

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:

  • Linux: 2.2.3.189
  • Windows: 2.1.3.189
true

Examples

Sample success responses

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
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400RegionId.ApiNotSupportedThe 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.
400MissingParam.InstanceIdThe parameter instanceId is missing or empty.-
400InvalidParam.PageSizeThe specified parameter is invalid.The specified PageSize parameter is invalid.
400InvalidParam.PageNumberThe specified parameter is invalid.The specified PageNumber parameter is invalid.
400InvalidParameter.NextTokenThe specified parameter NextToken is not valid.The specified parameter NextToken is illegal.
400InvalidParameter.MaxResultsThe specified parameter MaxResults is not valid.The specified parameter MaxResults is illegal.
403InstanceIds.ExceedLimitThe number of instance IDs exceeds the upper limit.The number of specified instance IDs exceeds the upper limit.
403Operation.ForbiddenThe operation is not permitted.The operation is not supported.
404InvalidRegionId.NotFoundThe RegionId provided does not exist in our records.The RegionId provided does not exist
404InvalidInstance.NotFoundThe specified instance does not exist.-
500InternalError.DispatchAn error occurred when you dispatched the request.An error occurred while the request is being sent. Try again later.
500ServiceUnavailableThe request has failed due to a temporary failure of the server.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-12-21The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedView Change Details
2023-05-12The Error code has changedView Change Details
2021-08-13The Error code has changedView Change Details
2021-08-13The Error code has changedView Change Details