Queries the list of managed instances.
Operation description
When performing a paged query for the first page, you only need to adjust the Settings of MaxResults to limit the number of returned entries. The NextToken in the response will be used as the token for paging subsequent pages. When performing a paged query for subsequent pages, set the NextToken parameter to the NextToken value obtained from the previous response, and adjust the Settings of MaxResults to limit the number of returned entries.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:DescribeManagedInstances |
get |
Instance
|
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), 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 |
| InstanceIp |
string |
No |
The internal IP address 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 specified when registering the managed instance. The value can be up to 36 characters in length. Sample registration script:
|
GOG4X8312A0188 |
| InstanceName |
string |
No |
The name of the managed instance. |
my-webapp-server |
| PageNumber |
integer |
No |
Note
This parameter will soon go offline. We recommend that you use NextToken and MaxResults for paging and paged query operations. |
1 |
| PageSize |
integer |
No |
Note
This parameter will soon go offline. We recommend that you use NextToken and MaxResults for paging and paged 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 list of tags. |
|
|
object |
No |
The list of tags. |
||
| Key |
string |
No |
The tag key of the managed instance. Valid values of N: 1 to 20. The value cannot be an empty string. If you use a single tag to filter resources, the resource count of resources under this tag cannot exceed 1,000. If you use multiple tags to filter resources, the resource count of resources to which you attach multiple tags cannot exceed 1,000. If the resource count exceeds 1,000, you must use the ListTagResources operation to query the resources. The tag key can be up to 64 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://. |
TestKey |
| Value |
string |
No |
The tag value of the managed instance. Valid values of N: 1 to 20. The 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 to return on each page during paging or a paged query. 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**** |
| 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. Valid values:
|
true |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Instances |
array<object> |
The list of managed instances. |
|
|
array<object> |
|||
| ActivationId |
string |
The ID of the activation code. |
3704F543-F768-43FA-9864-897F75B3**** |
| AgentVersion |
string |
The version number of the Cloud Assistant Agent. |
2.2.0.102 |
| Connected |
boolean |
Indicates whether the managed instance is connected. Valid values:
|
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 Cloud Assistant tasks 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 the UTC time zone. |
2021-01-20T09:00:40Z |
| MachineId |
string |
The machine ID 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 the UTC time zone. |
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 list of tags. |
|
|
object |
The list of tags. |
||
| TagKey |
string |
The tag key of the managed instance. Valid values of N: 1 to 20. The value cannot be an empty string. If you use a single tag to filter resources, the resource count of resources under this tag cannot exceed 1,000. If you use multiple tags to filter resources, the resource count of resources to which you attach multiple tags cannot exceed 1,000. If the resource count exceeds 1,000, you must use the ListTagResources operation to query the resources. The tag key can be up to 64 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://. |
TestKey |
| TagValue |
string |
The tag value of the managed instance. Valid values of N: 1 to 20. The 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 for this call. |
AAAAAdDWBF2 |
| PageNumber |
integer |
The page number of the managed instance list. |
1 |
| PageSize |
integer |
The number of entries returned per page. |
10 |
| RequestId |
string |
The request ID. |
77115469-F2C5-4ECA-94F7-FA04F2FD**** |
| TotalCount |
integer |
The total number of managed instances queried. Note
When you use the MaxResults and NextToken parameters for paging and paged query, the returned TotalCount value is meaningless. |
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.