All Products
Search
Document Center

Elastic Compute Service:DescribeManagedInstances

Last Updated:Sep 20, 2026

Queries a list of managed instances.

Operation description

When performing a paging query for the first page, set only MaxResults to limit the number of entries returned. The NextToken value in the response serves as the token for querying subsequent pages. When querying subsequent pages, set the NextToken parameter to the NextToken value obtained from the previous response as the query token, and set MaxResults to limit the number of entries returned.

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:DescribeManagedInstances

get

Instance

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

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID. The following regions are supported: China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Ulanqab), China (Hangzhou), China (Shanghai), China (Shenzhen), China (Heyuan), China (Guangzhou), China (Chengdu), Hong Kong (China), Singapore, Japan (Tokyo), US (Silicon Valley), and US (Virginia).

You can call DescribeRegions to query region IDs and other information.

cn-hangzhou

OsType

string

No

The operating system type of the managed instance. Valid values:

  • windows

  • linux

  • FreeBSD

windows

InstanceIp

string

No

The internal IP address or public IP address of the managed instance.

192.168.**.**

ActivationId

string

No

The activation code ID.

4ECEEE12-56F1-4FBC-9AB1-890F7494****

MachineId

string

No

The value of the MachineId parameter specified when the managed instance was registered. The value can be up to 36 characters in length. Sample registration script:

aliyun-service --register \
  --RegionId=cn-hangznou \
  --ActivationId=xxxxxxxxxxx \
  --ActivationCode=xxxxxxxxx \
  --MachineId=xxxxxx \ # Optional parameter that specifies the unique identifier of the machine.
  --ForceResue                 
  • If MachineId and ForceResult are specified during registration, Cloud Assistant generates a fixed managed instance ID for the MachineId.

  • If MachineId is not explicitly specified, Cloud Assistant automatically generates a MachineId value based on the hardware information of the machine.

  • Recommendation: Explicitly specify MachineId and ForceResult to mark the mapping between managed instances and on-premises machines.

GOG4X8312A0188

InstanceName

string

No

The name of the managed instance.

my-webapp-server

PageNumber

integer

No

Note

This parameter is about to be deprecated. Use NextToken and MaxResults to complete paging query operations.

1

PageSize

integer

No

Note

This parameter is about to be deprecated. Use NextToken and MaxResults to complete paging query operations.

10

InstanceId

array

No

The ID of the managed instance. Valid values of N: 1 to 50.

mi-hz018jrc1o0****

string

No

The ID of the managed instance. Valid values of N: 1 to 50.

mi-hz018jrc1o0****

Tag

array<object>

No

The tags.

object

No

The tags.

Key

string

No

The tag key of the managed instance. Valid values of N: 1 to 20. The tag key cannot be an empty string.

If you use a single tag to filter resources, the resource count with the specified tag cannot exceed 1,000. If you use multiple tags to filter resources, the resource count of resources that have all specified tags attached cannot exceed 1,000. If the resource count exceeds 1,000, call the ListTagResources operation to query resources.

The tag key can be up to 64 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

TestKey

Value

string

No

The tag value of the managed instance. Valid values of N: 1 to 20. The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot contain http:// or https://.

TestValue

MaxResults

integer

No

The maximum number of entries per page in a paging query.

Maximum value: 50.

Default value: 10.

10

NextToken

string

No

The pagination token. Set this parameter to the NextToken value returned in the previous API call.

AAAAAdDWBF2****

ResourceGroupId

string

No

The ID of the resource group to which the managed instance belongs.

rg-123******

Connected

string

No

Specifies whether the managed instance is connected.

true: The managed instance is connected. You can manage the managed instance by using Cloud Assistant.

false: The managed instance is not connected. The server may be shut down or Cloud Assistant Agent may not be properly installed.

true

Response elements

Element

Type

Description

Example

object

Instances

array<object>

The list of managed instances.

array<object>

ActivationId

string

The activation code ID.

3704F543-F768-43FA-9864-897F75B3****

AgentVersion

string

The version number of Cloud Assistant Agent.

2.2.0.102

Connected

boolean

Indicates whether the managed instance is connected.

  • true: The managed instance is connected. You can manage the managed instance by using Cloud Assistant.

  • false: The managed instance is not connected. The server may be shut down or Cloud Assistant Agent may not be properly installed.

