UpdateProductSchema
- Print
- PDF
UpdateProductSchema
- Print
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Summary
This API updates a user-defined schema.
Request
API URL
URL: https://cw.apigw.ntruss.com/cw_fea/real/cw/api/schema
Method: PUT
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 | |
cw_key | Y | String | Product's cw_key | |
fields | Y | List<FieldDto> | Schema definition (defined in a field array) of a product |
Example
Request example
PUT /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",
"cw_key":"xxxxxxxxxxxxxxxxxx",
"fields": [
{
"dataType": "STRING",
"name": "dimensionName",
"dimension": true,
"metric": false,
"counter": false,
"idDimension": true|false,
"defaultMetric": false,
"desc": "description"
},
{
"dataType": "STRING|INTEGER|FLOAT|LONG",
"name": "metricName",
"dimension": false,
"metric": true,
"counter": false,
"defaultMetric": true|false,
"desc": "description",
"aggregations": {
"Min30": [
"AVG",
"SUM",
"MIN",
"MAX",
"COUNT"
],
"Hour2": [
"AVG",
"SUM",
"MIN",
"MAX",
"COUNT"
],
"Min2": [
"AVG",
"SUM",
"MIN",
"MAX",
"COUNT"
],
"Day1": [
"AVG",
"SUM",
"MIN",
"MAX",
"COUNT"
],
"Min5": [
"AVG",
"SUM",
"MIN",
"MAX",
"COUNT"
],
"Min1": [
"AVG",
"SUM",
"MIN",
"MAX",
"COUNT"
]
}
}
]
}
Note: The difference between a schema registration and an update request is that the update requires the cw_key of the registered schema. An error is reported if the specified product is not found when updating a schema.
Response example
The API returns HTTP code 200 as well as the response in simple JSON format if the update is completed without any errors.
{
"msg": "ok"
}
Was this article helpful?