Skip to content

Latest commit

 

History

History
246 lines (200 loc) · 18.6 KB

maddash_api_events.rst

File metadata and controls

246 lines (200 loc) · 18.6 KB

Events

Retrieving a list of events

Request

The request is a HTTP GET to the events URL. See below for full summary:

URL /maddash/events
HTTP Method GET

URL Parameters

Name Value
gridName Matches events that affect a certain grid. It can be specified multiple times.
rowName Matches events that affect a certain row. It can be specified multiple times.
columnName Matches events that affect a certain column. It can be specified multiple times.
checkName Matches events that affect a certain check. It can be specified multiple times.
dimensionName Matches events that affect a certain row or column. It can be specified multiple times.

Response

Type: application/json

Field Type Required Description
events JSON Array Yes List of events
events[n].uri string Yes The URI where full event details can be found
events[n].name string Yes The name of the event
events[n].description string Yes A description of the event
events[n].startTime UNIX timestamp Yes The time at which the event starts as a UNIX timestamp
events[n].endTime UNIX timestamp Yes The time at which the event ends as a UNIX timestamp
events[n].changeStatus boolean Yes True or false value indicating if event causes checks to be marked as down.

Example

{
   "events":[
      {
         "uri":"/maddash/events/18",
         "name":"Test",
         "description":"test",
         "startTime":1421865300,
         "endTime":1422470100,
         "changeStatus":true
      }
   ]
}

Retrieving a single event

Request

The request is a HTTP GET to the event URL. See below for full summary:

URL /maddash/events/<id>
HTTP Method GET

Response

Type: application/json

Field Type Required Description
uri string Yes The URI where full event details can be found
name string Yes The name of the event
description string Yes A description of the event
startTime UNIX timestamp Yes The time at which the event starts as a UNIX timestamp
endTime UNIX timestamp Yes The time at which the event ends as a UNIX timestamp
changeStatus boolean Yes True or false value indicating if event causes checks to be marked as down.
checks JSON Array Yes List of check URIs that are affected by this event

Example

{
   "uri":"/maddash/events/18",
   "name":"Test",
   "description":"test",
   "startTime":1421865300,
   "endTime":1422470100,
   "changeStatus":true,
   "checks":[
      "/maddash/grids/OWAMP/albq-owamp.es.net/bois-owamp.es.net/Loss",
      "/maddash/grids/OWAMP/albq-owamp.es.net/bost-owamp.es.net/Loss",
   ]
}

Creating an Event

Request

The request is a HTTP POST that must be authenticated using HTTP BASIC authentication:

URL /maddash/admin/events
HTTP Method POST

JSON Parameters

Name Type | Required Value
checkFilters JSON Object Yes A JSON object with filters that select which checks will be affected by the event
checkFilters.gridName JSON Array or String No A JSON array with the list of grids to select. Undefined or the string * means to match every thing.
checkFilters.rowName JSON Array or String No A JSON array with the list of rows to select. Undefined or the string * means to match every thing.
checkFilters.columnName JSON Array or String No A JSON array with the list of columns to select. Undefined or the string * means to match every thing.
checkFilters.checkName JSON Array or String No A JSON array with the list of checks to select. Undefined or the string * means to match every thing.
checkFilters.dimensionName JSON Array or String No A JSON array with the list of columns or rows to select. Undefined or the string * means to match every thing.
name string Yes The name of the event
description string Yes A description of the event
startTime UNIX timestamp Yes The time at which the event starts as a UNIX timestamp
endTime UNIX timestamp Yes The time at which the event ends as a UNIX timestamp
changeStatus boolean Yes True or false value indicating if event causes checks to be marked as down.

Example

{
   "checkFilters": {
        "gridName": ["BWCTL"],
        "rowName": ["chic-pt1.es.net"],
        "columnName": "*",
        "checkName": "*",
   },
   "name":"Test",
   "description":"test",
   "startTime":1421865300,
   "endTime":1422470100,
   "changeStatus":true,
}

Response

Type: application/json

Field Type Required Description
uri string Yes The URI of the created event resource

Example

{
    "uri": "/maddash/events/19"
}

Deleting an Event

Request

The request is a HTTP DELETE that must be authenticated using HTTP BASIC authentication:

URL /maddash/admin/events/<id>
HTTP Method DELETE

Response

Type: application/json

Field Type Required Description
status integer Yes A value of 0 means the operation succeeded. Non-zero means an error occurred.
message string Yes A message describing the result of the operation

Example

{
    "status": 0,
    "message": "Successfully deleted event"
}