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. 

Now, it is also possible to manage Outages within the Administration console or API.

Released in - 

Summary

Operation

Method

API

Operation

Method

API

Get a list of OutagesGEThttp://server/en/omk/admin/api/v3/outages
Get an OutageGEThttp://server/en/omk/admin/api/v3/outages/:id
Create an OutagePOSThttp://server/en/omk/admin/api/v3/outages
Update an OutagePUThttp://server/en/omk/admin/api/v3/outages
Delete an OutageDELETEhttp://server/en/omk/admin/api/v3/outages/:id

Note: At the moment, this only works for local nodes. 

Authentication

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.

Response:


[
    {
        "change_id": "ticket #1234",
        "current": "current",
        "description": "Emergency outage",
        "element": [
            {
                "element_name": "Vlan2",
                "node_name": "Switch-1"
            },
            {
                "element_name": "regex:^Vlan.*?$",
                "node_name": "Switch-2"
            }
        ],
        "end": 1684156863,
        "frequency": "once",
        "id": "0ea7644e-b6fa-4fa2-9b33-a86b79db21a4",
        "nodes": {
            "name": [
                "Switch-2",
                "Switch-1"
            ]
        },
        "options": {},
        "start": 1683811263
    },
    {
        "change_id": "Outage_123_AT_OPTESTS",
        "current": null,
        "description": "Emergency outage",
        "end": 1683825925,
        "frequency": "once",
        "id": "ea7a3a94-f056-432f-91c5-9f39eee7c706",
        "nodes": {
            "name": [
                "asgard",
                "apc-ups"
            ]
        },
        "options": {},
        "start": 1646918463
    }
]

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:


{
    "change_id": "ticket #1234",
    "current": "current",
    "description": "Emergency outage",
    "element": [
        {
            "element_name": "Vlan2",
            "node_name": "Switch-1"
        },
        {
            "element_name": "regex:^Vlan.*?$",
            "node_name": "Switch-2"
        }
    ],
    "end": 1684156863,
    "frequency": "once",
    "id": "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:


{
    "change_id": "ticket #1234",
    "description": "Emergency outage",
    "nodes": ["Switch-2","Switch-1"],
    "elements" : [
        {  "node_name": "Switch-1",
           "element_name" : "Vlan2"
        },
        {  "node_name": "Switch-2",
           "element_name" : "regex:^Vlan.*?$"
        }
    ],
    "start": "11-May-2023 23:21:03",
    "end": "15-May-2023 23:21:03"
}


Returns:

{
    "id": "0ea7644e-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:

{
    "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 

{
    "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.








  • No labels