content/operate/rs/7.22/references/rest-api/requests/bdbs/alerts.md
| Method | Path | Description |
|---|---|---|
| GET | /v1/bdbs/alerts | Get 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 /v1/bdbs/alerts
Get all alert states for all databases.
| Permission name |
|---|
| [view_all_bdbs_alerts]({{< relref "/operate/rs/7.22/references/rest-api/permissions#view_all_bdbs_alerts" >}}) |
GET /v1/bdbs/alerts
| Key | Value | Description |
|---|---|---|
| Host | cnm.cluster.fqdn | Domain name |
| Accept | application/json | Accepted media type |
Returns a hash of alert UIDs and the [alerts]({{< relref "/operate/rs/7.22/references/rest-api/objects/alert" >}}) states for each database.
{
"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
}
},
"..."
},
"..."
}
| Code | Description |
|---|---|
| 200 OK | No error |
GET /v1/bdbs/alerts/{int: uid}
Get all alert states for a database.
| Permission name |
|---|
| [view_bdb_alerts]({{< relref "/operate/rs/7.22/references/rest-api/permissions#view_bdb_alerts" >}}) |
GET /v1/bdbs/alerts/1
| Key | Value | Description |
|---|---|---|
| Host | cnm.cluster.fqdn | Domain name |
| Accept | application/json | Accepted media type |
Returns a hash of [alert objects]({{< relref "/operate/rs/7.22/references/rest-api/objects/alert" >}}) and their states.
{
"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
}
},
"..."
}
| Code | Description |
|---|---|
| 200 OK | No error |
| 404 Not Found | Specified bdb does not exist |
GET /v1/bdbs/alerts/{int: uid}/{alert}
Get a database alert state.
| Permission name |
|---|
| [view_bdb_alerts]({{< relref "/operate/rs/7.22/references/rest-api/permissions#view_bdb_alerts" >}}) |
GET /v1/bdbs/alerts/1/bdb_size
| Key | Value | Description |
|---|---|---|
| Host | cnm.cluster.fqdn | Domain name |
| Accept | application/json | Accepted media type |
| Field | Type | Description |
|---|---|---|
| uid | integer | The unique ID of the database |
| alert | string | The alert name |
Returns an [alert object]({{< relref "/operate/rs/7.22/references/rest-api/objects/alert" >}}).
{
"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
}
}
| Code | Description |
|---|---|
| 200 OK | No error |
| 400 Bad Request | Bad request |
| 404 Not Found | Specified alert or bdb does not exist |
POST /v1/bdbs/alerts/{int: uid}
Updates a database's alerts configuration.
| Permission name |
|---|
| [update_bdb_alerts]({{< relref "/operate/rs/7.22/references/rest-api/permissions#update_bdb_alerts" >}}) |
If passed with the dry_run URL query string, the function will validate the alert thresholds, but not commit them.
POST /v1/bdbs/alerts/1
{
"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
}
}
| Key | Value | Description |
|---|---|---|
| Host | cnm.cluster.fqdn | Domain name |
| Accept | application/json | Accepted media type |
| Field | Type | Description |
|---|---|---|
| uid | integer | Database ID |
| dry_run | string | Validate the alert thresholds but do not apply them |
The request must contain a single JSON object with one or many database [alert objects]({{< relref "/operate/rs/7.22/references/rest-api/objects/alert" >}}).
The response includes the updated database [alerts]({{< relref "/operate/rs/7.22/references/rest-api/objects/alert" >}}).
| Code | Description |
|---|---|
| 404 Not Found | Specified database was not found. |
| 406 Not Acceptable | Invalid configuration parameters provided. |
| 200 OK | Success, database alerts updated. |