Platform O&M/Cloud Monitoring/Monitoring and Alarm/SNS/ZWatch Operations/Alarm Operations
POSTAlarm OperationsSince 2.3SynchronousAuth Required
CreateAlarm
CreateAlarm
Execution Availability
Try It Out
Submit a mock request using the current auth context and example-driven inputs.
Request Inputs
Body Fields
paramsObjectRequiredRequest body parameter object.
nameStringRequiredThe resource name.
descriptionStringOptional. The detailed description of the resource.
comparisonOperatorStringRequiredThe threshold comparison operator.
periodIntegerThe threshold duration.
namespaceStringRequiredThe namespace.
metricNameStringRequiredThe metric name.
thresholdDoubleRequiredThe threshold.
repeatIntervalIntegerOptional. The alarm repeat interval.
labelsListOptional. The label list.
actionsListOptional. The alarm action list.
resourceUuidStringOptional.
repeatCountIntegerOptional. The alarm repeat count.
typeStringOptional. The alarm type.
enableRecoveryBooleanRequiredWhether to enable the recovery notification.
emergencyLevelStringOptional. The alarm emergency level.
systemTagsListOptional. The system tags.
userTagsListOptional. The user tags.
Responses
Endpoint
POST/zstack/v1/zwatch/alarms
/zstack/v1/zwatch/alarms
Request Example
curl -X POST 'http://{host}/zstack/v1/zwatch/alarms' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"params":{"name":"<name>","description":"<description>","comparisonOperator":"<comparisonOperator>","period":1,"namespace":"<namespace>","metricName":"<metricName>","threshold":1,"repeatInterval":1,"labels":["<labels>"],"actions":["<actions>"],"resourceUuid":"<resourceUuid>","repeatCount":1,"type":"<type>","enableRecovery":true,"emergencyLevel":"<emergencyLevel>"},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'
Response Example
200{ "inventory": { "uuid": "6ff094db7e8b4640880751c5a17e7b63", "name": "VM CPU Alarm", "comparisonOperator": "LessThanOrEqualTo", "period": 60.0, "namespace": "ZStack/VM", "metricName": "org.zstack.zwatch.datatype.Metric@c2e79f0", "threshold": 30.0, "repeatInterval": 1800.0, "repeatCount": -1.0, "status": "Alarm", "state": "Enabled", "enableRecovery": true, "createDate": "Jul 6, 2018 1:51:02 PM", "lastOpDate": "Jul 6, 2018 1:51:02 PM", "labels": [ { "uuid": "cccd980c3bb84f4486d96a960eb08edb", "key": "VMUuid", "operator": "\u003d", "value": "f486fd81583747459d8a6cd47f9228e5" } ], "actions": [ { "alarmUuid": "8a6a98e3cc484388a746d725265886b3", "actionType": "sns", "actionUuid": "86a2b51fbc7f406c906711081852fa49" } ] } }Change History
This API has no change history records yet.
