Skip to end of banner
Go to start of banner

Admin Outages API V3

Skip to end of metadata
Go to start of metadata

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

Compare with Current View Page History

« Previous Version 6 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-2"
        }
    ],
    "end": 1647004863,
    "frequency": "once",
    "id": "8b46a6f6-1b0d-4e46-a081-d58731abbdf7",
    "nodes": {
        "name": [
            "Switch-2",
            "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-1"],
    "elements" : [
        {  "node_name": "Switch-1",
           "element_name" : "Vlan2"
        },
        {  "node_name": "Switch-2",
           "element_name" : "regex:^Vlan.*?$"
        }
    ],
    "start": "10-Mar-2022 23:21:03",
    "end": "11-Mar-2022 23:21:03"
}


Returns:

{
    "id": "8b46a6f6-1b0d-4e46-a081-d58731abbdf7",
    "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" : "Vlan22"
        },
        {  "node_name": "Switch-2",
           "element_name" : "regex:^Vlan.*?$"
        }
    ],
    "start": "10-Mar-2022 23:21:03",
    "end": "11-Mar-2022 23:21:03"
}


Return 

{
    "id": "8b46a6f6-1b0d-4e46-a081-d58731abbdf7",
    "success": 1
}



Delete Outage

DELETE http://server/en/omk/admin/api/v3/outages/8b46a6f6-1b0d-4e46-a081-d58731abbdf7

Returns 200 if the outage was successfully removed.








  • No labels