- Print
- PDF
QueryWidgetDataPreview
- Print
- PDF
The latest service changes have not yet been reflected in this content. We will update the content as soon as possible. Please refer to the Korean version for information on the latest updates.
Available in Classic and VPC
Get a preview chart with metric data.
Request
This section describes the request format. The method and URI are as follows:
Method | URI |
---|---|
POST | /cw_fea/real/cw/api/data/chart/preview |
Request headers
For information about the headers common to all Cloud Insight APIs, see Cloud Insight request headers.
Request body
For more information on the fields related to the preview chart query using metric information, see ChartDataWidgetDto.
Request example
The request example is as follows:
curl --location -request POST 'https://cw.apigw.ntruss.com/cw_fea/real/cw/api/data/chart/preview' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
--header 'Content-Type: application/json' \
--data '{
"metricsInfo": [
{
"resourceId": "**********",
"resourceName": "**********",
"color": "#1f77b4",
"displayName": "avg_write_cnt",
"metric": "avg_write_cnt",
"period": "Min30",
"statistic": "COUNT",
"prodKey": "**********",
"productName": "System/Server(VPC)",
"dimensions": {
"type": "svr",
"instanceNo": "**********"
}
}
],
"periodStart": **********,
"periodEnd": **********
}'
Response
This section describes the response format.
Response body
The response body includes the following data:
Field | Type | Required | Description |
---|---|---|---|
color | String | - | Chart color |
data | Array | - | Query result
|
dimensions | Object | - | Dimension information |
dimensions.instanceNo | String | - | Instance number |
dimensions.name | String | - | Dimension name |
dimensions.type | String | - | Dimension type |
displayName | String | - | Metric name displayed on the widget |
idDimension | String | - | Dimension name |
metric | String | - | Metric name |
period | String | - | Aggregation interval
|
prodKey | String | - | Product key (cw_key) |
prodName | String | - | Product name |
resourceName | String | - | Resource name |
statistic | String | - | Aggregation function
|
Response status codes
For response status codes common to NAVER Cloud Platform, see Cloud Insight API response status codes.
Response example
The response example is as follows:
[
{
"color": "#1f77b4",
"data": [
[
1733184000000,
22
],
[
1733185800000,
30
],
[
1733187600000,
30
],
[
1733189400000,
30
],
[
1733191200000,
30
],
[
1733193000000,
30
],
[
1733194800000,
30
],
[
1733196600000,
30
],
[
1733198400000,
30
],
[
1733200200000,
30
],
[
1733202000000,
30
],
[
1733203800000,
30
]
],
"dimensions": {
"instanceNo": "**********",
"name": "**********",
"type": "svr"
},
"displayName": "avg_write_cnt",
"idDimension": "instanceNo",
"metric": "avg_write_cnt",
"period": "Min30",
"prodKey": "**********",
"prodName": "Server(VPC)",
"resourceName": "**********",
"statistic": "COUNT"
}
]