Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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": "Emergency "testing 123456"outage",
        "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": {
            "groupname": [
                "HQDev"Switch-2",
                ],"Switch-1"
            "name":]
[        },
        "Switch-1"options": {},
        "start": 1683811263
  ]  },
    {
        "nodeStatuschange_id": ["Outage_123_AT_OPTESTS",
        "current": null,
        "reachabledescription": "Emergency outage",
        "end": 1683825925,
     ],   "frequency": "once",
        "nodeTypeid": ["ea7a3a94-f056-432f-91c5-9f39eee7c706",
        "nodes": {
            "switchname",: [
                "serverasgard",
                "genericapc-ups"
            ],
        },
        "nodeVendoroptions": [{},
        "start": 1646918463
    }
 "Cisco Systems"
    ]



Get Outage

GET http://server/en/omk/admin/api/v3/outages/#ID

Ex. http://server/en/omk/admin/api/v3/outages/0ea7644e-b6fa-4fa2-9b33-a86b79db21a4

Returns an outage.

Response:


Code Block
{
    "change_id": "ticket #1234",
       ]"current": "current",
    "description": "Emergency outage",
     "roleTypeelement": [
        {
       "test2"     "element_name": "Vlan2",
            ] "node_name": "Switch-1"
        },
        {
       "options     "element_name": {"regex:^Vlan.*?$",
            "nostatsnode_name": 0"Switch-2"
        }
    ],
    "end": 1684156863,
    "frequency": "once",
    "startid": 1683122400"0ea7644e-b6fa-4fa2-9b33-a86b79db21a4",
    "nodes": {},
    "options": {},
    "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": "ticket #1234",
    "description": "Emergency outage",
    "nodes": ["Switch-2","Switch-1"],
    "elements" : [
 "current"       {  "node_name": "Switch-1",
           "element_name" : "current"Vlan2"
        },
        "description{  "node_name": "testSwitch-outage2",
        "end": 1683381540,   "element_name" : "regex:^Vlan.*?$"
        }
    ],
    "frequencystart": "once11-May-2023 23:21:03",
    "end": "15-May-2023 23:21:03"
}


Returns:

Code Block
{
    "id": "10d3558d0ea7644e-1819b6fa-44924fa2-8ff59b33-a5629663e0d7a86b79db21a4",
    "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
{
 "nodes   "change_id": {"ticket #1234",
    "description": "Emergency outage",
    "namenodes": ["Switch-2","Switch-1"],
    "elements" : [
        { "fulla" "node_name": "Switch-1",
           "element_name" : ]"Vlan222"
        },
        "options{  "node_name": {"Switch-2",
            "nostatselement_name" : 0"regex:^Vlan.*?$"
        },
    ],
    "start": 1683122400"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.