Dashboard API
Dashboard API
Create Dashboard
Request structure
Method:POST
Url:/csm/api/v1/dashboard/products/{product}/dashboards
Request parameters:
| Name | Types | Description | Required or not | Parameter location |
|---|---|---|---|---|
| product | String | User ID | Yes | URL parameter |
| paramMap | DataConfiguration | Yes | RequestBody |
[DataConfiguration Field Description: ](#DataConfiguration Field Description:)
Request example:
POST /csm/api/v1/dashboard/products/453bf9588c9e488f9ba2c984129090dc/dashboards
{
"userId": "453bf9588c9e488f9ba2c984129090dc",
"title": "LupinsDashboard",
"configure": {
"tabs": [
{
"name": "",
"widgets": [
],
"namespace": [
],
"dimensions": [
],
"metric": [
]
}
]
},
"type": "common"
}Response example:
{
"success": true,
"data": {
"name": "_54387"
},
"message": "ok",
"traceInfo": null,
"code": 200
}Delete Dashboard
Request structure:
Method:Delete
Url:/csm/api/v1/dashboard/products/{product}/dashboards/{dashboardName}
Request parameters:
| Name | Types | Description | Required or not | Parameter location |
|---|---|---|---|---|
| product | String | User ID | Yes | URL parameter |
| dashboardName | String | Dashboard ID (not display name) | Yes | URL parameter |
Request example:
Delete /csm/api/v1/dashboard/products/453bf9588c9e488f9ba2c984129090dc/dashboards/_50971Response example:
{
"success": true,
"data": null,
"message": "ok",
"traceInfo": null,
"code": 200
}Modify Dashboard
Request structure:
Method:Put
Url:/csm/api/v1/dashboard/products/{product}/dashboards/{dashboardName}
Request parameters:
| Name | Types | Description | Required or not | Parameter location |
|---|---|---|---|---|
| product | String | User ID | Yes | URL parameter |
| dashboardName | String | Dashboard ID (not display name) | Yes | URL parameter |
Request example:
Put /csm/api/v1/dashboard/products/453bf9588c9e488f9ba2c984129090dc/dashboards/_51008
{
"title": "LupinsDashboardxx",
"dashboardName": "_51008",
"configure": {
"tabs": [
{
"dimensions": [
],
"metric": [
],
"name": "",
"namespace": [
],
"widgets": [
]
}
]
},
"userId": "453bf9588c9e488f9ba2c984129090dc"
}[Request Body Field Description](#DataConfiguration Field Description:)
Response example:
{
"success": true,
"data": "_54440",
"message": "ok",
"traceInfo": null,
"code": 200
}Query Dashboard:
Request structure:
Method:Get
Url:/csm/api/v1/dashboard/products/{product}/dashboards/{dashboardName}
Request parameters:
| Name | Types | Description | Required or not | Parameter location |
|---|---|---|---|---|
| product | String | User ID | Yes | URL parameter |
| dashboardName | String | Dashboard ID (not display name) | Yes | URL parameter |
Request example:
Get /csm/api/v1/dashboard/products/453bf9588c9e488f9ba2c984129090dc/dashboards/_51008Response example:
{
"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
}Copy Dashboard
Request structure:
Method:POST
Url: /csm/api/v1/dashboard/products/{product}/dashboards/{dashboardName}/duplicate
Request parameters:
| Name | Types | Description | Required or not | Location |
|---|---|---|---|---|
| product | String | User ID | Yes | URL parameter |
| dashboardName | String | Dashboard ID | Yes | URL parameter |
Request example:
Post /csm/api/v1/dashboard/products/453************************/dashboards/_51038/duplicate
{}Response example:
{
"success": true,
"data": "_54581",
"message": "ok",
"traceInfo": null,
"code": 200
}DataConfiguration Field Description:
| Name | Types | Description | Required or not |
|---|---|---|---|
| userId | String | User ID | Yes |
| title | String | Dashboard Name | Yes |
| configure | String | Dashboard Configuration Fields | Yes |
| type | String | Dashboard Type, | Yes |
Dashboard Configuration Field Description:
| Name | Explanation | Required or not |
|---|---|---|
| dimensions | Dimension Information | Yes, but empty |
| metric | Metric Information | Yes, but empty |
| name | Component ID | Yes, but empty |
| widgets | Component Collection | Yes, can be empty |
Component API:
Create Component
Request structure:
Method:Post
Url:/csm/api/v1/dashboard/products/{product}/dashboards/{dashboardName}/widgets
Request parameters:
| Name | Types | Description | Required or not | Location |
|---|---|---|---|---|
| product | String | User ID | Yes | URL parameter |
| dashboardName | String | Dashboard Name | Yes | URL parameter |
Request example:
Post /csm/api/v1/dashboard/products/453bf9588c9e488f9ba2c984129090dc/dashboards/_51008/widgets
{}Response example:
{
"success": true,
"data": "_54440_54598",
"message": "ok",
"traceInfo": null,
"code": 200
}Delete Component:
Request structure:
Method: Delete
Url:/csm/api/v1/dashboard/products/{product}/dashboards/{dashboardName}/widgets/{widgetName}
Request parameters:
| Name | Types | Description | Required or not | Location |
|---|---|---|---|---|
| product | String | User ID | Yes | URL parameter |
| dashboardName | String | Dashboard ID | Yes | URL parameter |
| widgetName | String | Component ID | Yes | URL parameter |
Request example:
Delete /csm/api/v1/dashboard/products/453bf9588c9e488f9ba2c984129090dc/dashboards/_51008/widgets/_51008_51010Response example:
{
"success": true,
"data": null
"message": "ok",
"traceInfo": null,
"code": 200
}Modify Component:
Request structure:
Method:Put
Url:/csm/api/v1/dashboard/products/{product}/dashboards/{dashboardName}/widgets/{widgetName}
Request parameters:
| Name | Types | Description | Required or not | Location |
|---|---|---|---|---|
| product | String | User ID | Yes | URL parameter |
| dashboardName | String | Dashboard ID | Yes | URL parameter |
| widgetName | String | Component ID | Yes | URL parameter |
| bodyParams | Map<String, Object> | Request body | Yes | requestBody |
Request example:
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 Usage Rate”,
"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"
}[Meaning of fields in the requestBody: ](#Meaning of Each Field in bodyParams:)
Response example:
{
"success": true,
"data": _51008_51011
"message": "ok",
"traceInfo": null,
"code": 200
}Find Component:
Request structure:
Method:Get
Url:/csm/api/v1/dashboard/products/{product}/dashboards/{dashboardName}/widgets/{widgetName}
Request parameters:
| Name | Types | Description | Required or not | Location |
|---|---|---|---|---|
| product | String | User ID | Yes | URL parameter |
| dashboardName | String | Dashboard ID | Yes | URL parameter |
| widgetName | String | Component ID | Yes | URL parameter |
Request example:
Get /csm/api/v1/dashboard/products/a0d04d7c202140cb80155ff7b6752ce4/dashboards/_50367/widgets/_50367_50368Response example:
{
"success": true,
"data": {
"id": 54434,
"pid": 54433,
"product": "453bf9588c9e488f9ba2c984129090dc",
"name": "_54433_54434",
"title": "bcc-test",
"configure": "{\"data\":[{\"metric\":[{\"alias\":\"CPU Usage Rate\",\"contrast\":[],\"name\":\"CPUUsagePercent\",\"statistics\":\"avg\",\"timeContrast\":[],\"unit\":\"%\"}],\"monitorObject\":[{\"id\":\"i-SyWlclXE\",\"instanceName\":\"instance-4q17zwof \"}],\"monitorType\":\"scope\",\"namespace\":[{\"bcmService\":\"BCE_BCC\",\"filter\":\"\",\"instanceName\":\"instance-4q17zwof \",\"name\":\"i-SyWlclXE___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\"}],\"monitorType\":\"scope\",\"style\":{\"decimals\":2,\"displayType\":\"line\",\"isEdit\":true,\"nullPointMode\":\"zero\",\"threshold\":0,\"unit\":\"%\"},\"time\":\"\",\"timeRange\":{\"number\":1,\"relative\":\"today()\",\"timeType\":\"dashboard\",\"unit\":\"minutes\"},\"title\":\"bcc-test\"}",
"lastUpdate": "2023-12-06T08:36:35.000+0000",
"updator": "root:dasdsad",
"type": "trend",
"overviewOrder": 0,
"isFavorite": false
},
"message": "ok",
"traceInfo": null,
"code": 200
}Copy Component:
Request structure:
Method:Post
Url:/csm/api/v1/dashboard/products/{product}/dashboards/{dashboardName}/widgets/{widgetName}/duplicate
Request parameters:
| Name | Types | Description | Required or not | Location |
|---|---|---|---|---|
| Product | String | User ID | Yes | URL parameter |
| dashboardName | String | Dashboard ID | Yes | URL parameter |
| widgetName | String | Component ID | Yes | URL parameter |
Request example:
Post /csm/api/v1/dashboard/products/a0d04d7c202140cb80155ff7b6752ce4/dashboards/_50367/widgets/_50367_50368/duplicate
{}Response example:
{
"success": true,
"data": _51008_51011
"message": "ok",
"traceInfo": null,
"code": 200
}Meaning of Each Field in bodyParams:
| Name | Types | Description |
|---|---|---|
| titile | String | Chart Name |
| type | String | Chart Type |
| configure | Object | Configuration information |
| dashboardName | String | Dashboard ID |
| widgetName | String | Component ID |
| userId | String | User ID |
Special Config Notes:
| Name | Types | Description |
|---|---|---|
| metric | Object | Stored metric information |
| monitorObject | List | Storage Instance Name and Short ID |
| monitorType | String | Monitor Object Type |
| scope | String | Cloud product name |
| subService | String | OS name |
| region | String | Region |
| scopeValue | Object | Storage Cloud Product Name and Whether it is a cloud product with subtypes |
| resourceType | String | Resource type |
| namespace | Object | Instance information |
| product | String | User ID |
| style | String | Curve Style |
| title | String | Chart Name |
| timeRange | Object | Storage Time Information |
Metric Explanation:
| Name | Types | Description |
|---|---|---|
| name | String | Metric name in English |
| unit | String | Unit Name |
| alias | String | Metric name in Chinese |
| contrast | List | |
| timeContrast | List | |
| statistics | String | Data Statistic Method |
scopeValue Explanation:
| Name | Types | Description |
|---|---|---|
| name | String | Cloud product name |
| value | String | Cloud product name |
| hasChildren | String | Whether it has a subtype |
Namespace Explanation:
| Name | Types | Description |
|---|---|---|
| namespaceType | String | Instance type |
| transfer | String | Can be empty |
| filter | String | Can be empty |
| name | String | Concatenated from short ID, region, scope, and user ID |
| instanceName | String | Instance name |
| region | String | Region |
| bcmService | String | Cloud product name |
| subService | List | OS type |
monitorObject Explanation
| Name | Types | Description |
|---|---|---|
| instanceName | String | Monitor Object name |
| id | String | Monitor Object ID |
Query Data API:
Query Table Data API:
Query Metric Single Dimension Data:
Request structure:
Method: Post
Url: /csm/api/v1/dashboard/metric/report
Request parameters:
| Name | Types | Description | Required or not | Location |
|---|---|---|---|---|
| paramMap | requestBody | Yes | Request body |
[Meaning of Configure and other fields in the request body: ](#Request Body Field Description:)
Request example:
Post /csm/api/v1/dashboard/metric/report
{
"data": [
{
"metric": [
{
"alias": "CPU Idle Rate",
"cycle": 30,
"displayName": "cpu",
"name": "CpuIdlePercent",
"statistics": "avg",
"unit": "%"
}
],
"monitorObject": [
{
"id": "i-isvkUW76",
"instanceName": "instance-xcy9049y "
}
],
"monitorType": "scope",
"namespace": [
{
"bcmService": "BCE_BCC",
"instanceName": "instance-xcy9049y ",
"name": "i-isvkUW76___bj.BCE_BCC.a0d04d7c202140cb80155ff7b6752ce4",
"namespaceType": "app",
"region": "bj",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
],
"transfer": ""
}
],
"product": "a0d04d7c202140cb80155ff7b6752ce4",
"region": "bj",
"scope": "BCE_BCC",
"scopeValue": {
"name": "BCC",
"value": "BCE_BCC"
},
"subService": "linux"
}
],
"time": "2023-12-08 09:10:59|2023-12-08 09:11:59"
}[Meaning of Fields in Request Body: ](#Request Body Field Description:)
Response example:
{
"success": true,
"data": [
{
"name": "namespace",
"alias": "instance-xcy9049y ",
"value": "i-isvkUW76___bj.BCE_BCC.a0d04d7c202140cb80155ff7b6752ce4",
"metrics": {
"cpu": 99.600074827175
},
"children": []
}
],
"message": "ok",
"traceInfo": null,
"code": 200
}Query Multi-Dimensional Metric Data:
Request structure:
Method: Post
Url: /csm/api/v1/dashboard/metric/report
Request parameters:
| Name | Types | Description | Required or not | Location |
|---|---|---|---|---|
| paramMap | requestBody | Yes | Request body |
[Meaning of Configure and other fields in the request body: ](#Request Body Field Description:)
Request example:
Post /csm/api/v1/dashboard/metric/report
{
"data": [
{
"region": "bj",
"subService": "linux",
"namespace": [
{
"namespaceType": "app",
"transfer": "",
"filter": "",
"name": "41b372b8-3acc-423c-a6b0-af5c69fd1c41___bj.BCE_BEC.a0d04d7c202140cb80155ff7b6752ce4",
"instanceName": "prod.nmp.nn.yd1 ",
"region": "bj",
"bcmService": "BCE_BEC",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
]
}
],
"product": "a0d04d7c202140cb80155ff7b6752ce4",
"monitorObject": [
{
"instanceName": "prod.nmp.nn.yd1",
"id": "41b372b8-3acc-423c-a6b0-af5c69fd1c41"
}
],
"scope": "BCE_BEC",
"scopeValue": {
"name": "BEC",
"value": "BCE_BEC",
"hasChildren": false
},
"metric": [
{
"displayName": "",
"name": "vNicInBytes",
"alias": "Network Interface Card Input Traffic”,
"unit": "Bytes",
"contrast": [
],
"timeContrast": [
],
"statistics": "avg",
"cycle": 60,
"dimensions": [
"eth1",
"eth0"
],
"metricDimensions": [
{
"name": "nicName",
"values": [
"eth1",
"eth0"
]
}
]
}
]
}
],
"time": "2023-12-08 09:10:59|2023-12-08 09:11:59"
}[Meaning of Fields in Request Body: ](#Request Body Field Description:)
Response example:
{
"success": true,
"data": [
{
"name": "namespace",
"alias": "prod.nmp.nn.yd1 ",
"value": "vm-qngdck2p-cn-nanning-cm-mqckb___bj.BCE_BEC.a0d04d7c202140cb80155ff7b6752ce4",
"metrics": {
"Network Interface Card Input Traffic/nicName:eth0": 280.3833333333
“Network API Card Input Traffic/nicName:eth1”: 48189.416666662495
},
"children": []
}
],
"message": "ok",
"traceInfo": null,
"code": 200
}Query Trend Chart Data API:
Request Single-Dimension Metric Data:
Request structure:
Method: Post
Url: /csm/api/v1/dashboard/metric/trend
Request parameters:
| Name | Types | Description | Required or not | Location |
|---|---|---|---|---|
| paramMap | requestBody | Yes | Request body |
[Meaning of Configure and other fields in the request body: ](#Request Body Field Description:)
Request example:
Post /csm/api/v1/dashboard/metric/trend
{
"data": [
{
"metric": [
{
"alias": "CPU Idle Rate",
"cycle": 30,
"displayName": "cpu",
"name": "CpuIdlePercent",
"statistics": "avg",
"unit": "%"
}
],
"monitorObject": [
{
"id": "i-isvkUW76",
"instanceName": "instance-xcy9049y "
}
],
"monitorType": "scope",
"namespace": [
{
"bcmService": "BCE_BCC",
"instanceName": "instance-xcy9049y ",
"name": "i-isvkUW76___bj.BCE_BCC.a0d04d7c202140cb80155ff7b6752ce4",
"namespaceType": "app",
"region": "bj",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
],
"transfer": ""
}
],
"product": "a0d04d7c202140cb80155ff7b6752ce4",
"region": "bj",
"scope": "BCE_BCC",
"scopeValue": {
"name": "BCC",
"value": "BCE_BCC"
},
"subService": "linux"
}
],
"time": "2023-12-08 09:10:59|2023-12-08 09:11:59"
}Response example:
{
"success": true,
"data": [
{
"product": null,
"data": [
[
1701997859000,
99.53344561470001
],
[
1701997919000,
99.66670403965
]
],
"legend": null,
"numerator": 1,
"denominator": 1,
"metricUnit": "%",
"metricType": "",
"metricUnitTransformation": "",
"scope": "ignore",
"metric": "cpu",
"name": "instance-xcy9049y ",
"transPolicy": "",
"time": null,
"dimensions": "",
"statistics": null,
"namespace": "i-isvkUW76___bj.BCE_BCC.a0d04d7c202140cb80155ff7b6752ce4",
"hostName": null,
"intranetIp": null
}
],
"message": "ok",
"traceInfo": null,
"code": 200
}Query Multi-Dimensional Metric Data:
Request structure:
Method: Post
Url: /csm/api/v1/dashboard/metric/trend
Request parameters:
| Name | Types | Description | Required or not | Location |
|---|---|---|---|---|
| paramMap | requestBody | Yes | Request body |
[Meaning of Configure and other fields in the request body: ](#Request Body Field Description:)
Request example:
{
"data": [
{
"region": "bj",
"subService": "linux",
"namespace": [
{
"namespaceType": "app",
"transfer": "",
"filter": "",
"name": "41b372b8-3acc-423c-a6b0-af5c69fd1c41___bj.BCE_BEC.a0d04d7c202140cb80155ff7b6752ce4",
"instanceName": "prod.nmp.nn.yd1 ",
"region": "bj",
"bcmService": "BCE_BEC",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
]
}
],
"product": "a0d04d7c202140cb80155ff7b6752ce4",
"monitorObject": [
{
"instanceName": "prod.nmp.nn.yd1",
"id": "41b372b8-3acc-423c-a6b0-af5c69fd1c41"
}
],
"scope": "BCE_BEC",
"scopeValue": {
"name": "BEC",
"value": "BCE_BEC",
"hasChildren": false
},
"metric": [
{
"displayName": "",
"name": "vNicInBytes",
"alias": "Network Interface Card Input Traffic”,
"unit": "Bytes",
"contrast": [
],
"timeContrast": [
],
"statistics": "avg",
"cycle": 60,
"dimensions": [
"eth1",
"eth0"
],
"metricDimensions": [
{
"name": "nicName",
"values": [
"eth1",
"eth0"
]
}
]
}
]
}
],
"time": "2023-12-08 09:10:59|2023-12-08 09:11:59"
}Response example:
{
"success": true,
"data": [
{
"product": null,
"data": [
[
1701997859000,
281.8333333333
],
[
1701997919000,
278.93333333329997
]
],
"legend": null,
"numerator": 1,
"denominator": 1,
"metricUnit": "Bytes",
"metricType": "",
"metricUnitTransformation": "",
"scope": "ignore",
“metric”: “Network API Card Input Traffic”,
"name": "prod.nmp.nn.yd1 ",
"transPolicy": "",
"time": null,
"dimensions": "nicName=eth0",
"statistics": null,
"namespace": "vm-qngdck2p-cn-nanning-cm-mqckb___bj.BCE_BEC.a0d04d7c202140cb80155ff7b6752ce4",
"hostName": null,
"intranetIp": null
},
{
"product": null,
"data": [
[
1701997859000,
48307.549999995
],
[
1701997919000,
48071.28333333
]
],
"legend": null,
"numerator": 1,
"denominator": 1,
"metricUnit": "Bytes",
"metricType": "",
"metricUnitTransformation": "",
"scope": "ignore",
“metric”: “Network API Card Input Traffic”,
"name": "prod.nmp.nn.yd1 ",
"transPolicy": "",
"time": null,
"dimensions": "nicName=eth1",
"statistics": null,
"namespace": "vm-qngdck2p-cn-nanning-cm-mqckb___bj.BCE_BEC.a0d04d7c202140cb80155ff7b6752ce4",
"hostName": null,
"intranetIp": null
}
],
"message": "ok",
"traceInfo": null,
"code": 200
}Query Dashboard Chart Data API:
Query Metric Single Dimension Data
Request structure:
Method: Post
Url: /csm/api/v1/dashboard/metric/gaugechart
Request parameters:
| Name | Types | Description | Required or not | Location |
|---|---|---|---|---|
| paramMap | requestBody | Yes | Request body |
[Meaning of Configure and other fields in the request body: ](#Request Body Field Description:)
Request example:
Post /csm/api/v1/dashboard/metric/gaugechart
{
"data": [
{
"metric": [
{
"alias": "CPU Idle Rate",
"cycle": 30,
"displayName": "cpu",
"name": "CpuIdlePercent",
"statistics": "avg",
"unit": "%"
}
],
"monitorObject": [
{
"id": "i-isvkUW76",
"instanceName": "instance-xcy9049y "
}
],
"monitorType": "scope",
"namespace": [
{
"bcmService": "BCE_BCC",
"instanceName": "instance-xcy9049y ",
"name": "i-isvkUW76___bj.BCE_BCC.a0d04d7c202140cb80155ff7b6752ce4",
"namespaceType": "app",
"region": "bj",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
],
"transfer": ""
}
],
"product": "a0d04d7c202140cb80155ff7b6752ce4",
"region": "bj",
"scope": "BCE_BCC",
"scopeValue": {
"name": "BCC",
"value": "BCE_BCC"
},
"subService": "linux"
}
],
"time": "2023-12-08 09:10:59|2023-12-08 09:11:59"
}[Meaning of Fields in Request Body: ](#Request Body Field Description:)
Response example:
{
"success": true,
"data": [
{
“name”: "CPU Idle Rate”,
"data": [
[
0,
99.600074827175
]
],
“displayName”: “CPU Idle Rate",
"instanceName": "instance-xcy9049y ",
"unit": "%",
"metricDimension": null,
"decimals": null
}
],
"message": "ok",
"traceInfo": null,
"code": 200
}Query Metric Multi-Dimension Data
Request structure
Method: Post
Url: /csm/api/v1/dashboard/metric/gaugechart
Request parameters
| Name | Types | Description | Required or not | Location |
|---|---|---|---|---|
| paramMap | requestBody | Yes | Request body |
[Meaning of Configure and other fields in the request body: ](#Request Body Field Description:)
Request example
Post /csm/api/v1/dashboard/metric/gaugechart
{
"data": [
{
"region": "bj",
"subService": "linux",
"namespace": [
{
"namespaceType": "app",
"transfer": "",
"filter": "",
"name": "41b372b8-3acc-423c-a6b0-af5c69fd1c41___bj.BCE_BEC.a0d04d7c202140cb80155ff7b6752ce4",
"instanceName": "prod.nmp.nn.yd1 ",
"region": "bj",
"bcmService": "BCE_BEC",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
]
}
],
"product": "a0d04d7c202140cb80155ff7b6752ce4",
"monitorObject": [
{
"instanceName": "prod.nmp.nn.yd1",
"id": "41b372b8-3acc-423c-a6b0-af5c69fd1c41"
}
],
"scope": "BCE_BEC",
"scopeValue": {
"name": "BEC",
"value": "BCE_BEC",
"hasChildren": false
},
"metric": [
{
"displayName": "",
"name": "vNicInBytes",
"alias": "Network Interface Card Input Traffic”,
"unit": "Bytes",
"contrast": [
],
"timeContrast": [
],
"statistics": "avg",
"cycle": 60,
"dimensions": [
"eth1",
"eth0"
],
"metricDimensions": [
{
"name": "nicName",
"values": [
"eth1",
"eth0"
]
}
]
}
]
}
],
"time": "2023-12-08 09:10:59|2023-12-08 09:11:59"
}[Meaning of Fields in Request Body: ](#Request Body Field Description:)
Response example
{
"success": true,
"data": [
{
"name": "Network API Card Input Traffic”,
"data": [
[
0,
280.3833333333
]
],
“displayName": "Network API Card Input Traffic”,
"instanceName": "prod.nmp.nn.yd1 ",
"unit": "Bytes",
"metricDimension": "nicName:eth0",
"decimals": null
},
{
"name": "Network API Card Input Traffic”,
"data": [
[
0,
48189.416666662495
]
],
“displayName": "Network API Card Input Traffic”,
"instanceName": "prod.nmp.nn.yd1 ",
"unit": "Bytes",
"metricDimension": "nicName:eth1",
"decimals": null
}
],
"message": "ok",
"traceInfo": null,
"code": 200
}Query Dashboard Data API:
Query Metric Single Dimension Data
Request structure:
Method: Post
Url: /csm/api/v1/dashboard/metric/billboard
Request parameters:
| Name | Types | Description | Required or not | Location |
|---|---|---|---|---|
| paramMap | requestBody | Yes | Request body |
[Meaning of Configure and other fields in the request body: ](#Request Body Field Description:)
Request example:
Post /csm/api/v1/dashboard/metric/billboard
{
"data": [
{
"metric": [
{
"alias": "CPU Idle Rate",
"cycle": 30,
"displayName": "cpu",
"name": "CpuIdlePercent",
"statistics": "avg",
"unit": "%"
}
],
"monitorObject": [
{
"id": "i-isvkUW76",
"instanceName": "instance-xcy9049y "
}
],
"monitorType": "scope",
"namespace": [
{
"bcmService": "BCE_BCC",
"instanceName": "instance-xcy9049y ",
"name": "i-isvkUW76___bj.BCE_BCC.a0d04d7c202140cb80155ff7b6752ce4",
"namespaceType": "app",
"region": "bj",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
],
"transfer": ""
}
],
"product": "a0d04d7c202140cb80155ff7b6752ce4",
"region": "bj",
"scope": "BCE_BCC",
"scopeValue": {
"name": "BCC",
"value": "BCE_BCC"
},
"subService": "linux"
}
],
"time": "2023-12-08 09:10:59|2023-12-08 09:11:59"
}[Meaning of Fields in Request Body: ](#Request Body Field Description:)
Response example:
{
"success": true,
"data": [
{
“name”: "CPU Idle Rate”,
"data": [
[
0,
99.600074827175
]
],
“displayName”: “CPU Idle Rate",
"instanceName": "instance-xcy9049y ",
"unit": "%",
"metricDimension": null,
"decimals": null
}
],
"message": "ok",
"traceInfo": null,
"code": 200
}Query Metric Multi-Dimension Data
Request structure:
Method: Post
Url: /csm/api/v1/dashboard/metric/billboard
Request parameters:
| Name | Types | Description | Required or not | Location |
|---|---|---|---|---|
| paramMap | requestBody | Yes | Request body |
[Meaning of Configure and other fields in the request body: ](#Request Body Field Description:)
Request example:
Post /csm/api/v1/dashboard/metric/billboard
{
"data": [
{
"region": "bj",
"subService": "linux",
"namespace": [
{
"namespaceType": "app",
"transfer": "",
"filter": "",
"name": "41b372b8-3acc-423c-a6b0-af5c69fd1c41___bj.BCE_BEC.a0d04d7c202140cb80155ff7b6752ce4",
"instanceName": "prod.nmp.nn.yd1 ",
"region": "bj",
"bcmService": "BCE_BEC",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
]
}
],
"product": "a0d04d7c202140cb80155ff7b6752ce4",
"monitorObject": [
{
"instanceName": "prod.nmp.nn.yd1",
"id": "41b372b8-3acc-423c-a6b0-af5c69fd1c41"
}
],
"scope": "BCE_BEC",
"scopeValue": {
"name": "BEC",
"value": "BCE_BEC",
"hasChildren": false
},
"metric": [
{
"displayName": "",
"name": "vNicInBytes",
"alias": "Network Interface Card Input Traffic”,
"unit": "Bytes",
"contrast": [
],
"timeContrast": [
],
"statistics": "avg",
"cycle": 60,
"dimensions": [
"eth1",
"eth0"
],
"metricDimensions": [
{
"name": "nicName",
"values": [
"eth1",
"eth0"
]
}
]
}
]
}
],
"time": "2023-12-08 09:10:59|2023-12-08 09:11:59"
}[Meaning of Fields in Request Body: ](#Request Body Field Description:)
Response example:
{
"success": true,
"data": [
{
"name": "Network API Card Input Traffic”,
"data": [
[
0,
280.3833333333
]
],
“displayName": "Network API Card Input Traffic”,
"instanceName": "prod.nmp.nn.yd1 ",
"unit": "Bytes",
"metricDimension": "nicName:eth0",
"decimals": null
},
{
"name": "Network API Card Input Traffic”,
"data": [
[
0,
48189.416666662495
]
],
“displayName": "Network API Card Input Traffic”,
"instanceName": "prod.nmp.nn.yd1 ",
"unit": "Bytes",
"metricDimension": "nicName:eth1",
"decimals": null
}
],
"message": "ok",
"traceInfo": null,
"code": 200
}Advanced Capability Data of Query Charts
Advanced features include displaying the average, maximum, minimum, and sum values at a specific time point, with charts such as trend charts, dashboard charts, and data panels supported.
Request structure
Method:Post
Url:/csm/api/v1/dashboard/metric/trend/senior
Request parameters
| Name | Types | Description | Required or not | Location |
|---|---|---|---|---|
| paramMap | requestBody | Yes | Request body |
[Meaning of Configure and other fields in the request body: ](#Request Body Field Description:)
Request example
Post /csm/api/v1/dashboard/metric/trend/senior
{
"data": [
{
"metric": [
{
"alias": "CPU Idle Rate",
"cycle": 30,
"displayName": "cpu",
"name": "CpuIdlePercent",
"statistics": "avg",
"unit": "%"
}
],
"monitorObject": [
{
"id": "i-isvkUW76",
"instanceName": "instance-xcy9049y "
}
],
"monitorType": "scope",
"namespace": [
{
"bcmService": "BCE_BCC",
"instanceName": "instance-xcy9049y ",
"name": "i-isvkUW76___bj.BCE_BCC.a0d04d7c202140cb80155ff7b6752ce4",
"namespaceType": "app",
"region": "bj",
"subService": [
{
"name": "serviceType",
"value": "linux"
}
],
"transfer": ""
}
],
"product": "a0d04d7c202140cb80155ff7b6752ce4",
"region": "bj",
"scope": "BCE_BCC",
"scopeValue": {
"name": "BCC",
"value": "BCE_BCC"
},
"subService": "linux"
}
],
"time": "2023-12-08 09:10:59|2023-12-08 09:11:59"
}Response example
{
"success": true,
"data": [
{
"job": {
"product": "a0***************************ce4",
"namespace": "i-isvkUW76___bj.BCE_BCC.a0***************************ce4",
"tags": "",
"alias": "",
"contrast": "",
"metricName": "thirdparty.bcm.CpuIdlePercent",
"startTime": 1701997859,
"endTime": 1701997919,
"period": 300,
"originalPeriod": 60,
"flatten": false,
"statistics": "avg",
"offset": 0,
"bcmSource": false,
"displayName": "cpu",
"instanceName": "instance-xcy9049y ",
"unit": "%",
"decimals": null,
"instanceId": null,
"intranetIp": null,
"items": [
{
"timestamp": 1701997859,
"statisticsValue": {
"cnt": 10,
"sum": 996.5503990165,
"min": 99.4168414293,
"max": 99.7165998665,
"avg": 99.65503990165
}
}
],
"tagsForTsdb": []
},
"numeric": {
"cnt": 10,
"sum": 996.5503990165,
"min": 99.4168414293,
"max": 99.7165998665,
"avg": 99.65503990165
},
"items": [
{
"timestamp": 1701997859,
"statisticsValue": {
"cnt": 10,
"sum": 996.5503990165,
"min": 99.4168414293,
"max": 99.7165998665,
"avg": 99.65503990165
}
}
]
}
],
"message": "ok",
"traceInfo": null,
"code": 200
}Differences Between Various Charts
| Component | Monitor Object-Instance | Metrics | Other Restrictions |
|---|---|---|---|
| Dashboard Chart | Single Selection | Single Selection | Only one set of data can be selected |
| Table | Multiple Selection | Single Selection | Monitor Object: 50 items, monitor items: 20 items; but must be the same cloud product and metric units must be consistent |
| Trend Chart | Multiple Selection | Single Selection | Supports selecting 50 sets of data; metric units must be consistent |
| Panel | Single Selection | Single Selection | Select up to 20 sets of data; but metric units must be consistent |
Request Body Field Description:
Config Field Explanation:
| Name | Types | Description |
|---|---|---|
| meric | Metric Information | |
| monitorObject | Instance information | |
| namespace | Instance information | |
| product | String | User ID |
| region | String | Region |
| resourceType | String | Instance type |
| scopeValue | Cloud Product Information | |
| subService | String | OS type |
| time | String | Time Range |
MetricConfiguration Explanation:
| Name | Types | Description |
|---|---|---|
| name | String | Metric name in English |
| unit | String | Unit Name |
| alias | String | Metric name in Chinese |
| contrast | Can be empty | |
| timeContrast | Can be empty | |
| statistics | String | Data Statistic Method |
| dimensions | Dimension Information | |
| metricDimensions | Dimension Name and Specific Dimension |
Namespace Explanation:
| Name | Types | Description |
|---|---|---|
| namespaceType | String | Instance type |
| transfer | String | Can be empty |
| filter | String | Can be empty |
| name | String | Concatenated from short ID, region, scope, and user ID |
| instanceName | String | Instance name |
| region | String | Region |
| bcmService | String | Cloud product name |
| subService | Cloud Service Type and OS Type |
monitorObject Explanation:
| Name | Types | Description |
|---|---|---|
| id | String | Instance ID |
| instanceName | String | Instance name |
scopeValue Explanation:
| Name | Types | Description |
|---|---|---|
| name | String | Cloud product name |
| value | String | Cloud product name |
| hasChildren | String | Whether it has a subtype |
DimensionConfiguration Explanation:
| Name | Types | Description |
|---|---|---|
| name | String | Dimension name |
| values | Specific Dimension |
Query Dimension API:
Request structure:
Method:Get
Url:/csm/api/v1/userId/{userId}/services/{service}/region/{region}/metric/dimensions
Request parameters:
| Name | Types | Description | Required or not | Location |
|---|---|---|---|---|
| product | String | User ID | Yes | Query |
| service | String | Cloud product name | Yes | Query |
| region | String | Region | Yes | Query |
| showId | String | Long instance ID | Yes | Query |
| dimensions | String | Dimension name | No | Query |
| metricName | String | Metric name | Yes | Query |
Request example:
GET-/csm/api/v1/userId/a0***************************ce4/services/BCE_BEC/region/bj/metric/dimensions?dimensions=nicName&metricName=vNicInBytes®ion=bj&service=BCE_BEC&showId=7744b3***********************11534ff&userId=a0***************************ce4&_=1702523903201Response example:
{
"nicName": [
"eth1",
"eth0"
]
}