Alert API

Notifiers have been renamed to actions, except in the actual API. See Alerts for general information about alerts.

Deprecated: API for Alerts v1.23

The endpoints displayed on this page are deprecated and replaced by the corresponding queries and mutations found in our GraphQL.

List Alerts

logscale
GET /api/v1/repositories/$DATASPACE/alerts

Example:

logscale
curl -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN"  http://$YOUR_LOGSCALE_URL/api/v1/repositories/$DATASPACE/alerts

Get Alert by ID

logscale
GET /api/v1/repositories/$DATASPACE/alerts/$ID

Example:

logscale
curl -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN"  http://$YOUR_LOGSCALE_URL/api/v1/repositories/$DATASPACE/alerts/hZuxvyEitdisEA06EqzEO52gCd8PO0OR

Create Alert

logscale
POST /api/v1/repositories/$DATASPACE/alerts

Params:

  • name — string

  • `query`:

    • queryString — string

    • start — string

  • description — string

  • throttleTimeMillis — integer — minimum time between invoking actions

  • throttleField — string — set this field to do Field-Based Throttling

  • silenced — boolean — whether the alert is enabled or not

  • notifiers — array — array of action ID strings

  • labels — array — array of text labels

Example:

logscale
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN"  http://$YOUR_LOGSCALE_URL/api/v1/repositories/$DATASPACE/alerts -d '{"name":"test", "query": {"queryString":"foobar", "start":"1h"}, "description":"this is a test", "throttleTimeMillis":600000, "silenced":false, "notifiers":["GrpMXUR2me8045Sz39qcsoWjXT3fJ7rT"], "labels":["test"]}'

Update Alert

logscale
PUT /api/v1/repositories/$DATASPACE/alerts/$ID

Params:

  • name — string

  • `query`:

    • queryString — string

    • start — string

  • description — string

  • throttleTimeMillis — integer — minimum time between invoking actions

  • throttleField — string — set this field to do Field-Based Throttling

  • silenced — boolean — whether the alert is enabled or not

  • notifiers — array — array of action ID strings

  • labels — array — array of text labels

Example:

logscale
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN"  http://$YOUR_LOGSCALE_URL/api/v1/repositories/$DATASPACE/alerts/hZuxvyEitdisEA06EqzEO52gCd8PO0OR -d '{"name":"different test", "query": {"queryString":"foobar", "start":"1h"}, "description":"this is a test", "throttleTimeMillis":600000, "throttleField":"server", "silenced":false, "notifiers":["GrpMXUR2me8045Sz39qcsoWjXT3fJ7rT"], "labels":["test"]}'

Delete Alert

logscale
DELETE /api/v1/repositories/$DATASPACE/alerts/$ID

Example:

logscale
curl-X DELETE -H "Authorization: Bearer $TOKEN"  http://$YOUR_LOGSCALE_URL/api/v1/repositories/$DATASPACE/alerts/hZuxvyEitdisEA06EqzEO52gCd8PO0OR