Versions Compared

Key

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

...

Create an Outage by sending a pay-load JSON object, which will create an Outage on your system and send an appropriate response.

Successful Response

HTTP Status

Body

Description
200 OKJSON object with success and id propertiesThe success property is set to 1 and only if the request was successful.
The id property is the new event's ID

Unsuccessful Response

HTTP Status

Body

Description

400 Bad RequestJSON object with an error propertyThe error property contains an explanation of what went wrong
with your request, e.g. if your payload is of wrong format to create an  Outage.
401 UnauthorizedJSON object with an error propertyYou are not authenticated.
404 Not FoundJSON object with an error propertyYou are authenticated but not authorised to create an Outage.



Create Outage

POST  http://server/en/omk/admin/api/v2/outages

Payload example:

Code Block

Before opCharts 4.5.8, only Node outages are supported

{
    "change_id": "001",
    "current": "current",
    "description": "testing outage 1",
    "frequency": "once",
    "nodes":["Switch1","Switch-111"],
    "options": {
        "nostats": 0
    },
    "start": "11-May-2023 23:21:03",
    "end": "15-May-2023 23:21:03" 
} 

############################################################################

From opCharts 4.5.8 onwards, Node Outages and Element Outages are supported

{
    "change_id": "ticket #1234",
    "description": "Emergency outage",
    "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"
}

...

Update an Outage by sending a pay-load JSON object, which will update the Outage on your system and receive an appropriate response.

Successful Response

HTTP Status

Body

Description
200JSON object with success and id propertiesThe success property is set to 1 and only if the request was successful.
The id property is the new event's ID

Unsuccessful Response

HTTP Status

Body

Description

400 Bad RequestJSON object with an error propertyThe error property contains an explanation of what went wrong
with your request, e.g. if your payload is of wrong format to edit an  Outage.
401 UnauthorizedJSON object with an error propertyYou are not authenticated.
404 Not FoundJSON object with an error propertyYou are authenticated but not authorised to create an Outage.



...

Delete an Outage by sending a request with the Outage on your system and receive an appropriate response.

Successful Response

HTTP Status

Body

Description
200JSON object with success The success property is set to 1 and only if the request was successful.

Unsuccessful Response

HTTP Status

Body

Description

400 Bad RequestJSON object with an error propertyThe error property contains an explanation of what went wrong
with your request, e.g. if id is missing or wrong format.
404 Not FoundJSON object with an error propertyIf the id does not exist.
401 UnauthorizedJSON object with an error propertyYou are not authenticated.
404 Not FoundJSON object with an error propertyYou are authenticated but not authorised to delete an Outage.

Delete Outage

DELETE http://server/en/omk/admin/api/v2/outages/0ea7644e-b6fa-4fa2-9b33-a86b79db21a4

...

The following table lists theproperties of an Outage.

Property

Description

Example

id

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
currentIf the outage is current or scheduled/future outage. IS THIS 'current' for scheduled or null for future.current
descriptionLong description of an Outage.This is a test outage
frequencyFrequency may be once, daily, weekly or monthly.once
start

Date and time when the outage shall start.

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 a description of the values allowed.

 2023-10-31T17:00:00+0000
endDate and time when the outage shall 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 a description of the values allowed. 
 31 May 2023 03:30 pm
nodesList of nodes for which Outages are defined. At least one nodes or an elements must be specified.[ 'Switch-1','Switch-2' ]
elements

List of elements of nodes for which Outages are defined. The element must be defined to match the one which may occur in the events.

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", 
 
   "node_name": "Switch-1" 
},
{
   "element_name": "iregex:^Vlan.*?$",
   "node_name": "Switch-2"
}
 
 
]
 

[ {
 
   "node_name": "Switch-1" 
},
{
   "element_name": "regex:^Vlan.*?$",
   "node_name": "Switch-2"
}
 
 
]
options

optional key=values to adjust NMIS behaviour during an outage.

DOCUMENT THE KEYS AND VALUES

"Normal"

Limitations

API Endpoint

All requests are made under the following base URL:

Code Block

  http[s]://server/omk/admin/v2/outages

...

  • When a scheduled outage is defined, including elements, it will be restricted to a single node. However, it can include multiple elements.
    For example, Node vmswitch1 has 4 interfaces out of 24, which will be impacted by an outage: GigabitEthernet1/10, GigabitEthernet1/11, GigabitEthernet1/12 , and GigabitEthernet1/13.

    Code Block
    
    {
        "change_id": "ticket #1234",
        "description": "Planned outage",
        "elements" : [
            {  "node_name": "vmswitch1",
               "element_name" : "GigabitEthernet1/10"
            },
            {  "node_name": "vmswitch1",
               "element_name" : "GigabitEthernet1/11"
            },
            {  "node_name": "vmswitch1",
               "element_name" : "GigabitEthernet1/12"
            }, 
            {  "node_name": "vmswitch1",
               "element_name" : "GigabitEthernet1/13"
            }
        ],
        "start": "11-May-2023 23:21:03",
        "end": "15-May-2023 23:21:03"
    }


...