...
Request Method | Operation | URL Example | id required | Notes |
---|---|---|---|---|
GET | read list | /server/omk/admin/v3v2/outages | n | Returns a list of Outages. |
GET | read one | /server/omk/admin/v3v2/outages/id | y | Returns the details of one Outage . |
POST | create one | /server/omk/admin/v3v2/outages | n | Create an Outage for given node or element |
PUT | update one | /server/omk/admin/v3v2/outages/ | y | Edit an already existing outage data |
DELETE | delete one | /server/omk/admin/v3v2/outages/id | y | Delete an existing outage |
...
Form data:
- username
- password
GET of /
...
v2/outages for List
GET http[s]://server/en/omk/admin/api/v3v2/outages
If your GET call provides an Accept
header indicating JSON, or if you use a .json
suffix, eg /v3v2/outages.json
as URI, then It will look for matching Outages and return their properties in the form of a JSON object, an array of Outages.
...
GET http://server/en/omk/admin/api/v3v2/outages
Returns a list of outages.
...
Code Block |
---|
[ { "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 of /
...
v2/outages/<id> for Read
If your GET call provides an accept
header indicating application/json
or if you use /en/omk/admin/api/v3v2/outages/
<id>.json
as URI, then the Outage will be looked up and all properties will be returned in the form of a JSON object.
...
GET http://server/en/omk/admin/api/v3v2/outages/#ID
Ex. http://server/en/omk/admin/api/v3v2/outages/0ea7644e-b6fa-4fa2-9b33-a86b79db21a4
...
Code Block |
---|
{ "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 } |
POST of /
...
v2/outages/ for Create
Create an Outage by sending a pay-load JSON object and this will create an Outage on your system and send an appropriate response.
...
HTTP Status | Body | Description |
---|---|---|
400 Bad Request | JSON object with an error property | The error property contains an explanation of what went wrongwith your request, e.g. if your payload is of wrong format to create an Outage. |
401 Unauthorized | JSON object with an error property | You are not authenticated. |
404 Not Found | JSON object with an error property | You are authenticated but not authorised to create an Outage. |
Create Outage
POST http://server/en/omk/admin/api/
...
v2/outages
Returns 201 if the outage was successfully created.
...
Code Block |
---|
{ "id": "0ea7644e-b6fa-4fa2-9b33-a86b79db21a4", "success": 1 } |
PUT of /
...
v2/outages/<id> for Update
Create an Outage by sending a pay-load JSON object and this will create an Outage on your system and receive an appropriate response.
...
PUT http://server/en/omk/admin/api/v3v2/outages/#ID
Returns 200 if the outage was successfully updated.
...
Code Block |
---|
{ "id": "0ea7644e-b6fa-4fa2-9b33-a86b79db21a4", "success": 1 } |
Delete of /
...
v2/outages/<id> for Create
Create an Outage by sending a pay-load JSON object and This will create an Outage on your system and receive an appropriate response.
...
DELETE http://server/en/omk/admin/api/v3v2/outages/0ea7644e-b6fa-4fa2-9b33-a86b79db21a4
...
Code Block |
---|
http[s]://server/omk/admin/v3v2/outages |