数据库警报请求
数据库警报请求
Redis 企业软件 |
---|
方法 | 路径 | 描述 |
---|---|---|
获取 | /v1/bdbs/alerts |
获取所有数据库的所有警报状态 |
获取 | /v1/bdbs/alerts/{uid} |
获取特定数据库的所有警报状态 |
获取 | /v1/bdbs/alerts/{uid}/{alert} |
获取特定的数据库警报状态 |
发布 | /v1/bdbs/alerts/{uid} |
更新数据库的警报配置 |
获取所有数据库警报
GET /v1/bdbs/alerts
获取所有数据库的所有警报状态。
所需权限
权限名称 |
---|
view_all_bdbs_alerts |
请求
HTTP 请求示例
GET /v1/bdbs/alerts
请求标头
钥匙 | 价值 | 描述 |
---|---|---|
主机 | cnm.cluster.fqdn 中 | 域名 |
接受 | 应用程序/JSON | 接受的媒体类型 |
响应
返回每个数据库的警报 UID 和警报状态的哈希值。
示例 JSON 正文
{
"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
Code
Description
200 OK
No 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 /v1/bdbs/alerts/1
Request headers
Key
Value
Description
Host
cnm.cluster.fqdn
Domain name
Accept
application/json
Accepted 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
Code
Description
200 OK
No error
404 Not Found
Specified 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 /v1/bdbs/alerts/1/bdb_size
Request headers
Key
Value
Description
Host
cnm.cluster.fqdn
Domain name
Accept
application/json
Accepted media type
URL parameters
Field
Type
Description
uid
integer
The unique ID of the database
alert
string
The 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
Code
Description
200 OK
No error
400 Bad Request
Bad request
404 Not Found
Specified 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 /v1/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
Key
Value
Description
Host
cnm.cluster.fqdn
Domain name
Accept
application/json
Accepted media type
URL parameters
Field
Type
Description
uid
integer
Database ID
dry_run
string
Validate 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
Code
Description
404 Not Found
Specified database was not found.
406 Not Acceptable
Invalid configuration parameters provided.
200 OK
Success, database alerts updated.
On this page