MENU
      QueryWidgetDataPreview

        QueryWidgetDataPreview


        Article summary

        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:

        MethodURI
        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": **********
        }'
        Shell

        Response

        This section describes the response format.

        Response body

        The response body includes the following data:

        FieldTypeRequiredDescription
        colorString-Chart color
        dataArray-Query result
        • Display in the data point (Unix timestamp format) and data value format
        dimensionsObject-Dimension information
        dimensions.instanceNoString-Instance number
        dimensions.nameString-Dimension name
        dimensions.typeString-Dimension type
        displayNameString-Metric name displayed on the widget
        idDimensionString-Dimension name
        metricString-Metric name
        periodString-Aggregation interval
        • Min1 | Min5 | Min30 | Hour2 | Day1
        prodKeyString-Product key (cw_key)
        prodNameString-Product name
        resourceNameString-Resource name
        statisticString-Aggregation function
        • COUNT | SUM | MAX | MIN | AVG

        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"
            }
        ]
        JSON

        Was this article helpful?

        Changing your password will log you out immediately. Use the new password to log back in.
        First name must have atleast 2 characters. Numbers and special characters are not allowed.
        Last name must have atleast 1 characters. Numbers and special characters are not allowed.
        Enter a valid email
        Enter a valid password
        Your profile has been successfully updated.