- Print
- PDF
RegisterProductSchema
- Print
- PDF
Summary
This API registers a user-defined schema in Cloud Insight.
Request
API URL
URL: https://cw.apigw.ntruss.com/cw_fea/real/cw/api/schema
Method: POST
Request header
The request headers specified in common settings are required.
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}
Request Body
Parameter Name | Requirement status | Type | Restrictions | Description |
---|---|---|---|---|
prodName | Y | String | Product name | |
fields | Y | List<FieldDto> | Schema definition of the product |
Example
Request example
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|false,
"desc": "description"
},
{
"dataType": "STRING|INTEGER|FLOAT|LONG",
"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"
]
}
}
]
}
Reference:
The default value of the dimension and metric fields is false, and the API may ignore parameters that have a value of false.
For metric fields, the aggregation is designated at each interval. If
aggregation
is not in the field element, then the aggregation method is automatically designated for each interval.mbrNo
is a reserved word and can't be used as a dimension name.
Response example
The API returns HTTP code 200, as well as a simple response including the product key (cw_key) in JSON format, when registration is completed without any errors. The product key is needed to update or delete a schema and is used for transmitting or querying data.
{
"cw_key": "xxxxxxxxxxxxxxxxxx"
}