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": { "group": ["Vlan2", "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", "genericnodes": { ], "nodeVendor"name": [ "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/
...
...
...
...
...
Returns an outage.
Response:
Code Block |
---|
{ "change_id": "123456ticket #1234", "current": "current", "description": "Emergency outage", "testing 123456" "element": [ { "element_name": "Vlan2", "node_name": "Switch-1" }, { "element_name": "regex:^Vlan.*?$", "node_name": "Switch-2" } ], "end": 16833815401684156863, "frequency": "once", "id": "df0affe50ea7644e-a16fb6fa-4fa2-a2999b33-5376a3fabb73a86b79db21a4", "nodes": {}, "options": {}, "groupstart": [ 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": "ticket #1234", "HQDevdescription": "Emergency outage", "nodes": ["Switch-2","Switch-1"], "elements" : [ { "node_name": ["Switch-1", "element_name" : "Switch-1Vlan2" ]}, { "nodeStatusnode_name": ["Switch-2", "element_name" "reachable": "regex:^Vlan.*?$" } ], ], "start"nodeType": [: "11-May-2023 23:21:03", "end": "15-May-2023 23:21:03" } |
Returns:
Code Block |
---|
{ "id": "switch0ea7644e-b6fa-4fa2-9b33-a86b79db21a4", "success": 1 } |
Update Outage
PUT http://server/en/omk/admin/api/v3/outages/#ID
Returns 200 if the outage was successfully updated.
Payload example:
Code Block |
---|
{ "change_id": "serverticket #1234", "description": "Emergency outage", "nodes": "generic"["Switch-2","Switch-1"], "elements" : [ ], { "nodeVendornode_name": ["Switch-1", "element_name" : "Cisco SystemsVlan222" ]}, { "roleTypenode_name": ["Switch-2", "element_name" : "test2regex:^Vlan.*?$" ]} }], "optionsstart": { "11-May-2023 23:21:03", "end": "15-May-2023 "nostats": 023:21:03" } |
Return
Code Block |
---|
{ }"id": "0ea7644e-b6fa-4fa2-9b33-a86b79db21a4", "startsuccess": 1683122400 }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.