获取云主机监控信息
本页目录
https://www.cloudam.cn/vps/cvmresource/metrics?accountId={ACCOUNT_ID}&ip={IP}
请求方式:GET
获取云主机监控信息
URL Parameters
| Parameter | Type | Description |
|---|---|---|
| IP | String | 弹性公网ip地址 Example: 121.41.107.138 |
| ACCOUNT_ID | String | 你的Cloudam账户ID, Cloudam会随Token一起提前发送给客户 Example: demoaccount |
Request(请求)
Headers(HTTP头)
注: 请首先联系Cloudam获取API Token,token相当于密码,请妥善保护。
{
"Authorization": "Bearer ${token}",
"Content-Type": "application/json"
}
Response(响应) - 200
Headers(响应头)
{
"Content-Type": "application/json"
}
Body(响应体JSON) -- 正确响应
{
"ip": "114.67.81.105",
"metrics": [
{
"name": "cpu_usage",
"data": [
{
"timestamp": 1575878760000,
"value": 1.0
}
]
},
{
"name": "memory_usage",
"data": [
{
"timestamp": 1575878760000,
"value": 5.2
}
]
}
],
"errorCode": ""
}
Response Body Attributes(响应Body属性)
| Attribute | Type | Description |
|---|---|---|
| ip | String | 云主机公网IP |
| metrics | Array | 云主机指标列表 |
| metrics.name | String | 指标名称 |
| metrics.data | Array | 指标数据 |
| metrics.data.timestamp | String | 监控时间点,毫秒级Unix时间戳 |
| metrics.data.value | String | 指标值 |