Query Metric Data HTTP Receivers
Headers
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zwatch/metrics/httpreceivers?q=name=CloudMonitorcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zwatch/metrics/httpreceivers/6e17a72176453e9e9a4b2783d1219fe4Queryable Fields
Run the CLI command line tool, enter QueryMetricDataHttpReceiver, and press Tab to view all queryable fields and cross-table queryable resource names.
API Response
Response Example
{
"inventories": [
{
"uuid": "77fa620b8d36311ca413c1bfc661c207",
"name": "CloudMonitor",
"url": "http://127.0.0.1/xxx",
"createDate": "Nov 14, 2017 2:20:57 PM",
"lastOpDate": "Nov 14, 2017 2:20:57 PM",
"state": "Enabled"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 0.6 | |
| inventories | List | For details, see inventories | 0.6 |
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error | 0.6 |
inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID. Uniquely identifies the resource | 0.6 |
| name | String | Resource name | 0.6 |
| url | String | 0.6 | |
| description | String | Detailed description of the resource | 0.6 |
| createDate | Timestamp | Creation time | 0.6 |
| lastOpDate | Timestamp | Last modification time | 0.6 |
| state | ReceiverState | For details, see state | 0.6 |
state
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Enabled | ReceiverState | 0.6 | |
| Disabled | ReceiverState | 0.6 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code. The globally unique error identifier, for example, SYS.1000, HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed error information | 0.6 |
| elaboration | String | Reserved field. Default is null | 0.6 |
| opaque | LinkedHashMap | Reserved field. Default is null | 0.6 |
| cause | ErrorCode | Root error. The source error that caused the current error. This field is null if no root error exists | 0.6 |
SDK Examples
Java SDK
QueryMetricDataHttpReceiverAction action = new QueryMetricDataHttpReceiverAction();
action.conditions = asList("name=CloudMonitor");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryMetricDataHttpReceiverAction.Result res = action.call();Python SDK
QueryMetricDataHttpReceiverAction action = QueryMetricDataHttpReceiverAction()
action.conditions = ["name=CloudMonitor"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryMetricDataHttpReceiverAction.Result res = action.call()