Versions Compared

Key

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

In Development
Status
colourYellow
title
Table of Contents

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.

...

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

Released in opCharts 4.3.5

Summary

Operation

Method

API

Get a list of OutagesGEThttp://server/en/omk/admin/api/v2/outages
Get an OutageGEThttp://server/en/omk/admin/api/v2/outages/:id
Create an OutagePOSThttp://server/en/omk/admin/api/v2/outages
Update an OutagePUThttp://server/en/omk/admin/api/v2/outages
Delete an OutageDELETEhttp://server/en/omk/admin/api/v2/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/v2/outages

Returns a list of outages.

...

Code Block
[
    {
        "change_id": "ticket #1234",
        "current": "current"null,
        "description": null"my_test_outage",
        "end": 16468314101678627263,
        "frequency": "once",
        "id": "4dab2e5da059db21-de6bd7c8-4d2f4fc8-946a9e95-cc83edba9febad47b5ba3dae",
        "optionsnodes": {},[
        "selector": {
            "node": {"asgard",
                 "name": "amor""apc-ups"
        ],
    }         "options": {},
        "start": 16468281101678454463
    },
    {
        "change_id": "ticket #1234",
        "current": null,
        "description": null"my_test_outage",
        "end": 16476954951678627263,
        "frequency": "once",
        "id": "f14d4f34a9dac944-2fd0ef21-4be04019-9d54a24d-7431c5de294fd993926922a1",
        "optionsnodes": {},[
        "selector": {
            "node": {
   "asgard",
            "nameapc-ups":
"asgard"        ],
    }         "options": {},
        "start": 16476921951678454463
    }
]


Get Outage

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

Ex. http://server/en/omk/admin/api/v2/outages/f14d4f34-2fd0-4be0-9d54-7431c5de294f

Returns an outage.

Response:

Code Block
{
    "change_id": "ticket #"1234",
    "current": null,
    "description": null"my_test_outage",
    "end": 16476954951678627263,
    "frequency": "once",
    "id": "f14d4f34e5ad10c2-2fd05869-4be04b03-9d54ae6a-7431c5de294fc4d86a174688",
    "optionsnodes": {},[
    "selector": {         "node": {"asgard",
            "name": "asgard""apc-ups"
    ],
    }
    "options": {},
    "start": 16476921951678454463
}

Create Outage

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

Returns 201 200 if the outage was successfully created.

...

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

Returns 201 200 if the outage was successfully updated.

...

DELETE http://server/en/omk/admin/api/v2/outages/2a07c78a-65b6-49df-a052-a97d7a899c58

Returns 201 200 if the outage was successfully removed.