DescribeCloudAssistantStatus

更新时间:
复制 MD 格式

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.

  • 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 that can be used in the next call 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.

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

cn-hangzhou

RegionId

string

Yes

The region ID of the instance. You can call DescribeRegions 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 removed in the future. We recommend that you use NextToken and MaxResults for a paged query.

1

PageSize

integer

No

Note

This parameter will be removed in the future. We recommend that you use NextToken and MaxResults for a paged query.

10

MaxResults

integer

No

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

NextToken

string

No

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

InstanceId

array

No

The instance ID.

i-bp1iudwa5b1tqa****

string

No

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 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 page number.

1

TotalCount

integer

The total number of instances.

1

NextToken

string

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

AAAAAdDWBF2

InstanceCloudAssistantStatusSet

object

InstanceCloudAssistantStatus

array<object>

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

object

CloudAssistantStatus

string

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

LastInvokedTime

string

The time when commands were last run.

2021-03-15T08:00:00Z

CloudAssistantVersion

string

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

ActiveTaskCount

integer

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

0

InvocationCount

integer

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

2

InstanceId

string

The ID of the instance.

i-bp1iudwa5b1tqa****

LastHeartbeatTime

string

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

OSType

string

The operating system type of the instance. Valid values:

  • Windows

  • Linux

  • FreeBSD

Linux

SupportSessionManager

boolean

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

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.
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 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.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.