You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

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": "123456",
        "current": "current",
        "description": "testing 123456",
        "end": 1683381540,
        "frequency": "once",
        "id": "df0affe5-a16f-4fa2-a299-5376a3fabb73",
        "nodes": {
            "group": [
                "HQDev"
            ],
            "name": [
                "Switch-1"
            ],
            "nodeStatus": [
                "reachable"
            ],
            "nodeType": [
                "switch",
                "server",
                "generic"
            ],
            "nodeVendor": [
                "Cisco Systems"
            ],
            "roleType": [
                "test2"
            ]
        },
        "options": {
            "nostats": 0
        },
        "start": 1683122400
    },
    {
        "change_id": "1",
        "current": "current",
        "description": "test-outage",
        "end": 1683381540,
        "frequency": "once",
        "id": "10d3558d-1819-4492-8ff5-a5629663e0d7",
        "nodes": {
            "name": [
                "fulla"
            ]
        },
        "options": {
            "nostats": 0
        },
        "start": 1683122400
    }
]

Get Outage

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

Ex. http://server/en/omk/admin/api/v3/outages/e6d371a0-2b74-4dd3-9bc9-fca14f8ddc4f

Returns an outage.

Response:


{
    "change_id": "ticket #1234",
    "description": "Emergency outage",
    "element": [
        {
            "element_name": "Vlan2",
            "node_name": "Switch-1"
        },
        {
            "element_name": "regex:^Vlan.*?$",
            "node_name": "Switch-3"
        }
    ],
    "end": 1647004863,
    "frequency": "once",
    "id": "e6d371a0-2b74-4dd3-9bc9-fca14f8ddc4f",
    "nodes": {
        "name": [
            "Switch-2",
            "Switch-3",
            "Switch-1"
        ]
    },
    "options": {},
    "start": 1646918463
}



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-3","Switch-1"],
    "elements" : [
        {  "node_name": "Switch-1",
           "element_name" : "Vlan2"
        },
        {  "node_name": "Switch-3",
           "element_name" : "regex:^Vlan.*?$"
        }
    ],
    "start": "10-Mar-2022 23:21:03",
    "end": "11-Mar-2022 23:21:03"
}


Returns:

{
    "id": "e6d371a0-2b74-4dd3-9bc9-fca14f8ddc4f",
    "success": 1
}

Update Outage

PUT http://server/en/omk/admin/api/v3/outages

Returns 200 if the outage was successfully updated.

Payload example:



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


Return 

test-response



Delete Outage

DELETE http://server/en/omk/admin/api/v3/outages/df0affe5-a16f-4fa2-a299-5376a3fabb73

Returns 200 if the outage was successfully removed.








  • No labels