仪表盘接口
仪表盘接口
创建仪表盘
请求结构体
Method:POST
Url:/csm/api/v1/dashboard/products/{product}/dashboards
请求参数:
名称 | 类型 | 描述 | 是否必须 | 参数位置 |
---|---|---|---|---|
product | String | 用户id | 是 | Query参数 |
paramMap | DataConfiguration | 是 | requestBody参数 |
请求示例:
POST /csm/api/v1/dashboard/products/453bf9588c9e488f9ba2c984129090dc/dashboards
{
"userId": "453bf9588c9e488f9ba2c984129090dc",
"title": "LupinsDashboard",
"configure": {
"tabs": [
{
"name": "",
"widgets": [
],
"namespace": [
],
"dimensions": [
],
"metric": [
]
}
]
},
"type": "common"
}
响应示例:
{
"result": {
"code": 200,
"data": {
"name": "_51038"
},
"message": "ok",
"success": true,
"traceInfo": null
},
"success": true
}
删除仪表盘
请求结构体:
Method:Delete
Url:/csm/api/v1/dashboard/products/{product}/dashboards/{dashboardName}
请求参数:
名称 | 类型 | 描述 | 是否必须 | 参数位置 |
---|---|---|---|---|
product | String | 用户id | 是 | Query参数 |
dashboardName | String | 仪表盘id(非显示名称) | 是 | Query参数 |
请求示例:
Delete /csm/api/v1/dashboard/products/453bf9588c9e488f9ba2c984129090dc/dashboards/_50971
request body:
{
"dashboardName": "_50971",
"userId": "453bf9588c9e488f9ba2c984129090dc"
}
响应示例:
{
"result": {
"code": 200,
"data": null,
"message": "ok",
"success": true,
"traceInfo": null
},
"success": true
}
修改仪表盘
请求结构体:
Method:Put
Url:/csm/api/v1/dashboard/products/{product}/dashboards/{dashboardName}
请求参数:
名称 | 类型 | 描述 | 是否必须 | 参数位置 |
---|---|---|---|---|
product | String | 用户id | 是 | Query参数 |
dashboardName | String | 仪表盘id(非显示名称) | 是 | Query参数 |
请求示例:
Put /csm/api/v1/dashboard/products/453bf9588c9e488f9ba2c984129090dc/dashboards/_51008
{
"title": "LupinsDashboardxx",
"dashboardName": "_51008",
"configure": {
"tabs": [
{
"dimensions": [
],
"metric": [
],
"name": "",
"namespace": [
],
"widgets": [
]
}
]
},
"userId": "453bf9588c9e488f9ba2c984129090dc"
}
响应示例:
{
"result": {
"code": 200,
"data": "_51008",
"message": "ok",
"success": true,
"traceInfo": null
},
"success": true
}
查询仪表盘:
请求结构体:
Method:Get
Url:/csm/api/v1/dashboard/products/{product}/dashboards/{dashboardName}
请求参数:
名称 | 类型 | 描述 | 是否必须 | 参数位置 |
---|---|---|---|---|
product | String | 用户id | 是 | Query参数 |
dashboardName | String | 仪表盘id(非显示名称) | 是 | Query参数 |
请求示例:
Get /csm/api/v1/dashboard/products/453bf9588c9e488f9ba2c984129090dc/dashboards/_51008
响应示例:
{
"success": true,
"data": {
"product": "453bf9588c9e488f9ba2c984129090dc",
"lastUpdate": "2022-03-15T11:57:26.000+0000",
"name": "_51008",
"updator": "root:dasdsad",
"pid": 0,
"configure": "{\"tabs\":[{\"dimensions\":[],\"metric\":[],\"name\":\"\",\"namespace\":[],\"widgets\":[[{\"name\":\"_51008_51009\"}]]}]}",
"title": "LupinsDashboardxx",
"type": "common"
},
"message": "ok",
"traceInfo": null,
"code": 200
}
复制仪表盘
请求结构体:
Method:
Url: /csm/api/v1/dashboard/products/{product}/dashboards/{dashboardName}/duplicate
请求参数:
名称 | 类型 | 描述 | 是否必须 | 位置 |
---|---|---|---|---|
product | String | 用户id | 是 | Query参数 |
dashboardName | String | 仪表盘id | 是 | Query参数 |
请求示例:
Post /csm/api/v1/dashboard/products/453bf9588c9e488f9ba2c984129090dc/dashboards/_51038/duplicate
{
"dashboardName": "_51038",
"userId": "453bf9588c9e488f9ba2c984129090dc"
}
响应示例:
{
"result": {
"code": 200,
"data": "_51039",
"message": "ok",
"success": true,
"traceInfo": null
},
"success": true
}
DataConfiguration字段说明:
名称 | 类型 | 描述 | 是否必须 |
---|---|---|---|
userId | String | 用户id | 是 |
title | String | 仪表盘名称 | 是 |
configure | String | 仪表盘配置字段 | 是 |
type | String | 仪表盘类型 | 是 |
仪表盘的configure字段说明:
名称 | 解释说明 | 是否必须 |
---|---|---|
dimensions | 维度信息 | 是,但为空 |
metric | 指标信息 | 是,但为空 |
name | 组件id | 是,但为空 |
widgets | 组件集合 | 是,可为空 |
组件接口:
创建组件
请求结构体:
Method:Post
Url:/csm/api/v1/dashboard/products/{product}/dashboards/{dashboardName}/widgets
请求参数:
名称 | 类型 | 描述 | 是否必须 | 位置 |
---|---|---|---|---|
product | String | 用户id | 是 | Query参数 |
dashboardName | String | 仪表盘名字 | 是 | Query参数 |
请求示例:
Post /csm/api/v1/dashboard/products/453bf9588c9e488f9ba2c984129090dc/dashboards/_51008/widgets
响应示例:
{
"result": {
"code": 200,
"data": "_51008_51010",
"message": "ok",
"success": true,
"traceInfo": null
},
"success": true
}
删除组件:
请求结构体:
Method: Delete
Url:/csm/api/v1/dashboard/products/{product}/dashboards/{dashboardName}/widgets/{widgetName}
请求参数:
名称 | 类型 | 描述 | 是否必须 | 位置 |
---|---|---|---|---|
product | String | 用户id | 是 | Query参数 |
dashboardName | String | 仪表盘id | 是 | Query参数 |
widgetName | String | 组件id | 是 | Query参数 |
请求示例:
Delete /csm/api/v1/dashboard/products/453bf9588c9e488f9ba2c984129090dc/dashboards/_51008/widgets/_51008_51010
响应示例:
{
"result": {
"code": 200,
"data": "_51008_51010",
"message": "ok",
"success": true,
"traceInfo": null
},
"success": true
}
修改组件:
请求结构体:
Method:Put
Url:/csm/api/v1/dashboard/products/{product}/dashboards/{dashboardName}/widgets/{widgetName}
请求参数:
名称 | 类型 | 描述 | 是否必须 | 位置 |
---|---|---|---|---|
product | String | 用户id | 是 | Query参数 |
dashboardName | String | 仪表盘id | 是 | Query参数 |
widgetName | String | 组件id | 是 | Query参数 |
bodyParams | Map<String, Object> | 请求体 | 是 | requestBody |
请求示例:
Put /csm/api/v1/dashboard/products/453bf9588c9e488f9ba2c984129090dc/dashboards/_51008/widgets/_51008_51011
requestbody:
{
"title": "testApi",
"type": "trend",
"configure": {
"data": [
{
"metric": [
{
"name": "vCPUUsagePercent",
"unit": "%",
"alias": "CPU使用率",
"contrast": [
],
"timeContrast": [
],
"statistics": "avg"
}
],
"monitorObject": [
{
"instanceName": "instance-mmd6nizg",
"id": "i-WAMdDHZ0"
}
],
"scope": "BCE_BCC",
"subService": "linux",
"region": "bj",
"scopeValue": {
"name": "BCC",
"value": "BCE_BCC",
"hasChildren": false
},
"resourceType": "Instance",
"namespace": [
{
"namespaceType": "instance",
"transfer": "",
"filter": "",
"name": "i-WAMdDHZ0___bj.BCE_BCC.453bf9588c9e488f9ba2c984129090dc",
"instanceName": "instance-mmd6nizg",
"region": "bj",
"bcmService": "BCE_BCC",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
]
}
],
"product": "453bf9588c9e488f9ba2c984129090dc"
}
],
"style": {
"displayType": "line",
"nullPointMode": "zero",
"threshold": 0,
"decimals": 2,
"isEdit": true,
"unit": "%"
},
"title": "testApi",
"timeRange": {
"timeType": "dashboard",
"unit": "minutes",
"number": 1,
"relative": "today()"
},
"time": ""
},
"dashboardName": "_51008",
"widgetName": "_51008_51011",
"lastUpdate": "2022-03-15T12:36:12Z",
"userId": "453bf9588c9e488f9ba2c984129090dc"
}
响应示例:
{
"result": {
"code": 200,
"data": "_51008_51011",
"message": "ok",
"success": true,
"traceInfo": null
},
"success": true
}
查找组件:
请求结构体:
Method:Get
Url:/csm/api/v1/dashboard/products/{product}/dashboards/{dashboardName}/widgets/{widgetName}
请求参数:
名称 | 类型 | 描述 | 是否必须 | 位置 |
---|---|---|---|---|
product | String | 用户id | 是 | Query参数 |
dashboardName | String | 仪表盘id | 是 | Query参数 |
widgetName | String | 组件id | 是 | Query参数 |
请求示例:
Get /csm/api/v1/dashboard/products/a0d04d7c202140cb80155ff7b6752ce4/dashboards/_50367/widgets/_50367_50368
响应示例:
{
"result": {
"code": 200,
"data": {
"configure": "{\"data\":[{\"metric\":[{\"alias\":\"CPU使用率\",\"contrast\":[],\"name\":\"CPUUsagePercent\",\"statistics\":\"avg\",\"timeContrast\":[],\"unit\":\"%\"}],\"monitorObject\":[{\"id\":\"i-PZZZI0rK\",\"instanceName\":\"prod.nmp.bj.lt-3\"}],\"namespace\":[{\"bcmService\":\"BCE_BCC\",\"filter\":\"\",\"instanceName\":\"prod.nmp.bj.lt-3\",\"name\":\"i-PZZZI0rK___bj.BCE_BCC.a0d04d7c202140cb80155ff7b6752ce4\",\"namespaceType\":\"instance\",\"region\":\"bj\",\"subService\":[{\"name\":\"serviceType\",\"value\":\"linux\"}],\"transfer\":\"\"}],\"product\":\"a0d04d7c202140cb80155ff7b6752ce4\",\"region\":\"bj\",\"resourceType\":\"Instance\",\"scope\":\"BCE_BCC\",\"scopeValue\":{\"hasChildren\":false,\"name\":\"BCC\",\"value\":\"BCE_BCC\"},\"subService\":\"linux\"}],\"style\":{\"decimals\":2,\"displayType\":\"line\",\"isEdit\":true,\"nullPointMode\":\"zero\",\"threshold\":0,\"unit\":\"%\"},\"time\":\"\",\"timeRange\":{\"number\":1,\"relative\":\"today()\",\"timeType\":\"dashboard\",\"unit\":\"minutes\"},\"title\":\"xaxa\"}",
"id": 50368,
"lastUpdate": "2022-03-16T11:28:52.000+0000",
"name": "_50367_50368",
"pid": 50367,
"product": "a0d04d7c202140cb80155ff7b6752ce4",
"title": "xaxa",
"type": "trend",
"updator": "root"
},
"message": "ok",
"success": true,
"traceInfo": null
},
"success": true
}
复制组件:
请求结构体:
Method:Post
Url:/csm/api/v1/dashboard/products/{product}/dashboards/{dashboardName}/widgets/{widgetName}/duplicate
请求参数:
名称 | 类型 | 描述 | 是否必须 | 位置 |
---|---|---|---|---|
Product | String | 用户id | 是 | Query参数 |
dashboardName | String | 仪表盘id | 是 | Query参数 |
widgetName | String | 组件id | 是 | Query参数 |
请求示例:
Post /csm/api/v1/dashboard/products/a0d04d7c202140cb80155ff7b6752ce4/dashboards/_50367/widgets/_50367_50368/duplicate
{
"dashboardName": "_50367",
"widgetName": "_50367_50368",
"userId": "a0d04d7c202140cb80155ff7b6752ce4"
}
响应示例:
{
"result": {
"code": 200,
"data": "_50367_50369",
"message": "ok",
"success": true,
"traceInfo": null
},
"success": true
}
bodyParams中各个字段的含义:
名称 | 类型 | 描述 |
---|---|---|
titile | String | 图表名称 |
type | String | 图表类型 |
configure | Object | 配置信息 |
dashboardName | String | 仪表盘id |
widgetName | String | 组件id |
userId | String | 用户id |
Configure的特殊说明:
名称 | 类型 | 描述 |
---|---|---|
metric | Object | 存储指标信息 |
monitorObject | List | 存储实例的实例名称和短id |
scope | String | 云产品名称 |
subService | String | 操作系统名称 |
region | String | 地域 |
scopeValue | Object | 存储云产品名称以及是否是具有子类型的云产品 |
resourceType | String | 资源类型 |
namespace | Object | 实例信息 |
product | String | 用户id |
style | ||
title | String | 图表名称 |
timeRange | Object | 存储时间信息 |
metric解释说明:
名称 | 类型 | 说明 |
---|---|---|
name | String | 指标英文名 |
unit | String | 单位名称 |
alias | String | 指标中文名 |
contrast | List | |
timeContrast | List | |
statistics | String | 数据的统计方式 |
scopeValue解释说明:
名称 | 类型 | 说明 |
---|---|---|
name | String | 云产品名称 |
value | String | 云产品名称 |
hasChildren | String | 是否具有子类型 |
namespace解释说明:
名称 | 类型 | 说明 |
---|---|---|
namespaceType | String | 实例类型 |
transfer | String | 可为空 |
filter | String | 可为空 |
name | String | 由短id,region,scope和用户id拼接 |
instanceName | String | 实例名称 |
region | String | 地域 |
bcmService | String | 云产品名称 |
subService | List | 操作系统类型 |
查询数据接口:
查询表格数据接口:
查询指标单维度数据:
请求结构体:
Method: Post
Url: /csm/api/v1/dashboard/metric/report
请求参数:
名称 | 类型 | 描述 | 是否必须 | 位置 |
---|---|---|---|---|
paramMap | Map<String, List |
requestBody | 是 | 请求体 |
请求示例:
Post /csm/api/v1/dashboard/metric/report
{
"data": [
{
"monitorObject": [
{
"instanceName": "instance-100g0a1t",
"id": "i-cs4We1er"
}
],
"region": "bj",
"scope": "BCE_BCC",
"subService": "linux",
"scopeValue": {
"name": "BCC",
"value": "BCE_BCC",
"hasChildren": false
},
"namespace": [
{
"namespaceType": "app",
"transfer": "",
"filter": "",
"name": "i-cs4We1er___bj.BCE_BCC.a0d04d7c202140cb80155ff7b6752ce4",
"instanceName": "instance-100g0a1t",
"region": "bj",
"bcmService": "BCE_BCC",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
]
}
],
"product": "a0d04d7c202140cb80155ff7b6752ce4",
"metric": [
{
"displayName": "",
"name": "CpuIdlePercent",
"alias": "CPU空闲率",
"unit": "%",
"contrast": [
],
"timeContrast": [
],
"statistics": "avg",
"cycle": 30,
"metricDimensions": [
]
},
{
"displayName": "",
"name": "CpuIdlePercent",
"alias": "CPU空闲率",
"unit": "%",
"contrast": [
],
"timeContrast": [
],
"statistics": "avg",
"cycle": 30,
"metricDimensions": [
]
},
{
"displayName": "单核cpu空闲率",
"name": "Cpu0IdlePercent",
"alias": "单核cpu空闲率",
"unit": "%",
"contrast": [
],
"timeContrast": [
],
"statistics": "avg",
"cycle": 30,
"metricDimensions": [
]
}
]
}
],
"time": "2022-03-17 13:19:01|2022-03-17 14:19:01"
}
响应示例:
{
"result": {
"code": 200,
"data": [
{
"alias": "instance-100g0a1t",
"children": [
],
"metrics": {
"CPU空闲率": 99.5066855346097,
"CPU空闲率null": null,
"单核cpu空闲率": 0
},
"name": "namespace",
"value": "i-cs4We1er___bj.BCE_BCC.a0d04d7c202140cb80155ff7b6752ce4"
}
],
"message": "ok",
"success": true,
"traceInfo": null
},
"success": true
}
查询指标多维度数据:
请求结构体:
Method: Post
Url: /csm/api/v1/dashboard/metric/report
请求参数:
名称 | 类型 | 描述 | 是否必须 | 位置 |
---|---|---|---|---|
paramMap | Map<String, List |
requestBody | 是 | 请求体 |
请求示例:
Post /csm/api/v1/dashboard/metric/report
{
"data": [
{
"region": "bj",
"subService": "linux",
"namespace": [
{
"namespaceType": "app",
"transfer": "",
"filter": "",
"name": "66fdb896-03be-44cf-a2f6-673072a73700___bj.BCE_BEC.a0d04d7c202140cb80155ff7b6752ce4",
"instanceName": "prod.nmp.zz.lt",
"region": "bj",
"bcmService": "BCE_BEC",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
]
}
],
"product": "a0d04d7c202140cb80155ff7b6752ce4",
"monitorObject": [
{
"instanceName": "prod.nmp.zz.lt",
"id": "66fdb896-03be-44cf-a2f6-673072a73700"
}
],
"scope": "BCE_BEC",
"scopeValue": {
"name": "BEC",
"value": "BCE_BEC",
"hasChildren": false
},
"metric": [
{
"displayName": "",
"name": "vNicInBytes",
"alias": "网卡输入流量",
"unit": "Bytes",
"contrast": [
],
"timeContrast": [
],
"statistics": "avg",
"cycle": 60,
"dimensions": [
"eth1",
"eth0"
],
"metricDimensions": [
{
"name": "nicName",
"values": [
"eth1",
"eth0"
]
}
]
}
]
}
],
"time": "2022-03-17 13:36:15|2022-03-17 14:36:15"
}
响应示例:
{
"result": {
"code": 200,
"data": [
{
"alias": "prod.nmp.zz.lt",
"children": [
],
"metrics": {
"网卡输入流量null": null
},
"name": "namespace",
"value": "vm-mbqr24n7-0-u-zhengzhou-rk6cz___bj.BCE_BEC.a0d04d7c202140cb80155ff7b6752ce4"
},
{
"alias": "prod.nmp.zz.lt",
"children": [
],
"metrics": {
"网卡输入流量/nicName=eth0": 109.89697445851435
},
"name": "namespace",
"value": "vm-mbqr24n7-0-u-zhengzhou-rk6cz___bj.BCE_BEC.a0d04d7c202140cb80155ff7b6752ce4"
}
],
"message": "ok",
"success": true,
"traceInfo": null
},
"success": true
}
查询趋势图数据接口:
请求指标单单维度数据:
请求结构体:
Method: Post
Url: /csm/api/v1/dashboard/metric/trend
请求参数:
名称 | 类型 | 描述 | 是否必须 | 位置 |
---|---|---|---|---|
paramMap | Map<String, List |
requestBody | 是 | 请求体 |
请求示例:
Post /csm/api/v1/dashboard/metric/trend
{
"data": [
{
"metric": [
{
"alias": "CPU使用率",
"contrast": [
],
"name": "CPUUsagePercent",
"statistics": "avg",
"timeContrast": [
],
"unit": "%"
}
],
"monitorObject": [
{
"id": "i-PZZZI0rK",
"instanceName": "prod.nmp.bj.lt-3"
}
],
"namespace": [
{
"bcmService": "BCE_BCC",
"filter": "",
"instanceName": "prod.nmp.bj.lt-3",
"name": "i-PZZZI0rK___bj.BCE_BCC.a0d04d7c202140cb80155ff7b6752ce4",
"namespaceType": "instance",
"region": "bj",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
],
"transfer": ""
}
],
"product": "a0d04d7c202140cb80155ff7b6752ce4",
"region": "bj",
"resourceType": "Instance",
"scope": "BCE_BCC",
"scopeValue": {
"hasChildren": false,
"name": "BCC",
"value": "BCE_BCC"
},
"subService": "linux"
}
],
"time": "2022-03-16 20:07:08|2022-03-16 21:07:08"
}
响应示例:
{
"result": {
"code": 200,
"data": [
{
"data": [
[
1647432428000,
1.088869825196792
],
[
1647432488000,
1.1301696768360625
],
[
1647432548000,
1.121616294640465
],
[
1647432608000,
1.2224945251958774
],
[
1647432668000,
1.1133433785367464
],
[
1647432728000,
1.1054282362678525
],
[
1647432788000,
1.088412592096455
],
[
1647432848000,
1.08886842207912
],
[
1647432908000,
1.1805890325560453
],
[
1647432968000,
1.1304639088929813
],
[
1647433028000,
1.1221868848513172
],
[
1647433088000,
1.1220901021604446
],
[
1647433148000,
1.1218966339988645
],
[
1647433208000,
1.2473887573338782
],
[
1647433268000,
1.0555387935971217
],
[
1647433328000,
1.1219947540596686
],
[
1647433388000,
1.0970627209100137
],
[
1647433448000,
1.113525631152723
],
[
1647433508000,
1.1476957602599591
],
[
1647433568000,
1.1383611666157534
],
[
1647433628000,
1.1216136807599975
],
[
1647433688000,
1.1137080059014648
],
[
1647433748000,
1.1304485140594733
],
[
1647433808000,
1.1974361649731091
],
[
1647433868000,
1.1384565147165238
],
[
1647433928000,
1.1722375944549113
],
[
1647433988000,
1.1384563870751707
],
[
1647434048000,
1.0638297872340385
],
[
1647434108000,
1.364850904410625
],
[
1647434168000,
1.146831883648497
],
[
1647434228000,
1.0803052879708785
],
[
1647434288000,
1.1551003060250309
],
[
1647434348000,
1.1381706299499028
],
[
1647434408000,
1.2477282714126015
],
[
1647434468000,
1.1722102083547903
],
[
1647434528000,
3.7496181651562983
],
[
1647434588000,
1.2229112653642848
],
[
1647434648000,
1.12178745891241
],
[
1647434708000,
1.2222603985326486
],
[
1647434768000,
1.1385503015411302
],
[
1647434828000,
1.1136294228551058
],
[
1647434888000,
1.1386359315829209
],
[
1647434948000,
1.1217143813828878
],
[
1647435008000,
1.2987862858252153
],
[
1647435068000,
1.1219947540596686
],
[
1647435128000,
1.171825562527501
],
[
1647435188000,
1.1721367691038598
],
[
1647435248000,
1.1136210097869192
],
[
1647435308000,
1.1644157595834537
],
[
1647435368000,
1.1550878890989658
],
[
1647435428000,
1.105433660795463
],
[
1647435488000,
1.1056160966566309
],
[
1647435548000,
1.1135174692676442
],
[
1647435608000,
1.1728107693744771
],
[
1647435668000,
1.1801672721141965
],
[
1647435728000,
1.1385517670862766
],
[
1647435788000,
1.1053175242853097
],
[
1647435848000,
1.0887772194304812
],
[
1647435908000,
1.1808035982291631
],
[
1647435968000,
1.1135312389255247
]
],
"denominator": 1,
"dimensions": "",
"legend": null,
"metric": "CPU使用率",
"metricType": "",
"metricUnit": "%",
"metricUnitTransformation": "",
"name": "prod.nmp.bj.lt-3",
"namespace": "i-PZZZI0rK___bj.BCE_BCC.a0d04d7c202140cb80155ff7b6752ce4",
"numerator": 1,
"product": null,
"scope": "ignore",
"statistics": null,
"time": null,
"transPolicy": ""
}
],
"message": "ok",
"success": true,
"traceInfo": null
},
"success": true
}
查询指标多维度数据:
请求结构体:
Method: Post
Url: /csm/api/v1/dashboard/metric/trend
请求参数:
名称 | 类型 | 描述 | 是否必须 | 位置 |
---|---|---|---|---|
paramMap | Map<String, List |
requestBody | 是 | 请求体 |
请求示例:
{
"data": [
{
"metric": [
{
"name": "vNicInBytes",
"unit": "Bytes",
"alias": "网卡输入流量",
"contrast": [
],
"timeContrast": [
],
"statistics": "avg",
"dimensions": [
"eth1",
"eth0"
],
"metricDimensions": [
{
"name": "nicName",
"values": [
"eth1",
"eth0"
]
}
]
}
],
"monitorObject": [
{
"instanceName": "prod.nmp.zz.lt",
"id": "66fdb896-03be-44cf-a2f6-673072a73700"
}
],
"scope": "BCE_BEC",
"subService": "linux",
"region": "bj",
"scopeValue": {
"name": "BEC",
"value": "BCE_BEC",
"hasChildren": false
},
"resourceType": "Instance",
"namespace": [
{
"namespaceType": "instance",
"transfer": "",
"filter": "",
"name": "66fdb896-03be-44cf-a2f6-673072a73700___bj.BCE_BEC.a0d04d7c202140cb80155ff7b6752ce4",
"instanceName": "prod.nmp.zz.lt",
"region": "bj",
"bcmService": "BCE_BEC",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
]
}
],
"product": "a0d04d7c202140cb80155ff7b6752ce4"
},
{
"metric": [
{
"name": "vNicInBytes",
"unit": "Bytes",
"alias": "网卡输入流量",
"contrast": [
],
"timeContrast": [
],
"statistics": "avg",
"dimensions": [
"eth1",
"eth0"
],
"metricDimensions": [
{
"name": "nicName",
"values": [
"eth1",
"eth0"
]
}
]
}
],
"monitorObject": [
{
"instanceName": "pyy_instance_03",
"id": "9fdfc220-e3da-4d30-9ea2-cd26748478a3"
}
],
"scope": "BCE_BEC",
"subService": "linux",
"region": "bj",
"scopeValue": {
"name": "BEC",
"value": "BCE_BEC",
"hasChildren": false
},
"resourceType": "Instance",
"namespace": [
{
"namespaceType": "instance",
"transfer": "",
"filter": "",
"name": "9fdfc220-e3da-4d30-9ea2-cd26748478a3___bj.BCE_BEC.a0d04d7c202140cb80155ff7b6752ce4",
"instanceName": "pyy_instance_03",
"region": "bj",
"bcmService": "BCE_BEC",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
]
}
],
"product": "a0d04d7c202140cb80155ff7b6752ce4"
}
],
"time": "2022-03-17 13:53:19|2022-03-17 14:53:19"
}
响应示例:
{
"result": {
"code": 200,
"data": [
{
"data": [
],
"denominator": 1,
"dimensions": "",
"legend": null,
"metric": "网卡输入流量",
"metricType": "",
"metricUnit": "Bytes",
"metricUnitTransformation": "",
"name": "prod.nmp.zz.lt",
"namespace": "vm-mbqr24n7-0-u-zhengzhou-rk6cz___bj.BCE_BEC.a0d04d7c202140cb80155ff7b6752ce4",
"numerator": 1,
"product": null,
"scope": "ignore",
"statistics": null,
"time": null,
"transPolicy": ""
},
{
"data": [
[
1647496399000,
105.66666666666667
],
[
1647496459000,
111.5284946236559
],
[
1647496519000,
105.66666666666667
],
[
1647496579000,
105.66666666666667
],
[
1647496639000,
135.16666666666666
],
[
1647496699000,
108.4510752688172
],
[
1647496759000,
117.06666666666666
],
[
1647496819000,
113.26666666666667
],
[
1647496879000,
101.86666666666667
],
[
1647496939000,
100.07365591397848
],
[
1647496999000,
110.36666666666666
],
[
1647497059000,
125.46666666666665
],
[
1647497119000,
100.96666666666665
],
[
1647497179000,
103.7510752688172
],
[
1647497239000,
131.36666666666667
],
[
1647497299000,
111.26666666666667
],
[
1647497359000,
101.86666666666667
],
[
1647497419000,
105.66666666666667
],
[
1647497479000,
104.1736559139785
],
[
1647497539000,
105.66666666666667
],
[
1647497599000,
109.46666666666665
],
[
1647497659000,
115.56666666666665
],
[
1647497719000,
101.00268817204302
],
[
1647497779000,
101.86666666666666
],
[
1647497839000,
133.16666666666666
],
[
1647497899000,
113.26666666666665
],
[
1647497959000,
104.77365591397849
],
[
1647498019000,
105.66666666666667
],
[
1647498079000,
113.26666666666665
],
[
1647498139000,
104.76666666666665
],
[
1647498199000,
101.86666666666667
],
[
1647498259000,
96.51559139784946
],
[
1647498319000,
99.86666666666666
],
[
1647498379000,
108.36666666666666
],
[
1647498439000,
170
],
[
1647498499000,
100.00913978494623
],
[
1647498559000,
109.46666666666665
],
[
1647498619000,
109.46666666666665
],
[
1647498679000,
105.66666666666667
],
[
1647498739000,
103.96075268817204
],
[
1647498799000,
101.86666666666666
],
[
1647498859000,
106.23333333333333
],
[
1647498919000,
105.66666666666667
],
[
1647498979000,
109.46666666666665
],
[
1647499039000,
128.70913978494625
],
[
1647499099000,
105.66666666666667
],
[
1647499159000,
105.66666666666667
],
[
1647499219000,
101.86666666666666
],
[
1647499279000,
100.3
],
[
1647499339000,
100.16075268817205
],
[
1647499399000,
111.26666666666667
],
[
1647499459000,
106.56666666666666
],
[
1647499519000,
106.56666666666666
],
[
1647499579000,
108.63494623655913
],
[
1647499639000,
138.66666666666666
],
[
1647499699000,
138.0666666666667
],
[
1647499759000,
115.06666666666666
],
[
1647499819000,
109.59946236559138
],
[
1647499879000,
109.46666666666665
],
[
1647499939000,
109.36666666666666
]
],
"denominator": 1,
"dimensions": "nicName=eth0",
"legend": null,
"metric": "网卡输入流量",
"metricType": "",
"metricUnit": "Bytes",
"metricUnitTransformation": "",
"name": "prod.nmp.zz.lt",
"namespace": "vm-mbqr24n7-0-u-zhengzhou-rk6cz___bj.BCE_BEC.a0d04d7c202140cb80155ff7b6752ce4",
"numerator": 1,
"product": null,
"scope": "ignore",
"statistics": null,
"time": null,
"transPolicy": ""
},
{
"data": [
],
"denominator": 1,
"dimensions": "",
"legend": null,
"metric": "网卡输入流量",
"metricType": "",
"metricUnit": "Bytes",
"metricUnitTransformation": "",
"name": "pyy_instance_03",
"namespace": "vm-7xpmes5a-0-m-xiangtan-aqdq5___bj.BCE_BEC.a0d04d7c202140cb80155ff7b6752ce4",
"numerator": 1,
"product": null,
"scope": "ignore",
"statistics": null,
"time": null,
"transPolicy": ""
},
{
"data": [
[
1647496399000,
2100.7500000000005
],
[
1647496459000,
2174.3166666666666
],
[
1647496519000,
2133.6
],
[
1647496579000,
2067.9639784946235
],
[
1647496639000,
2142.9333333333334
],
[
1647496699000,
2079.2999999999997
],
[
1647496759000,
2220.9500000000003
],
[
1647496819000,
2124.9333333333334
],
[
1647496879000,
2091.453825136612
],
[
1647496939000,
2079.5000000000005
],
[
1647496999000,
2223.1333333333337
],
[
1647497059000,
2025.7494623655914
],
[
1647497119000,
2105
],
[
1647497179000,
2093.016666666667
],
[
1647497239000,
2184.8333333333335
],
[
1647497299000,
1958.955376344086
],
[
1647497359000,
2149.983333333333
],
[
1647497419000,
2134.516666666667
],
[
1647497479000,
2178.683333333333
],
[
1647497539000,
2098.7112903225807
],
[
1647497599000,
2076.133333333333
],
[
1647497659000,
2141.0333333333333
],
[
1647497719000,
2149.8725806451616
],
[
1647497779000,
2114.6
],
[
1647497839000,
2313.2999999999997
],
[
1647497899000,
2041.2786885245903
],
[
1647497959000,
2128.9666666666667
],
[
1647498019000,
2061.483333333333
],
[
1647498079000,
2050.9333333333334
],
[
1647498139000,
2198.749462365591
],
[
1647498199000,
2176.4
],
[
1647498259000,
2190.6499999999996
],
[
1647498319000,
2100.6666666666674
],
[
1647498379000,
2244.51935483871
],
[
1647498439000,
2150.2833333333333
],
[
1647498499000,
2186.4833333333336
],
[
1647498559000,
2058.0666666666666
],
[
1647498619000,
2148.5129032258064
],
[
1647498679000,
2124.5499999999997
],
[
1647498739000,
2147.7499999999995
],
[
1647498799000,
2127.8833333333337
],
[
1647498859000,
2138.4739784946237
],
[
1647498919000,
2025.9666666666665
],
[
1647498979000,
2164.85
],
[
1647499039000,
2100.3
],
[
1647499099000,
2106.6655913978493
],
[
1647499159000,
2123.1333333333337
],
[
1647499219000,
2217.05
],
[
1647499279000,
2115.633333333333
],
[
1647499339000,
2097.3634408602147
],
[
1647499399000,
2203.0833333333335
],
[
1647499459000,
2188.6666666666665
],
[
1647499519000,
1912.032258064516
],
[
1647499579000,
2212.3666666666663
],
[
1647499639000,
2134.516666666667
],
[
1647499699000,
2072.6
],
[
1647499759000,
2183.3876344086025
],
[
1647499819000,
2098.766666666667
],
[
1647499879000,
2121.0833333333335
],
[
1647499939000,
2291.266666666667
]
],
"denominator": 1,
"dimensions": "nicName=eth1",
"legend": null,
"metric": "网卡输入流量",
"metricType": "",
"metricUnit": "Bytes",
"metricUnitTransformation": "",
"name": "pyy_instance_03",
"namespace": "vm-7xpmes5a-0-m-xiangtan-aqdq5___bj.BCE_BEC.a0d04d7c202140cb80155ff7b6752ce4",
"numerator": 1,
"product": null,
"scope": "ignore",
"statistics": null,
"time": null,
"transPolicy": ""
}
],
"message": "ok",
"success": true,
"traceInfo": null
},
"success": true
}
查询仪表图数据接口:
查询指标单维度数据
请求结构体:
Method: Post
Url: /csm/api/v1/dashboard/metric/cycle
请求参数:
名称 | 类型 | 描述 | 是否必须 | 位置 |
---|---|---|---|---|
paramMap | Map<String, List |
requestBody | 是 | 请求体 |
请求示例:
Post /csm/api/v1/dashboard/metric/cycle
{
"data": [
{
"metric": [
{
"name": "CPUUsagePercent",
"unit": "%",
"alias": "CPU使用率",
"statistics": "avg",
"cycle": 30,
"mode": "easy"
}
],
"monitorObject": [
{
"instanceName": "instance-100g0a1t",
"id": "i-cs4We1er"
}
],
"scope": "BCE_BCC",
"subService": "linux",
"region": "bj",
"scopeValue": {
"name": "BCC",
"value": "BCE_BCC",
"hasChildren": false
},
"resourceType": "Instance",
"namespace": [
{
"namespaceType": "instance",
"transfer": "",
"filter": "",
"name": "i-cs4We1er___bj.BCE_BCC.a0d04d7c202140cb80155ff7b6752ce4",
"instanceName": "instance-100g0a1t",
"region": "bj",
"bcmService": "BCE_BCC",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
]
}
],
"product": "a0d04d7c202140cb80155ff7b6752ce4"
}
],
"time": "2022-03-17 13:55:27|2022-03-17 14:55:27"
}
响应示例:
{
"result": {
"code": 200,
"data": [
{
"data": [
[
0,
0.4801407634803959
]
],
"decimals": null,
"displayName": "CPU使用率",
"instanceName": "instance-100g0a1t",
"metricDimension": null,
"name": "CPU使用率",
"unit": "%"
}
],
"message": "ok",
"success": true,
"traceInfo": null
},
"success": true
}
查询指标多维度数据
请求结构体
Method: Post
Url: /csm/api/v1/dashboard/metric/cycle
请求参数
名称 | 类型 | 描述 | 是否必须 | 位置 |
---|---|---|---|---|
paramMap | Map<String, List |
requestBody | 是 | 请求体 |
请求示例
Post /csm/api/v1/dashboard/metric/cycle
{
"data": [
{
"metric": [
{
"name": "vNicInBytes",
"unit": "Bytes",
"alias": "网卡输入流量",
"statistics": "avg",
"cycle": 60,
"dimensions": [
"eth1"
],
"metricDimensions": [
{
"name": "nicName",
"values": [
"eth1"
]
}
],
"mode": "easy"
}
],
"monitorObject": [
{
"instanceName": "prod.nmp.zz.lt",
"id": "66fdb896-03be-44cf-a2f6-673072a73700"
}
],
"scope": "BCE_BEC",
"subService": "linux",
"region": "bj",
"scopeValue": {
"name": "BEC",
"value": "BCE_BEC",
"hasChildren": false
},
"resourceType": "Instance",
"namespace": [
{
"namespaceType": "instance",
"transfer": "",
"filter": "",
"name": "66fdb896-03be-44cf-a2f6-673072a73700___bj.BCE_BEC.a0d04d7c202140cb80155ff7b6752ce4",
"instanceName": "prod.nmp.zz.lt",
"region": "bj",
"bcmService": "BCE_BEC",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
]
}
],
"product": "a0d04d7c202140cb80155ff7b6752ce4"
}
],
"time": "2022-03-17 14:00:34|2022-03-17 15:00:34"
}
响应示例
{
"result": {
"code": 200,
"data": [
{
"data": [
[
0,
7403.071568126724
]
],
"decimals": null,
"displayName": "网卡输入流量",
"instanceName": "prod.nmp.zz.lt",
"metricDimension": "nicName=eth1",
"name": "网卡输入流量",
"unit": "Bytes"
}
],
"message": "ok",
"success": true,
"traceInfo": null
},
"success": true
}
查询数据面板数据接口:
查询指标单维度数据
请求结构体:
Method: Post
Url: /csm/api/v1/dashboard/metric/billboard
请求参数:
名称 | 类型 | 描述 | 是否必须 | 位置 |
---|---|---|---|---|
paramMap | Map<String, List |
requestBody | 是 | 请求体 |
请求示例:
Post /csm/api/v1/dashboard/metric/billboard
{
"data": [
{
"metric": [
{
"name": "CPUUsagePercent",
"alias": "CPU使用率",
"unit": "%",
"decimals": 3,
"statistics": "avg",
"cycle": 30
}
],
"monitorObject": [
{
"instanceName": "instance-100g0a1t",
"id": "i-cs4We1er"
}
],
"scope": "BCE_BCC",
"subService": "linux",
"region": "bj",
"scopeValue": {
"name": "BCC",
"value": "BCE_BCC",
"hasChildren": false
},
"resourceType": "Instance",
"namespace": [
{
"namespaceType": "app",
"transfer": "",
"filter": "",
"name": "i-cs4We1er___bj.BCE_BCC.a0d04d7c202140cb80155ff7b6752ce4",
"instanceName": "instance-100g0a1t",
"region": "bj",
"bcmService": "BCE_BCC",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
]
}
],
"product": "a0d04d7c202140cb80155ff7b6752ce4",
"instanceMsg": [
1
]
},
{
"metric": [
{
"name": "CpuUserPercent",
"alias": "用户CPU时间比率",
"unit": "%",
"decimals": 3,
"statistics": "avg",
"cycle": 30
}
],
"monitorObject": [
{
"instanceName": "prod.nmp.bj.lt-2",
"id": "i-mHsP9BIC"
}
],
"scope": "BCE_BCC",
"subService": "linux",
"region": "bj",
"scopeValue": {
"name": "BCC",
"value": "BCE_BCC",
"hasChildren": false
},
"resourceType": "Instance",
"namespace": [
{
"namespaceType": "app",
"transfer": "",
"filter": "",
"name": "i-mHsP9BIC___bj.BCE_BCC.a0d04d7c202140cb80155ff7b6752ce4",
"instanceName": "prod.nmp.bj.lt-2",
"region": "bj",
"bcmService": "BCE_BCC",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
]
}
],
"product": "a0d04d7c202140cb80155ff7b6752ce4",
"instanceMsg": [
1
]
}
],
"time": "2022-03-17 14:07:05|2022-03-17 15:07:05"
}
响应示例:
{
"result": {
"code": 200,
"data": [
{
"data": [
[
0,
0.48279659141729037
]
],
"decimals": null,
"displayName": "CPU使用率",
"instanceName": "instance-100g0a1t",
"metricDimension": null,
"name": "CPU使用率",
"unit": "%"
},
{
"data": [
[
0,
0.5276483591704575
]
],
"decimals": null,
"displayName": "用户CPU时间比率",
"instanceName": "prod.nmp.bj.lt-2",
"metricDimension": null,
"name": "用户CPU时间比率",
"unit": "%"
}
],
"message": "ok",
"success": true,
"traceInfo": null
},
"success": true
}
查询指标多维度数据
请求结构体:
Method: Post
Url: /csm/api/v1/dashboard/metric/billboard
请求参数:
名称 | 类型 | 描述 | 是否必须 | 位置 |
---|---|---|---|---|
paramMap | Map<String, List |
requestBody | 是 | 请求体 |
请求示例:
Post /csm/api/v1/dashboard/metric/billboard
{
"data": [
{
"metric": [
{
"name": "vNicInBytes",
"alias": "网卡输入流量",
"unit": "Bytes",
"decimals": 3,
"statistics": "avg",
"cycle": 60,
"dimensions": [
"eth1"
],
"metricDimensions": [
{
"name": "nicName",
"values": [
"eth1"
]
}
]
}
],
"monitorObject": [
{
"instanceName": "prod.nmp.zz.lt",
"id": "66fdb896-03be-44cf-a2f6-673072a73700"
}
],
"scope": "BCE_BEC",
"subService": "linux",
"region": "bj",
"scopeValue": {
"name": "BEC",
"value": "BCE_BEC",
"hasChildren": false
},
"resourceType": "Instance",
"namespace": [
{
"namespaceType": "app",
"transfer": "",
"filter": "",
"name": "66fdb896-03be-44cf-a2f6-673072a73700___bj.BCE_BEC.a0d04d7c202140cb80155ff7b6752ce4",
"instanceName": "prod.nmp.zz.lt",
"region": "bj",
"bcmService": "BCE_BEC",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
]
}
],
"product": "a0d04d7c202140cb80155ff7b6752ce4",
"instanceMsg": [
1
]
},
{
"metric": [
{
"name": "vNicOutBytes",
"alias": "网卡输出流量",
"unit": "Bytes",
"decimals": 3,
"statistics": "avg",
"cycle": 60,
"dimensions": [
"eth0"
],
"metricDimensions": [
{
"name": "nicName",
"values": [
"eth0"
]
}
]
}
],
"monitorObject": [
{
"instanceName": "prod.nmp.cd.dx",
"id": "6ec17b42-e7f4-4185-aa18-dc5a92208aff"
}
],
"scope": "BCE_BEC",
"subService": "linux",
"region": "bj",
"scopeValue": {
"name": "BEC",
"value": "BCE_BEC",
"hasChildren": false
},
"resourceType": "Instance",
"namespace": [
{
"namespaceType": "app",
"transfer": "",
"filter": "",
"name": "6ec17b42-e7f4-4185-aa18-dc5a92208aff___bj.BCE_BEC.a0d04d7c202140cb80155ff7b6752ce4",
"instanceName": "prod.nmp.cd.dx",
"region": "bj",
"bcmService": "BCE_BEC",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
]
}
],
"product": "a0d04d7c202140cb80155ff7b6752ce4",
"instanceMsg": [
1
]
}
],
"time": "2022-03-17 14:13:16|2022-03-17 15:13:16"
}
响应示例:
{
"result": {
"code": 200,
"data": [
{
"data": [
[
0,
7369.701467629486
]
],
"decimals": null,
"displayName": "网卡输入流量",
"instanceName": "prod.nmp.zz.lt",
"metricDimension": "nicName=eth1",
"name": "网卡输入流量",
"unit": "Bytes"
},
{
"data": [
[
0,
424.0134948080932
]
],
"decimals": null,
"displayName": "网卡输出流量",
"instanceName": "prod.nmp.cd.dx",
"metricDimension": "nicName=eth0",
"name": "网卡输出流量",
"unit": "Bytes"
}
],
"message": "ok",
"success": true,
"traceInfo": null
},
"success": true
}
查询图表的高级能力数据
高级能力是指将某一个时间点的平均值 、最大值、 最小值、 和值进行显示; 支持图表的类型有 趋势图、仪表图和数据面板。
请求结构体
Method:Post
Url:/csm/api/v1/dashboard/metric/trend/senior
请求参数
名称 | 类型 | 描述 | 是否必须 | 位置 |
---|---|---|---|---|
paramMap | Map<String, List |
requestBody | 是 | 请求体 |
请求示例
Post /csm/api/v1/dashboard/metric/trend/senior
{
"data": [
{
"metric": [
{
"alias": "CPU使用率",
"contrast": [
],
"name": "vCPUUsagePercent",
"statistics": "avg",
"timeContrast": [
],
"unit": "%"
}
],
"monitorObject": [
{
"id": "i-kR3ovVIx",
"instanceName": "instance-owtlv14o"
},
{
"id": "i-totUNyuT",
"instanceName": "instance-jm920sus"
},
{
"id": "i-WAMdDHZ0",
"instanceName": "instance-mmd6nizg"
}
],
"monitorType": "scope",
"namespace": [
{
"bcmService": "BCE_BCC",
"filter": "",
"instanceName": "instance-owtlv14o",
"name": "i-kR3ovVIx___bj.BCE_BCC.453bf9588c9e488f9ba2c984129090dc",
"namespaceType": "instance",
"region": "bj",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
],
"transfer": ""
},
{
"bcmService": "BCE_BCC",
"filter": "",
"instanceName": "instance-jm920sus",
"name": "i-totUNyuT___bj.BCE_BCC.453bf9588c9e488f9ba2c984129090dc",
"namespaceType": "instance",
"region": "bj",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
],
"transfer": ""
},
{
"bcmService": "BCE_BCC",
"filter": "",
"instanceName": "instance-mmd6nizg",
"name": "i-WAMdDHZ0___bj.BCE_BCC.453bf9588c9e488f9ba2c984129090dc",
"namespaceType": "instance",
"region": "bj",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
],
"transfer": ""
}
],
"product": "453bf9588c9e488f9ba2c984129090dc",
"region": "bj",
"resourceType": "Instance",
"scope": "BCE_BCC",
"scopeValue": {
"hasChildren": false,
"name": "BCC",
"value": "BCE_BCC"
},
"subService": "linux"
}
],
"time": "2022-03-17 15:12:44|2022-03-17 16:12:44"
}
响应示例
{
"result": {
"code": 200,
"data": [
{
"items": [
{
"statisticsValue": {
"avg": 99.99666666666667,
"cnt": 6,
"max": 100,
"min": 99.98,
"sum": 599.98
},
"timestamp": 1647501164
},
{
"statisticsValue": {
"avg": 99.9925,
"cnt": 4,
"max": 100,
"min": 99.98,
"sum": 399.97
},
"timestamp": 1647501464
},
{
"statisticsValue": {
"avg": 99.9875,
"cnt": 4,
"max": 100,
"min": 99.98,
"sum": 399.95
},
"timestamp": 1647501764
},
{
"statisticsValue": {
"avg": 99.992,
"cnt": 5,
"max": 100,
"min": 99.98,
"sum": 499.96000000000004
},
"timestamp": 1647502064
},
{
"statisticsValue": {
"avg": 99.992,
"cnt": 5,
"max": 100,
"min": 99.98,
"sum": 499.96000000000004
},
"timestamp": 1647502364
},
{
"statisticsValue": {
"avg": 99.99600000000001,
"cnt": 5,
"max": 100,
"min": 99.99,
"sum": 499.98
},
"timestamp": 1647502664
},
{
"statisticsValue": {
"avg": 99.99000000000001,
"cnt": 4,
"max": 100,
"min": 99.98,
"sum": 399.96000000000004
},
"timestamp": 1647502964
},
{
"statisticsValue": {
"avg": 99.99600000000001,
"cnt": 5,
"max": 100,
"min": 99.99,
"sum": 499.98
},
"timestamp": 1647503264
},
{
"statisticsValue": {
"avg": 99.99666666666667,
"cnt": 3,
"max": 100,
"min": 99.99,
"sum": 299.99
},
"timestamp": 1647503564
},
{
"statisticsValue": {
"avg": 99.99000000000001,
"cnt": 4,
"max": 100,
"min": 99.98,
"sum": 399.96000000000004
},
"timestamp": 1647503864
},
{
"statisticsValue": {
"avg": 99.995,
"cnt": 4,
"max": 100,
"min": 99.98,
"sum": 399.98
},
"timestamp": 1647504164
},
{
"statisticsValue": {
"avg": 99.99333333333334,
"cnt": 6,
"max": 100,
"min": 99.98,
"sum": 599.96
},
"timestamp": 1647504464
}
],
"job": {
"alias": "",
"bcmSource": false,
"contrast": "",
"decimals": null,
"displayName": "CPU使用率",
"endTime": 1647504764,
"flatten": false,
"instanceName": "instance-owtlv14o",
"items": [
{
"statisticsValue": {
"avg": 99.99666666666667,
"cnt": 6,
"max": 100,
"min": 99.98,
"sum": 599.98
},
"timestamp": 1647501164
},
{
"statisticsValue": {
"avg": 99.9925,
"cnt": 4,
"max": 100,
"min": 99.98,
"sum": 399.97
},
"timestamp": 1647501464
},
{
"statisticsValue": {
"avg": 99.9875,
"cnt": 4,
"max": 100,
"min": 99.98,
"sum": 399.95
},
"timestamp": 1647501764
},
{
"statisticsValue": {
"avg": 99.992,
"cnt": 5,
"max": 100,
"min": 99.98,
"sum": 499.96000000000004
},
"timestamp": 1647502064
},
{
"statisticsValue": {
"avg": 99.992,
"cnt": 5,
"max": 100,
"min": 99.98,
"sum": 499.96000000000004
},
"timestamp": 1647502364
},
{
"statisticsValue": {
"avg": 99.99600000000001,
"cnt": 5,
"max": 100,
"min": 99.99,
"sum": 499.98
},
"timestamp": 1647502664
},
{
"statisticsValue": {
"avg": 99.99000000000001,
"cnt": 4,
"max": 100,
"min": 99.98,
"sum": 399.96000000000004
},
"timestamp": 1647502964
},
{
"statisticsValue": {
"avg": 99.99600000000001,
"cnt": 5,
"max": 100,
"min": 99.99,
"sum": 499.98
},
"timestamp": 1647503264
},
{
"statisticsValue": {
"avg": 99.99666666666667,
"cnt": 3,
"max": 100,
"min": 99.99,
"sum": 299.99
},
"timestamp": 1647503564
},
{
"statisticsValue": {
"avg": 99.99000000000001,
"cnt": 4,
"max": 100,
"min": 99.98,
"sum": 399.96000000000004
},
"timestamp": 1647503864
},
{
"statisticsValue": {
"avg": 99.995,
"cnt": 4,
"max": 100,
"min": 99.98,
"sum": 399.98
},
"timestamp": 1647504164
},
{
"statisticsValue": {
"avg": 99.99333333333334,
"cnt": 6,
"max": 100,
"min": 99.98,
"sum": 599.96
},
"timestamp": 1647504464
}
],
"metricName": "thirdparty.bcm.vCPUUsagePercent",
"namespace": "i-kR3ovVIx___bj.BCE_BCC.453bf9588c9e488f9ba2c984129090dc",
"offset": 0,
"originalPeriod": 60,
"period": 300,
"product": "453bf9588c9e488f9ba2c984129090dc",
"startTime": 1647501164,
"statistics": "avg",
"tags": "",
"tagsForTsdb": [
],
"unit": "%"
},
"numeric": {
"avg": 99.9931388888889,
"cnt": 55,
"max": 100,
"min": 99.98,
"sum": 5499.63
}
},
{
"items": [
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647501164
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647501464
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647501764
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647502064
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647502364
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647502664
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647502964
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647503264
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647503564
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647503864
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647504164
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647504464
}
],
"job": {
"alias": "",
"bcmSource": false,
"contrast": "",
"decimals": null,
"displayName": "CPU使用率",
"endTime": 1647504764,
"flatten": false,
"instanceName": "instance-jm920sus",
"items": [
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647501164
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647501464
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647501764
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647502064
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647502364
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647502664
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647502964
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647503264
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647503564
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647503864
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647504164
},
{
"statisticsValue": {
"avg": null,
"cnt": null,
"max": null,
"min": null,
"sum": null
},
"timestamp": 1647504464
}
],
"metricName": "thirdparty.bcm.vCPUUsagePercent",
"namespace": "i-totUNyuT___bj.BCE_BCC.453bf9588c9e488f9ba2c984129090dc",
"offset": 0,
"originalPeriod": 60,
"period": 300,
"product": "453bf9588c9e488f9ba2c984129090dc",
"startTime": 1647501164,
"statistics": "avg",
"tags": "",
"tagsForTsdb": [
],
"unit": "%"
},
"numeric": {
"avg": 0,
"cnt": 0,
"max": 0,
"min": 0,
"sum": 0
}
},
{
"items": [
{
"statisticsValue": {
"avg": 99.994,
"cnt": 5,
"max": 100,
"min": 99.99,
"sum": 499.97
},
"timestamp": 1647501164
},
{
"statisticsValue": {
"avg": 100,
"cnt": 5,
"max": 100,
"min": 100,
"sum": 500
},
"timestamp": 1647501464
},
{
"statisticsValue": {
"avg": 99.994,
"cnt": 5,
"max": 100,
"min": 99.98,
"sum": 499.97
},
"timestamp": 1647501764
},
{
"statisticsValue": {
"avg": 99.994,
"cnt": 5,
"max": 100,
"min": 99.99,
"sum": 499.97
},
"timestamp": 1647502064
},
{
"statisticsValue": {
"avg": 99.995,
"cnt": 4,
"max": 100,
"min": 99.98,
"sum": 399.98
},
"timestamp": 1647502364
},
{
"statisticsValue": {
"avg": 99.994,
"cnt": 5,
"max": 100,
"min": 99.98,
"sum": 499.97
},
"timestamp": 1647502664
},
{
"statisticsValue": {
"avg": 99.998,
"cnt": 5,
"max": 100,
"min": 99.99,
"sum": 499.99
},
"timestamp": 1647502964
},
{
"statisticsValue": {
"avg": 99.99666666666667,
"cnt": 6,
"max": 100,
"min": 99.99,
"sum": 599.98
},
"timestamp": 1647503264
},
{
"statisticsValue": {
"avg": 99.994,
"cnt": 5,
"max": 100,
"min": 99.99,
"sum": 499.97
},
"timestamp": 1647503564
},
{
"statisticsValue": {
"avg": 99.998,
"cnt": 5,
"max": 100,
"min": 99.99,
"sum": 499.99
},
"timestamp": 1647503864
},
{
"statisticsValue": {
"avg": 99.994,
"cnt": 5,
"max": 100,
"min": 99.99,
"sum": 499.97
},
"timestamp": 1647504164
},
{
"statisticsValue": {
"avg": 99.998,
"cnt": 5,
"max": 100,
"min": 99.99,
"sum": 499.99
},
"timestamp": 1647504464
}
],
"job": {
"alias": "",
"bcmSource": false,
"contrast": "",
"decimals": null,
"displayName": "CPU使用率",
"endTime": 1647504764,
"flatten": false,
"instanceName": "instance-mmd6nizg",
"items": [
{
"statisticsValue": {
"avg": 99.994,
"cnt": 5,
"max": 100,
"min": 99.99,
"sum": 499.97
},
"timestamp": 1647501164
},
{
"statisticsValue": {
"avg": 100,
"cnt": 5,
"max": 100,
"min": 100,
"sum": 500
},
"timestamp": 1647501464
},
{
"statisticsValue": {
"avg": 99.994,
"cnt": 5,
"max": 100,
"min": 99.98,
"sum": 499.97
},
"timestamp": 1647501764
},
{
"statisticsValue": {
"avg": 99.994,
"cnt": 5,
"max": 100,
"min": 99.99,
"sum": 499.97
},
"timestamp": 1647502064
},
{
"statisticsValue": {
"avg": 99.995,
"cnt": 4,
"max": 100,
"min": 99.98,
"sum": 399.98
},
"timestamp": 1647502364
},
{
"statisticsValue": {
"avg": 99.994,
"cnt": 5,
"max": 100,
"min": 99.98,
"sum": 499.97
},
"timestamp": 1647502664
},
{
"statisticsValue": {
"avg": 99.998,
"cnt": 5,
"max": 100,
"min": 99.99,
"sum": 499.99
},
"timestamp": 1647502964
},
{
"statisticsValue": {
"avg": 99.99666666666667,
"cnt": 6,
"max": 100,
"min": 99.99,
"sum": 599.98
},
"timestamp": 1647503264
},
{
"statisticsValue": {
"avg": 99.994,
"cnt": 5,
"max": 100,
"min": 99.99,
"sum": 499.97
},
"timestamp": 1647503564
},
{
"statisticsValue": {
"avg": 99.998,
"cnt": 5,
"max": 100,
"min": 99.99,
"sum": 499.99
},
"timestamp": 1647503864
},
{
"statisticsValue": {
"avg": 99.994,
"cnt": 5,
"max": 100,
"min": 99.99,
"sum": 499.97
},
"timestamp": 1647504164
},
{
"statisticsValue": {
"avg": 99.998,
"cnt": 5,
"max": 100,
"min": 99.99,
"sum": 499.99
},
"timestamp": 1647504464
}
],
"metricName": "thirdparty.bcm.vCPUUsagePercent",
"namespace": "i-WAMdDHZ0___bj.BCE_BCC.453bf9588c9e488f9ba2c984129090dc",
"offset": 0,
"originalPeriod": 60,
"period": 300,
"product": "453bf9588c9e488f9ba2c984129090dc",
"startTime": 1647501164,
"statistics": "avg",
"tags": "",
"tagsForTsdb": [
],
"unit": "%"
},
"numeric": {
"avg": 99.99580555555558,
"cnt": 60,
"max": 100,
"min": 99.98,
"sum": 5999.75
}
}
],
"message": "ok",
"success": true,
"traceInfo": null
},
"success": true
}
各个图表的区别
组件 | 监控对象-实例 | 监控项 | 其他限制 |
---|---|---|---|
仪表图 | 单选 | 单选 | 只能选择一组数据 |
表格 | 多选 | 单选 | 监控对象50项目,监控项20项;但必须是同一云产品且监控项单位需一致 |
趋势图 | 多选 | 单选 | 支持选择50组数据;监控项单位需保持一致 |
面板 | 单选 | 单选 | 最多选择20组数据;但监控项单位需一致 |
请求体字段的说明:
Configure字段解释说明:
名称 | 类型 | 说明 |
---|---|---|
meric | List |
指标信息 |
monitorObject | List |
实例信息 |
namespace | List |
实例信息 |
product | String | 用户id |
region | String | 地域 |
resourceType | String | 实例类型 |
scopeValue | List |
云产品信息 |
subService | String | 操作系统类型 |
time | String | 时间范围 |
MetricConfiguration解释说明:
名称 | 类型 | 说明 |
---|---|---|
name | String | 指标英文名 |
unit | String | 单位名称 |
alias | String | 指标中文名 |
contrast | List |
可为空 |
timeContrast | List |
可为空 |
statistics | String | 数据的统计方式 |
dimensions | List |
维度信息 |
metricDimensions | List |
维度名称具体维度 |
namespace解释说明:
名称 | 类型 | 说明 |
---|---|---|
namespaceType | String | 实例类型 |
transfer | String | 可为空 |
filter | String | 可为空 |
name | String | 由短id,region,scope和用户id拼接 |
instanceName | String | 实例名称 |
region | String | 地域 |
bcmService | String | 云产品名称 |
subService | List |
云服务类型和操作系统类型 |
monitorObject解释说明:
名称 | 类型 | 描述 |
---|---|---|
id | String | 实例id |
instanceName | String | 实例名称 |
scopeValue解释说明:
名称 | 类型 | 说明 |
---|---|---|
name | String | 云产品名称 |
value | String | 云产品名称 |
hasChildren | String | 是否具有子类型 |
DimensionConfiguration解释说明:
名称 | 类型 | 说明 |
---|---|---|
name | String | 维度名称 |
values | List |
具体维度 |
查询维度接口:
请求结构体:
Method:Get
Url:/csm/api/v1/userId/{userId}/services/{service}/region/{region}/metric/dimensions
请求参数:
名称 | 类型 | 描述 | 是否必须 | 位置 |
---|---|---|---|---|
product | String | 用户id | 是 | Query参数 |
service | String | 云产品名称 | 是 | Query参数 |
region | String | 地域 | 是 | Query参数 |
showId | String | 实例长id | 是 | Query参数 |
dimensions | String | 维度名称 | 否 | Query参数 |
metricName | String | 指标名称 | 是 | Query参数 |
请求示例:
Post /csm/api/v1/dashboard/products/a0d04d7c202140cb80155ff7b6752ce4/util/dimensionValues
?service=BCE_BEC&metricName=vNicInBytes&showId=66fdb896-03be-44cf-a2f6-673072a73700®ion=bj&dimensions=nicName&userId=a0d04d7c202140cb80155ff7b6752ce4&_=1647434549091
响应示例:
{
"result": {
"nicName": [
"eth1",
"eth0"
]
},
"success": true
}