QueryDataMultiple
    • PDF

    QueryDataMultiple

    • PDF

    Article Summary

    概要

    Cloud Insightで収集した複数のtime-seriesデータをクエリします。

    リクエスト

    API URL

    URL: https://cw.apigw.ntruss.com/cw_fea/real/cw/api/data/query/multiple
    Method: POST
    

    リクエストヘッダ

    共通設定に明示されたリクエストヘッダが必要です。

    Content-Type: application/json
    x-ncp-apigw-signature-v2: {generated signature}
    x-ncp-apigw-timestamp: {current timestamp}
    x-ncp-iam-access-key: {your iam access key}
    

    リクエストボディ

    パラメータ名必須有無タイプ制約事項説明
    timeStartYLongMillisecond単位で入力照会開始時間
    timeEndYLongMillisecond単位で入力照会終了時間
    metricInfoListYList<DataQueryRequestMetricInfo>複数の照会条件を明示(metricInfoのarrayで定義できます。)
    {
        "metricInfoList": [
            {
                "prodKey": "string",
                "metric": "string",
                "interval": "string",
                "aggregation": "string",
                "queryAggregation": "string",
                "dimensions": {
                    "string": "string"
                }
            },
            {
                "prodKey": "string",
                "metric": "string",
                "interval": "string",
                "aggregation": "string",
                "queryAggregation": "string",
                "dimensions": {
                    "string": "string"
                }
            }
        ],
        "timeStart": "long",
        "timeEnd": "long"
    }
    

    参照:

    • aggregationの場合、Databaseに書き込む前、データストリームがシステムに取り込まれる際に実行される集計関数を意味します。

    • 一致しないとユーザーはデータを取得できないため、スキーマ登録時に構成した集計関数(aggregation)とデータのクエリリクエストの集計を一致させてください。

    • データ集計周期(interval)による推奨照会期間(timeEnd - timeStart)が異なります。 詳しい内容は、データ集計周期による推奨照会期間を参考にしてください。

    リクエスト例

    以下は、「System/Server(VPC) (cw_key : 460438474722512896)」商品でinstanceNo(Dimension)が「123456」であるサーバのavg_cpu_used_rto(Metric)と、instanceNo(Dimension)が「345678」であるサーバのavg_read_byt_cnt(Metric)値を照会する例です。

    POST /cw_fea/real/cw/api/data/query/multiple
    Host: cw.apigw.ntruss.com
    Content-Type: application/json
    x-ncp-apigw-signature-v2: {generated signature}
    x-ncp-apigw-timestamp: {current timestamp}
    x-ncp-iam-access-key: {your iam access key}
    
    Payload:
    
    {
      "metricInfoList": [
        {
          "aggregation": "AVG",
          "dimensions": {
            "instanceNo": "123456"
          },
          "interval": "Min30",
          "metric": "avg_cpu_used_rto",
          "prodKey": "460438474722512896",
        },
        {
          "aggregation": "AVG",
          "dimensions": {
            "instanceNo": "345678"
          },
          "interval": "Min30",
          "metric": "avg_read_byt_cnt",
          "prodKey": "460438474722512896"
        }
      ],
      "timeEnd": 1587974615395,
      "timeStart": 1587963815395
    }
    

    レスポンス例

    エラーなしにデータを照会した場合、結果がJSON配列でリターンされます。

    [
      {
        "aggregation": "AVG",
        "dimensions": {
          "instanceNo": "123456"
        },
        "dps": [
          [
            1588746600000,
            1.9561905
          ],
          [
            1588748400000,
            1.9634359
          ],
          [
            1588750200000,
            1.9742627
          ],
          [
            1588752000000,
            1.9790177
          ],
          [
            1588753800000,
            1.9686635
          ]
        ],
        "interval": "Min30",
        "metric": "avg_cpu_used_rto",
        "productName": "Server(VPC)"
      },
      {
        "aggregation": "AVG",
        "dimensions": {
          "instanceNo": "345678"
        },
        "dps": [
          [
            1588746600000,
            529.06647
          ],
          [
            1588748400000,
            529.06647
          ],
          [
            1588750200000,
            529.06647
          ],
          [
            1588752000000,
            529.06647
          ],
          [
            1588753800000,
            529.06647
          ]
        ],
        "interval": "Min30",
        "metric": "avg_read_byt_cnt",
        "productName": "Server(VPC)"
      }
    ]
    

    この記事は役に立ちましたか?

    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.