获取云主机监控信息

本页目录

https://www.cloudam.cn/vps/cvmresource/metrics?accountId={ACCOUNT_ID}&ip={IP}

请求方式:GET

获取云主机监控信息

URL Parameters

ParameterTypeDescription
IPString弹性公网ip地址
Example: 121.41.107.138
ACCOUNT_IDString你的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属性)

AttributeTypeDescription
ipString云主机公网IP
metricsArray云主机指标列表
metrics.nameString指标名称
metrics.dataArray指标数据
metrics.data.timestampString监控时间点,毫秒级Unix时间戳
metrics.data.valueString 指标值