-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalarm-rules.http
68 lines (61 loc) · 1.78 KB
/
alarm-rules.http
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
### [Alarm rules] List alarm rules (read-only)
GET {{api-server}}/v2/alarm-rules?expansions=AlarmRule.assetInfo HTTP/1.1
X-Api-Key: {{read-only-token}}
### [Alarm rules] List alarm rules with filter parameters (read-only)
GET {{api-server}}/v2/alarm-rules?assetId=61894&alarmRuleIds=4621,4620&expansions=AlarmRule.assetInfo HTTP/1.1
X-Api-Key: {{read-only-token}}
### [Alarm rules] Create a new alarm rule with detailed parameters (read–write)
POST {{api-server}}/v2/alarm-rules HTTP/1.1
X-Api-Key: {{read-write-token}}
Content-Type: application/json
{
"assetId": 61894,
"subtype": "input",
"attribute": "temperature",
"enable": true,
"priority": 2,
"requiresAcknowledge": false,
"equal": 38.7,
"low": 38.0,
"high": 39.5,
"message": {
"come": {
"en": "Warning: Temperature out of range!"
},
"fallback": {
"en": "Please check the sensor."
}
},
"tags": ["critical", "sensor"],
"notifyOn": "R",
"dontMask": false
}
### [Alarm rules] Get an alarm rule by id with expansions (read-only)
GET {{api-server}}/v2/alarm-rules/4623?expansions=AlarmRule.assetInfo HTTP/1.1
X-Api-Key: {{read-only-token}}
### [Alarm rules] Update an alarm rule (read–write)
PUT {{api-server}}/v2/alarm-rules/4623 HTTP/1.1
X-Api-Key: {{read-write-token}}
Content-Type: application/json
{
"assetId": 61894,
"subtype": "input",
"attribute": "temperature",
"enable": true,
"priority": 1,
"requiresAcknowledge": true,
"equal": 39.0,
"low": 38.5,
"high": 40.0,
"message": {
"come": {
"en": "Critical: Temperature threshold exceeded"
}
},
"tags": ["critical", "update"],
"notifyOn": "R",
"dontMask": false
}
### [Alarm rules] Delete an alarm rule by id (read–write)
DELETE {{api-server}}/v2/alarm-rules/4623 HTTP/1.1
X-Api-Key: {{read-write-token}}