DescribeCloudAssistantStatus

Updated at:

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 MaxResults to limit the number of returned entries. 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 MaxResults to limit the number of returned entries.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecs:DescribeCloudAssistantStatus

get

*Instance

acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}

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

  • Linux

  • FreeBSD

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: A heartbeat is detected within 2 minutes.

  • false: No heartbeat is detected within 2 minutes.

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:

  • Windows

  • Linux

  • FreeBSD

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:

  • Linux: 2.2.3.189

  • Windows: 2.1.3.189

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.