Queries all hosts within the current Alibaba Cloud account, including hosts on which the CloudMonitor agent is installed and uninstalled.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
cms:DescribeMonitoringAgentHosts | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
KeyWord | string | No | The keyword that is used in fuzzy match. | host1 |
HostName | string | No | The name of the host. | hostNam1 |
InstanceIds | string | No | The ID of the instance. | i-a3d1q1pm2f9yr29e**** |
SerialNumbers | string | No | The serial number of the host. After the CloudMonitor agent is installed on a host, a globally unique serial number is generated. A host that is not provided by Alibaba Cloud has a serial number instead of an instance ID. Note
This parameter can be used to accurately search for a monitored host.
| a1ab31a3-1234-40f2-9e95-c8caa8f0**** |
PageNumber | integer | No | The number of the page to return. | 1 |
PageSize | integer | No | The number of entries to return on each page. Valid values:
Note
Although Alibaba Cloud does not limit the maximum value of this parameter, we recommend that you do not set it to an excessively large value. If you set it to an excessively large value, a timeout error may occur.
| 10 |
InstanceRegionId | string | No | The region ID of the instance. | cn-hangzhou |
AliyunHost | boolean | No | Specifies whether to query Elastic Compute Service (ECS) instances that are provided by Alibaba Cloud or to query hosts that are not provided by Alibaba Cloud. Valid values:
| true |
Status | string | No | The status of the hosts that you want to query. Valid values:
| Running |
SysomStatus | string | No | The status of SysOM. Valid values:
| running |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "63EEBB2A-9E51-41E4-9E83-5DE7F3B292E0",
"Success": true,
"Code": "200",
"Message": "The Request is not authorization.",
"PageNumber": 1,
"PageSize": 10,
"PageTotal": 50,
"Total": 10,
"Hosts": {
"Host": [
{
"SerialNumber": "x12335-6cc8-4a22-9f21-1a00a719****",
"NatIp": "192.168.XX.XX",
"HostName": "hostIP",
"AliUid": 0,
"NetworkType": "vpc",
"InstanceId": "i-a2d5q7pm3f9yr212****",
"isAliyunHost": true,
"EipAddress": "192.168.XX.XX",
"AgentVersion": "3.4.6",
"IpGroup": "192.168.XX.XX",
"EipId": "eip-bp16i16k9gcezyfrp****",
"Region": "cn-hangzhou",
"InstanceTypeFamily": "ecs.n4",
"OperatingSystem": "Linux"
}
]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | ParameterInvalid | Illegal parameters. | - |
403 | AccessForbidden | User not authorized to operate on the specified resource. | - |
404 | ResourceNotFound | The specified resource is not found. | The specified resource is not found. |
500 | InternalError | The request processing has failed due to some unknown error. | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-05-25 | The Error code has changed | View Change Details |
2022-04-08 | API Description Update. The Error code has changed | View Change Details |