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>1회 호출에 최대 20개의 조건을 조회 가능, 20개 초과 시 에러 리턴여러 조회 조건들을 명시 (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.