QueryData
    • PDF

    QueryData

    • PDF

    Article Summary

    개요

    Cloud Insight에서 수집한 time-series 데이터를 쿼리합니다.

    요청

    API URL

    URL: https://cw.apigw.ntruss.com/cw_fea/real/cw/api/data/query
    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}
    

    요청 바디

    DataQueryRequest

    {
      "timeStart": "long",
      "timeEnd": "long",
      "cw_key": "string",
      "productName": "string",
      "metric": "string",
      "interval": "string",
      "aggregation": "string",  
      "queryAggregation": "string",
      "dimensions": {
          "string": "string",
          "string": "string"
      }
    }
    

    참조:

    • aggregation의 경우 Database에 쓰기 전 데이터 스트림이 시스템에 들어올 때 수행되는 집계 함수를 의미합니다.

    • 일치하지 않으면 사용자가 데이터를 가져올 수 없으므로 스키마 등록시에 구성한 집계 함수(aggregation)와 데이터 쿼리 요청의 집계를 일치 시키시기 바랍니다.

    • 데이터 집계 주기(interval)에 따른 권장 조회 기간(timeEnd - timeStart)이 상이합니다. 자세한 내용은 데이터 집계 주기에 따른 권장 조회 기간을 참고해 주세요.

    예시

    요청 예시

    아래는 "System/Server" 상품에서 instanceNo(Dimension)가 "123456"인 서버의 all_byt_cnt(Metric) 값을 조회하는 예시입니다.

    POST /cw_fea/real/cw/api/data/query
    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:
    
    {
      "timeEnd": 1565056980000, 
      "timeStart": 1565020800000,
      "cw_key": "xxxxxxxxxxxxxxxxxx",
      "productName":"System/Server",
      "metric": "all_byt_cnt",
      "interval": "Min1",
      "aggregation": "AVG",
      "dimensions": {
        "instanceNo": "123456"
      }
    }
    

    응답 예시

    응답은 JSON 배열로, 내부 배열이 있고 내부 배열의 첫 번째 값은 데이터 포인트의 timestamp이고 두 번째 것은 값입니다.

    [
      [
        1553734800000,
        11.5
      ],
      [
        1553734860000,
        9.583333015441895
      ],
      [
        1553734920000,
        11.5
      ]
    ]
    

    이 문서가 도움이 되었습니까?

    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.