true

Hostname

string

The hostname of the managed instance.

demo

InstanceId

string

The managed instance ID.

mi-hz018jrc1o0****

InstanceName

string

The name of the managed instance.

webAPP-linux-01

InternetIp

string

The public IP address of the managed instance.

40.65.**.**

IntranetIp

string

The internal IP address of the managed instance.

10.0.**.**

InvocationCount

integer

The number of times that Cloud Assistant tasks have been executed on the managed instance.

1

LastInvokedTime

string

The time when the last Cloud Assistant task was executed. The time is displayed in ISO 8601 format in UTC.

2021-01-20T09:00:40Z

MachineId

string

The machine code of the managed instance.

e03231b37ab14e53b5795ad625fc****

OsType

string

The operating system of the managed instance.

Linux

OsVersion

string

The version information of the operating system.

Linux_#38~18.04.1-Ubuntu SMP Wed Jan 6 18:26:30 UTC 2021_x86_64

RegistrationTime

string

The registration time of the managed instance. The time is displayed in ISO 8601 format in UTC.

2021-01-20T08:57:56Z

ResourceGroupId

string

The ID of the resource group to which the managed instance belongs.

rg-123******

Tags

array<object>

The tags.

object

The tags.

TagKey

string

The tag key of the managed instance. Valid values of N: 1 to 20. The tag key cannot be an empty string.

If you use a single tag to filter resources, the resource count with the specified tag cannot exceed 1,000. If you use multiple tags to filter resources, the resource count of resources that have all specified tags attached cannot exceed 1,000. If the resource count exceeds 1,000, call the ListTagResources operation to query resources.

The tag key can be up to 64 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

TestKey

TagValue

string

The tag value of the managed instance. Valid values of N: 1 to 20. The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot contain http:// or https://.

TestValue

NextToken

string

The pagination token returned in this call.

AAAAAdDWBF2

PageNumber

integer

The page number of the managed instance list.

1

PageSize

integer

The number of entries per page as specified in the request.

10

RequestId

string

The request ID.

77115469-F2C5-4ECA-94F7-FA04F2FD****

TotalCount

integer

The total number of managed instances queried.

1

Examples

Success response

JSON format

{
  "Instances": [
    {
      "ActivationId": "3704F543-F768-43FA-9864-897F75B3****",
      "AgentVersion": "2.2.0.102",
      "Connected": true,
      "Hostname": "demo",
      "InstanceId": "mi-hz018jrc1o0****",
      "InstanceName": "webAPP-linux-01",
      "InternetIp": "40.65.**.**",
      "IntranetIp": "10.0.**.**",
      "InvocationCount": 1,
      "LastInvokedTime": "2021-01-20T09:00:40Z",
      "MachineId": "e03231b37ab14e53b5795ad625fc****",
      "OsType": "Linux",
      "OsVersion": "Linux_#38~18.04.1-Ubuntu SMP Wed Jan 6 18:26:30 UTC 2021_x86_64",
      "RegistrationTime": "2021-01-20T08:57:56Z",
      "ResourceGroupId": "rg-123******",
      "Tags": [
        {
          "TagKey": "TestKey",
          "TagValue": "TestValue"
        }
      ]
    }
  ],
  "NextToken": "AAAAAdDWBF2",
  "PageNumber": 1,
  "PageSize": 10,
  "RequestId": "77115469-F2C5-4ECA-94F7-FA04F2FD****",
  "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 InvalidParam.PageNumber The specified parameter is invalid.
400 InvalidParam.PageSize The specified parameter is invalid.
400 InvalidTagKey.Malformed The specified Tag.n.Key is not valid. The specified Tag.N.Key parameter is invalid.
400 InvalidTagValue.Malformed The specified Tag.n.Value is not valid. The specified tag value is invalid.
400 NumberExceed.Tags The Tags parameter number is exceed. The number of tags exceeds the maximum limit.
400 MissingParameter.TagKey You must specify Tag.N.Key. The tag key is not specified.
400 Duplicate.TagKey The Tag.N.Key contain duplicate key. The specified tag key already exists. Tag keys must be unique.
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.
403 InvalidParameterCharacter The specified parameter %s contains illegal characters.
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

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.