CreateMetricsGrp
- Print
- PDF
CreateMetricsGrp
- Print
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Summary
This API creates a monitored item group (template).
Request
API URL
URL: https://cw.apigw.ntruss.com/cw_fea/real/cw/api/rule/group/metrics
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
Example
Request example
The code below shows an example of creating a monitored item group (template) to generate an event if the item "avg_cpu_used_rto" with a value of 1.5 or higher lasts for 1 minute, and the item "avg_write_cnt" with a value of 0.7 or higher lasts for 1 minute, in the product with cw_key "xxxxxxxxxxxxxxxxxx".
POST /cw_fea/real/cw/api/rule/group/metrics
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:
{
"groupDesc": "The metric group (template) related to the server usage.",
"groupName": "Server usage",
"metricsGroupItems": [
{
"calculation": "AVG",
"condition": "GT",
"dimensions": [
{
"dim": "type",
"val": "svr"
}
],
"duration": 1,
"eventLevel": "INFO",
"metric": "avg_cpu_used_rto",
"threshold": 1
},
{
"calculation": "AVG",
"condition": "GT",
"dimensions": [
{
"dim": "type",
"val": "svr"
}
],
"duration": 1,
"eventLevel": "INFO",
"metric": "avg_write_cnt",
"threshold": 0.7
}
],
"prodKey": "xxxxxxxxxxxxxxxxxx"
}
Response example
The API returns the ID of the created monitored item group (template) if creation is completed without any errors.
"xxxxxxxxxxxxxxxxxx"
Was this article helpful?