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