CreateCustomSchema
    • PDF

    CreateCustomSchema

    • PDF

    Article Summary

    概要

    ユーザー定義スキーマを作成します。

    リクエスト

    API URL

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

    リクエストボディ

    パラメータ名必須の有無タイプ制約事項説明
    prodNameYesStringスキーマ名
    fieldsYesList商品のスキーマ定義
    useCustomResourceNoBooleandefault: falseCustom Resource使用の有無

    FieldDto

    構文

    private String name;
    private DataType dataType;
    private boolean metric = false;
    private boolean dimension = false;
    private Boolean counter = false;
    private boolean isIdDimension = false;
    private Map<Interval, Set<Calculation>> aggregations;
    private String desc;
    

    フィールド

    パラメータ名必須の有無タイプ制約事項説明
    nameYesStringProduct Schema名
    dataTypeYesDataType- 当該fieldがMetricである場合、STRING, INTEGER, FLOAT, LONG
    - 当該fieldがDimensionである場合、STRINGタイプが有効
    MetricまたはDimensionのデータタイプを明示
    metricNoBooleandefault : false当該FieldがMetricであることを明示
    dimensionNoBooleandefault : false当該FieldがDimensionであることを明示
    counterNoBooleandefault : false
    isIdDimensionNoBooleandefault:falseで、Dimensionのうち必ず一つはidDimensionに設定する必要あり- 当該fieldがDimensionである場合のみ設定可能
    - ユーザーが定義した商品に対してEvent Rule作成時に当該Dimensionを基準に区分される
    aggregationsNoMap<Interval, Set>- interval : Min1, Min5, Min30, Hour2, Day1
    - Calculation : COUNT,SUM,MAX,MIN,AVG
    - 当該fieldがMetricであるときにのみ設定可能
    - 集計周期と集計関数の設定
    descNoStringProduct Schemaの説明

    リクエスト例

    下記はcustom resourceを使用するMyProductというスキーマを作成する例です。

    POST /cw_fea/real/cw/api/schema
    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:
    
    {
      "prodName": "Custom/MyProduct",
      "fields": [
        {
          "dataType": "STRING",
          "name": "dimensionName",
          "dimension": true,
          "metric": false,
          "counter": false,
          "idDimension": true,
          "desc": "description"
        },
        {
          "dataType": "FLOAT",
          "name": "metricName",
          "dimension": false,
          "metric": true,
          "counter": false,
          "desc": "description",
          "aggregations": {
              "Min1": [
                "AVG",
                "SUM",
                "MIN",
                "MAX",
                "COUNT"
              ],
              "Min5": [
                "AVG",
                "SUM",
                "MIN",
                "MAX",
                "COUNT"
              ],
              "Min30": [
                "AVG",
                "SUM",
                "MIN",
                "MAX",
                "COUNT"
              ],
              "Hour2": [
                "AVG",
                "SUM",
                "MIN",
                "MAX",
                "COUNT"
              ],
              "Day1": [
                "AVG",
                "SUM",
                "MIN",
                "MAX",
                "COUNT"
              ]
          }
        }
      ],
      "useCustomResource": true
    }
    

    レスポンス例

    エラーなく照会が完了すると、HTTP code 200と商品キー(cw_key)を含む簡単なJSON形式のレスポンスが返されます。

    {
      "cw_key": "xxxxxxxxxxxxxxxxxx"
    }
    

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

    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.