Outages API - V2
...
All these methods require authentication.
POST http://server/en/omk/admin/login
Form data:
- username
- password
GET of /v2/outages for List
GET http[s]://server/en/omk/admin/api/v2/outages
If your GET call provides an Accept
header indicating JSON, or if you use a .json
suffix, eg /v2/outages.json
as URI, then It will look for matching Outages and return their properties in the form of a JSON object, an array of Outages.
...
HTTP Status | Body | Description |
---|---|---|
401 Unauthorized | JSON object with an error property | You are not authenticated. |
403 Forbidden | JSON object with an error property | You are not authorized. |
GET http://server/en/omk/admin/api/v2/outages
Returns a list of outages.
Response:
Code Block |
---|
[ [ { "change_id": "ticket #1234005", "current": "current", "description": "Emergency outage005", "elementelements": [ { "element_name": "Vlan2lo", "node_name": "Switch-1A.TEST" }, { "element_name": "regex:^Vlan.*?$Vlan1", "node_name": "Switch-21" } ], "end": 16841568631685541600, "frequency": "once", "id": "0ea7644e7a2011c7-b6fa2880-4fa240ab-9b33aa17-a86b79db21a412a110cc1c23", "nodes": { [], "nameoptions": [{ "nostats": "Switch-2",0 }, "Switch-1start": 1685455200 }, { ] }"change_id": "001", "optionscurrent": null, "description": {}"001", "startelements": [ 1683811263 }, { "change_id "element_name": "Outage_123_AT_OPTESTSVlan1", "current": null, node_name": "Switch-2" } ], "end": "12:12", "frequency": "daily", "id": "1f7ea042-0aaa-46a7-b34b-f9314952ee6f", "nodes": [], "options": { "nostats": 0 }, "start": "11:11" }, { "change_id": "Testing_OMK-9923_2", "current": null, "description": "Testing outages update by Shantaveer", "elements": [ { "element_name": "Vlan1", "node_name": "Switch-1" }, { "element_name": "Vlan1", "node_name": "Switch-2" } "description": "Emergency outage" ], "end": 16838259251685498400, "frequency": "once", "id": "ea7a3a94738d6ead-f0562729-432f4986-91c58146-9f39eee7c70632b34a8c985d", "nodes": {[ "namethor": [ ], "asgardoptions",: { "apc-ups" ] }, "nostats": 0 "options": {}, "start": 16469184631685491200 } ] |
GET of /v2/outages/<id> for Read
If your GET call provides an accept
header indicating application/json
or if you use /en/omk/admin/api/v2/outages/
<id>.json
as URI, then the Outage will be looked up and all properties will be returned in the form of a JSON object.
...
GET http://server/en/omk/admin/api/v2/outages/#ID
Ex. http://server/en/omk/admin/api/v2/outages/e17b6efa1f7ea042-a3da0aaa-428146a7-919cb34b-bef26b96ff80f9314952ee6f
Returns an outage.
Response:
Code Block |
---|
{ "change_id": "001", "current": "current"null, "description": "testing001", outage 1", "elements": [ { "element_name": "Vlan11Vlan1", "node_name": "Asgard"Switch-2" } ], "end": 1684763940,"12:12", "frequency": "oncedaily", "id": "e17b6efa1f7ea042-a3da0aaa-428146a7-919cb34b-bef26b96ff80f9314952ee6f", "nodes": [], "Asgardoptions": { ], "optionsnostats": {0 "nostats": 0}, }, "start": 1684072800"11:11" } |
POST of /v2/outages/ for Create
...
DELETE http://server/en/omk/admin/api/v2/outages/0ea7644e-b6fa-4fa2-9b33-a86b79db21a4
Returns 200 if the outage was successfully removed.
...
Property | Description | Example |
| A globally unique Outage ID | 0ea7644e-b6fa-4fa2-9b33-a86b79db21a4 |
change_id | Insert any reference number if required in the change id field | ticket #12345 |
current | If the outage is current or scheduled/future outage. IS THIS 'current' for scheduled or null for future. | current |
description | Long description of an Outage | This is a test outage |
frequency | one of 'once', 'daily', 'weekly' or 'monthly' | once |
start | date and time of outage start. For Read, this is a Unix timestamp, the number of seconds since 1970-01-01 00:00:00 UTC | 2023-10-31T17:00:00+0000 |
end | date and time of outage end. For Read, this is a Unix timestamp, the number of seconds since 1970-01-01 00:00:00 UTC For Create and Update see Supported Time Formats for description of allowed values | 31 May 2023 03:30 pm |
nodes | List of nodes for which Outages is defined. At least one of nodes or elements must be specified. | [ 'Switch-1','Switch-2' ] |
element | List of elements from nodes for which Outages are defined. element_name must be either a string or a regex pattern ( regex:pattern or iregex:pattern as shown in examples) element_name can be either interface name or other. | [ { "element_name": "Vlan2", "element_name": "iregex:^Vlan.*?$", [ { "node_name": "Switch-1" "element_name": "regex:^Vlan.*?$", |
options | optional key=values to adjust NMIS behaviour during an outage DOCUMENT THE KEYS AND VALUES | "Normal" |
...