MethodPathDescription
GET/v1/bdbs/alertsGet all alert states for all databases
GET/v1/bdbs/alerts/{uid}Get all alert states for a specific database
GET/v1/bdbs/alerts/{uid}/{alert}Get a specific database alert state
POST/v1/bdbs/alerts/{uid}Update a database’s alerts configuration

Get all database alerts

GET /v1/bdbs/alerts

Get all alert states for all databases.

Required permissions

Permission name
view_all_bdbs_alerts

Request

Example HTTP request

GET /bdbs/alerts 

Request headers

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted media type

Response

Returns a hash of alert UIDs and the alerts states for each database.

Example JSON body

{
    "1": {
        "bdb_size": {
            "enabled": true,
            "state": true,
            "threshold": "80",
            "change_time": "2014-08-29T11:19:49Z",
            "severity": "WARNING",
            "change_value": {
                "state": true,
                "threshold": "80",
                "memory_util": 81.2
            }
        },
        "..."
    },
    "..."
}

Status codes

CodeDescription
200 OKNo error

Get database alerts

GET /v1/bdbs/alerts/{int: uid}

Get all alert states for a database.

Required permissions

Permission name
view_bdb_alerts

Request

Example HTTP request

GET /bdbs/alerts/1 

Request headers

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted media type

Response

Returns a hash of alert objects and their states.

Example JSON body

{
    "bdb_size": {
        "enabled": true,
        "state": true,
        "threshold": "80",
        "severity": "WARNING",
        "change_time": "2014-08-29T11:19:49Z",
        "change_value": {
            "state": true,
            "threshold": "80",
            "memory_util": 81.2
        }
    },
    "..."
}

Status codes

CodeDescription
200 OKNo error
404 Not FoundSpecified bdb does not exist

Get database alert

GET /v1/bdbs/alerts/{int: uid}/{alert}

Get a database alert state.

Required permissions

Permission name
view_bdb_alerts

Request

Example HTTP request

GET /bdbs/alerts/1/bdb_size 

Request headers

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted media type

URL parameters

FieldTypeDescription
uidintegerThe unique ID of the database
alertstringThe alert name

Response

Returns an alert object.

Example JSON body

{
    "enabled": true,
    "state": true,
    "threshold": "80",
    "severity": "WARNING",
    "change_time": "2014-08-29T11:19:49Z",
    "change_value": {
        "state": true,
        "threshold": "80",
        "memory_util": 81.2
    }
}

Status codes

CodeDescription
200 OKNo error
400 Bad RequestBad request
404 Not FoundSpecified alert or bdb does not exist

Update database alert

POST /v1/bdbs/alerts/{int: uid}

Updates a database’s alerts configuration.

Required permissions

Permission name
update_bdb_alerts

Request

If passed with the dry_run URL query string, the function will validate the alert thresholds, but not commit them.

Example HTTP request

POST /bdbs/alerts/1 

Example JSON body

{
     "bdb_size":{
         "threshold":"80",
         "enabled":true
     },
     "bdb_high_syncer_lag":{
         "threshold":"",
         "enabled":false
     },
     "bdb_low_throughput":{
         "threshold":"1",
         "enabled":true
     },
     "bdb_high_latency":{
         "threshold":"3000",
         "enabled":true
     },
     "bdb_high_throughput":{
         "threshold":"1",
         "enabled":true
     },
     "bdb_backup_delayed":{
         "threshold":"1800",
         "enabled":true
     }
}

Request headers

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted media type

URL parameters

FieldTypeDescription
uidintegerDatabase ID
dry_runstringValidate the alert thresholds but do not apply them

Request body

The request must contain a single JSON object with one or many database alert objects.

Response

The response includes the updated database alerts.

Status codes

CodeDescription
404 Not FoundSpecified database was not found.
406 Not AcceptableInvalid configuration parameters provided.
200 OKSuccess, database alerts updated.