Get All Alerts

Request

  • Requires authentication
  • HTTP Method: GET
  • URL: http://your.netsil.url/api/v0/alert

Response

Returns an array of all the alerts accessible to the user. Each alert has an id which can be used to get the specific alert.

Example

Note headers file has the authentication cookie.

curl -L  -b headers  -X GET http://your.netsil.url/api/v0/alert

Response

[
  {
    "id":"19b8221b-2c7d-4e40-a2cb-1322884c45d8",  /* Alert id */
    "name":"HTTP Alert",     /* Alert name */
    "filters":[{...}, {...}, ...],    /* An array of global filters applied to all the metrics used in the alert. */
    "queries":[...], /* Queries returning the data for the alert */
    "selectedReferences":[...],  /* Query references used for identifying query results for e.g. for combining using mathematical operations*/
    "description":null, /* Alert description */
    "chartTypes":{...}, /* Chart type such as line-chart, bar-chart */
    "creatorUserId": "f15b3868-f28e-4f66-a4a9-3a0d33d6dc36", /* User ID of creator of alert */
    "organizationId": "10995e4b-11dc-4a39-bec2-ad03feecc5af", /* organization ID alert belongs to */
    "silenced": true, /* Whether notifications for the alert is muted */
    "isReadOnly": false, /* Whether non-admins can edit the alert*/
    "EmailNotifications": {...}, /* Email notifications for the alert */
    "PagerdutyNotifications": {...}, /* Pagerduty notifications for the alert */
    "WebhookNotifications": {...}, /* Webhook notifications for the alert */
    "createdAt":"2017-02-28T02:41:12.000Z",  /* Creation date time */
    "updatedAt":"2017-02-28T02:41:12.000Z"   /* Last update time */
  },
  {...},
  {...},
  ...
]

Get Specific Alert

Request

  • Requires authentication
  • HTTP Method: GET
  • URL: http://your.netsil.url/api/v0/alert/alertId

Response

Return specific alert identified by the alertId.

Example

Note headers file has the authentication cookie.

curl -L  -b headers  -X GET http://your.netsil.url/api/v0/alert/19b8221b-2c7d-4e40-a2cb-1322884c45d8

Response

 {
    "id":"19b8221b-2c7d-4e40-a2cb-1322884c45d8",  /* Alert id */
    "name":"HTTP Alert",     /* Alert name */
    "filters":[{...}, {...}, ...],    /* An array of global filters applied to all the metrics used in the alert. */
    "queries":[...], /* Queries returning the data for the alert */
    "selectedReferences":[...],  /* Query references used for identifying query results for e.g. for combining using mathematical operations*/
    "description":null, /* Alert description */
    "chartTypes":{...}, /* Chart type such as line-chart, bar-chart */
    "creatorUserId": "f15b3868-f28e-4f66-a4a9-3a0d33d6dc36", /* User ID of creator of alert */
    "organizationId": "10995e4b-11dc-4a39-bec2-ad03feecc5af", /* organization ID alert belongs to */
    "silenced": true, /* Whether notifications for the alert is muted */
    "isReadOnly": false, /* Whether non-admins can edit the alert*/
    "EmailNotifications": {...}, /* Email notifications for the alert */
    "PagerdutyNotifications": {...}, /* Pagerduty notifications for the alert */
    "WebhookNotifications": {...}, /* Webhook notifications for the alert */
    "createdAt":"2017-02-28T02:41:12.000Z",  /* Creation date time */
    "updatedAt":"2017-02-28T02:41:12.000Z"   /* Last update time */
  }

Create Alert

Request

  • Requires authentication
  • HTTP Method: POST
  • URL: http://your.netsil.url/api/v0/alert

Response

Returns json spec for alert

Example

Note headers file has the authentication cookie.

curl -b headers -H "Content-Type: application/json" -X POST --data @simple_new_alert.json http://your.netsil.url/api/v0/alert

where simple_new_alert.json is:

{
  "name":"NEW ALERT FROM API",
  "filters":[{...}, {...}, ...], /* optional */
  "queries":[...],
  "selectedReferences":[...],
  "description":null, /* optional */
  "chartTypes":{...},
  "silenced": false,
  "isReadOnly": false
}

The following is the response which includes the alert id:

{
  "filters":[],
  "id":"3671929e-3af4-482b-a618-53a806aae0a2",
  "name":"NEW ALERT FROM API",
  "queries":[...],
  "selectedReferences":[...],
  "description":null,
  "chartTypes":{...},
  "silenced": false,
  "isReadOnly": false,
  "updatedAt":"2017-02-10T20:15:55.000Z",
  "createdAt":"2017-02-10T20:15:55.000Z"
}

Delete Alert

Request

  • Requires authentication
  • HTTP Method: DELETE
  • URL: http://your.netsil.url/api/v0/alert/alertId

Example

Note headers file has the authentication cookie.

curl -b headers -H "Content-Type: application/json" -X DELETE  http://your.netsil.url/api/v0/alert/a1b6cdd8-37ad-4fca-940b-89006909856e