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