All Products
Search
Document Center

Elastic Compute Service:DescribeManagedInstances

Last Updated:Aug 28, 2026

Queries managed instances.

Operation description

When performing a paged query on the home page, you only need to set MaxResults to limit the number of entries in the return result. The NextToken in the returned result serves as the credential for querying subsequent pages. When querying subsequent pages, set the NextToken parameter to the NextToken obtained from the previous response as the query credential, and set 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:DescribeManagedInstances

get

Instance

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

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

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

You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

RegionId

string

Yes

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

You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

OsType

string

No

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

  • windows

  • linux

  • FreeBSD

windows

InstanceIp

string

No

The internal or public IP address of the managed instance.

192.168.**.**

ActivationId

string

No

The ID of the activation code.

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

MachineId

string

No

The value of the MachineId parameter that you specify when you register a managed instance. A maximum of 36 characters are allowed. Sample registration script:

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

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

  • We recommend that you explicitly specify the MachineId and ForceResult parameters to mark the mapping between a managed instance and an on-premises machine.

GOG4X8312A0188

InstanceName

string

No

The name of the managed instance.

my-webapp-server

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

InstanceId

array

No

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

mi-hz018jrc1o0****

string

No

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

mi-hz018jrc1o0****

Tag

array<object>

No

The tags of the managed instance.

object

No

The tag of the managed instance.

Key

string

No

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

If a single tag is specified to query resources, up to 1,000 resources that have this tag added can be displayed in the response. If multiple tags are specified to query resources, up to 1,000 resources that have all these tags added can be displayed in the response. To query more than 1,000 resources that have specified tags added, call the ListTagResources operation.

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

TestKey

Value

string

No

The value of tag N 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.

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

ResourceGroupId

string

No

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

rg-123******

Connected

string

No

Indicates whether the managed instance is connected.

true: The managed instance is connected, and you can manage it by using Cloud Assistant.

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

true

Response elements

Element

Type

Description

Example

object

PageSize

integer

The number of entries per page.

10

RequestId

string

The request ID.

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

PageNumber

integer

The page number.

1

TotalCount

integer

The total number of queried managed instances.

1

Instances

array<object>

The queried managed instances.

array<object>

LastInvokedTime

string

The time when the last Cloud Assistant task was executed.

2021-01-20T09:00:40Z

Connected

boolean

Indicates whether the managed instance is connected. Valid values:

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

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

true

InternetIp

string

The public IP address of the managed instance.

40.65.**.**

Hostname

string

The hostname of the managed instance.

demo

InstanceId

string

The ID of the managed instance.

mi-hz018jrc1o0****

ActivationId

string

The ID of the activation code.

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

IntranetIp

string

The internal IP address of the managed instance.

10.0.**.**

AgentVersion

string

The version number of Cloud Assistant Agent.

2.2.0.102

RegistrationTime

string

The time when the managed instance was registered.

2021-01-20T08:57:56Z

InstanceName

string

The name of the managed instance.

webAPP-linux-01

OsType

string

The operating system type 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

InvocationCount

integer

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

1

MachineId

string

The machine code of the managed instance.

e03231b37ab14e53b5795ad625fc****

Tags

array<object>

The tags of the managed instance.

object

The tag of the managed instance.

TagKey

string

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

If a single tag is specified to query resources, up to 1,000 resources that have this tag added are returned. If multiple tags are specified to query resources, up to 1,000 resources that have all these tags added are returned. To query more than 1,000 resources that have the specified tags, call the ListTagResources operation.

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

TestKey

TagValue

string

The value of tag N 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

ResourceGroupId

string

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

rg-123******

NextToken

string

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

AAAAAdDWBF2

Examples

Success response

JSON format

{
  "PageSize": 10,
  "RequestId": "77115469-F2C5-4ECA-94F7-FA04F2FD****",
  "PageNumber": 1,
  "TotalCount": 1,
  "Instances": [
    {
      "LastInvokedTime": "2021-01-20T09:00:40Z",
      "Connected": true,
      "InternetIp": "40.65.**.**",
      "Hostname": "demo",
      "InstanceId": "mi-hz018jrc1o0****",
      "ActivationId": "3704F543-F768-43FA-9864-897F75B3****",
      "IntranetIp": "10.0.**.**",
      "AgentVersion": "2.2.0.102",
      "RegistrationTime": "2021-01-20T08:57:56Z",
      "InstanceName": "webAPP-linux-01",
      "OsType": "Linux",
      "OsVersion": "Linux_#38~18.04.1-Ubuntu SMP Wed Jan 6 18:26:30 UTC 2021_x86_64",
      "InvocationCount": 1,
      "MachineId": "e03231b37ab14e53b5795ad625fc****",
      "Tags": [
        {
          "TagKey": "TestKey",
          "TagValue": "TestValue"
        }
      ],
      "ResourceGroupId": "rg-123******"
    }
  ],
  "NextToken": "AAAAAdDWBF2"
}

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