All Products
Search
Document Center

Elastic Compute Service:DescribeManagedInstances

Last Updated:Apr 11, 2024

Queries a list of managed instances.

Operation description

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

  • Method 1: When you call the DescribeInstances operation to retrieve the first page of results during a paged query, use MaxResults to specify the maximum number of entries to return in the call. The return value of NextToken is a pagination token, which you can use in the next request to retrieve a new page of results. When you call the DescribeInstances operation to retrieve a new page of results, set NextToken to the NextToken value returned in the previous call and use MaxResults to specify the maximum number of entries to return in the 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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the managed instance. Supported regions: China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Hangzhou), China (Shanghai), China (Shenzhen), China (Heyuan), and China (Hong Kong).

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

cn-hangzhou
OsTypestringNo

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

  • windows
  • linux
windows
InstanceIpstringNo

The internal or public IP address of the managed instance.

192.168.**.**
ActivationIdstringNo

The ID of the activation code.

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

The name of the managed instance.

my-webapp-server
PageNumberlongNo

The page number.

Pages start from page 1.

Default value: 1.

1
PageSizelongNo

The number of entries per page.

Valid values: 1 to 50.

Default value: 10.

10
InstanceIdarrayNo

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

stringNo

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

mi-hz018jrc1o0****
Tagobject []No

The tags of the managed instance.

KeystringNo

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
ValuestringNo

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
MaxResultsintegerNo

The maximum number of entries per page.

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 do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.

AAAAAdDWBF2****
ResourceGroupIdstringNo

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

rg-123******

Response parameters

ParameterTypeDescriptionExample
object
PageSizelong

The number of entries per page.

10
RequestIdstring

The request ID.

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

The page number.

1
TotalCountlong

The total number of queried managed instances.

1
Instancesobject []

The queried managed instances.

LastInvokedTimestring

The time when the Cloud Assistant task was last executed.

2021-01-20T09:00:40Z
Connectedboolean

Indicates whether the managed instance is connected. Valid values:

  • true: The managed instance is connected and you can manage the instance by using Cloud Assistant.
  • false: The managed instance is not connected because the managed instance is down or because Cloud Assistant Agent is not installed correctly.
true
InternetIpstring

The public IP address of the managed instance.

40.65.**.**
Hostnamestring

The hostname of the managed instance.

demo
InstanceIdstring

The ID of the managed instance.

mi-hz018jrc1o0****
ActivationIdstring

The ID of the activation code.

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

The internal IP address of the managed instance.

10.0.**.**
AgentVersionstring

The version number of Cloud Assistant Agent.

2.2.0.102
RegistrationTimestring

The time when the managed instance was registered.

2021-01-20T08:57:56Z
InstanceNamestring

The name of the managed instance.

webAPP-linux-01
OsTypestring

The operating system type of the managed instance.

Linux
OsVersionstring

The version information of the operating system.

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

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

1
MachineIdstring

The machine code of the managed instance.

e03231b37ab14e53b5795ad625fc****
Tagsobject []

The tags of the managed instance.

TagKeystring

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
TagValuestring

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
ResourceGroupIdstring

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

rg-123******
NextTokenstring

The query token returned in the call.

AAAAAdDWBF2

Examples

Sample success responses

JSONformat

{
  "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 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.
400InvalidParam.PageNumberThe specified parameter is invalid.The specified PageNumber parameter is invalid.
400InvalidParam.PageSizeThe specified parameter is invalid.The specified PageSize parameter is invalid.
400InvalidTagKey.MalformedThe specified Tag.n.Key is not valid.The specified Tag.N.Key parameter is invalid.
400InvalidTagValue.MalformedThe specified Tag.n.Value is not valid.The specified tag value is invalid.
400NumberExceed.TagsThe Tags parameter number is exceed.The number of tags exceeds the maximum limit.
400MissingParameter.TagKeyYou must specify Tag.N.Key.The tag key is not specified.
400Duplicate.TagKeyThe Tag.N.Key contain duplicate key.The specified tag key already exists. Tag keys must be unique.
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.
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
500InternalError.DispatchAn error occurred when you dispatched the request.An error occurred while the request is being sent. Try again later.

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 changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change
    delete Error Codes: 403
    delete Error Codes: 404
    delete Error Codes: 500
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: MaxResults
    Added Input Parameters: NextToken
Output ParametersThe response structure of the API has changed.
2023-11-23The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 403
    delete Error Codes: 404
    delete Error Codes: 500
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: ResourceGroupId
Output ParametersThe response structure of the API has changed.
2022-02-25The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 404 change
    delete Error Codes: 400
    delete Error Codes: 500
    Added Error Codes: 403