If you have a maintenance window or a scheduled outage for a device then you will likely want to suspend alerting for that device during that period.
NMIS has supported this for a long time, please refer to the NMIS Outages documentation for further information.
...
All these methods require authentication.
POST http://server/en/omk/admin/login
Form data:
- username
- password
Methods
Get Outages
GET http://server/en/omk/admin/api/v3/outages
Returns a list of outages.
...
Code Block |
---|
[ { "change_id": "123456ticket #1234", "current": "current", "description": "testingEmergency 123456outage", "endelement": [ 1683381540, "frequency": "once", { "id": "df0affe5-a16f-4fa2-a299-5376a3fabb73", "nodeselement_name": { "groupVlan2":, [ "node_name": "HQDevSwitch-1" ]}, "name":{ [ "Switch-1" "element_name": "regex:^Vlan.*?$", ], "nodeStatus"node_name": ["Switch-2" "reachable" } ], "nodeTypeend": [1684156863, "switch"frequency": "once", "server"id": "0ea7644e-b6fa-4fa2-9b33-a86b79db21a4", "generic" ],"nodes": { "nodeVendorname": [ "Cisco Systems" ]Switch-2", "roleType": [ "test2"Switch-1" ] }, "options": { "nostats": 0 }, "start": 16831224001683811263 }, { "change_id": "1Outage_123_AT_OPTESTS", "current": "current"null, "description": "test-Emergency outage", "end": 16833815401683825925, "frequency": "once", "id": "10d3558dea7a3a94-1819f056-4492432f-8ff591c5-a5629663e0d79f39eee7c706", "nodes": { "name": [ "fullaasgard", ] "apc-ups" }, ] "options": { }, "nostatsoptions": 0 {}, "start": 16831224001646918463 } ] |
Get Outage
GET http://server/en/omk/admin/api/v3/outages/#ID
Ex. http://server/en/omk/admin/api/v3/outages/df0affe50ea7644e-a16fb6fa-4fa2-a2999b33-5376a3fabb73a86b79db21a4
Returns an outage.
Response:
...
Code Block |
---|
{ "change_id": "123456ticket #1234", "current": "current", "description": "testingEmergency 123456outage", "endelement": 1683381540, [ { "frequency": "once", "idelement_name": "df0affe5-a16f-4fa2-a299-5376a3fabb73Vlan2", "nodes": { "groupnode_name": ["Switch-1" }, "HQDev" { ], "element_name": ["regex:^Vlan.*?$", "node_name": "Switch-12" ],} ], "nodeStatusend": [1684156863, "frequency": "once", "id": "reachable"0ea7644e-b6fa-4fa2-9b33-a86b79db21a4", ]"nodes": {}, "nodeTypeoptions": [{}, "start": 1683811263 } |
Create Outage
POST http://server/en/omk/admin/api/v3/outages
Returns 200 if the outage was successfully created.
Payload example:
Code Block |
---|
{ "change_id": "switchticket #1234", "description": "Emergency outage", "nodes": "server", ["Switch-2","Switch-1"], "genericelements" : [ ], { "nodeVendor": ["node_name": "Switch-1", "element_name" : "Cisco SystemsVlan2" ]}, { "roleTypenode_name": ["Switch-2", "element_name" : "test2regex:^Vlan.*?$" ]} }], "optionsstart": { "11-May-2023 23:21:03", "end": "15-May-2023 "nostats": 023:21:03" } |
Returns:
Code Block |
---|
{ }"id": "0ea7644e-b6fa-4fa2-9b33-a86b79db21a4", "startsuccess": 16831224001 } |
...
Update Outage
...
PUT http://server/en/omk/admin/api/v3/outages/#ID
Returns 200 if the outage was successfully
...
updated.
Payload example:
Code Block |
---|
test-block |
Returns:
Code Block |
---|
test-response |
Update Outage
PUT http://server/en/omk/admin/api/v3/outages
Returns 200 if the outage was successfully updated.
Payload example:
Code Block |
---|
test-block-payload |
Return
Code Block |
---|
test-response{ "change_id": "ticket #1234", "description": "Emergency outage", "nodes": ["Switch-2","Switch-1"], "elements" : [ { "node_name": "Switch-1", "element_name" : "Vlan222" }, { "node_name": "Switch-2", "element_name" : "regex:^Vlan.*?$" } ], "start": "11-May-2023 23:21:03", "end": "15-May-2023 23:21:03" } |
Return
Code Block |
---|
{
"id": "0ea7644e-b6fa-4fa2-9b33-a86b79db21a4",
"success": 1
} |
Delete Outage
DELETE http://server/en/omk/admin/api/v3/outages/
...
0ea7644e-
...
b6fa-4fa2-
...
9b33-
...
a86b79db21a4
Returns 200 if the outage was successfully removed.