审计数据库连接请求
审计数据库连接请求
Redis 企业软件 |
---|
方法 | 路径 | 描述 |
---|---|---|
获取 | /v1/cluster/auditing/db_conns |
获取数据库连接审核设置 |
放 | /v1/cluster/auditing/db_conns |
更新数据库连接审核设置 |
删除 | /v1/cluster/auditing/db_conns |
删除数据库连接审核设置 |
获取数据库审核设置
GET /v1/cluster/auditing/db_conns
获取用于审计数据库连接的配置设置。
所需权限
权限名称 |
---|
view_cluster_info |
请求
HTTP 请求示例
GET /v1/cluster/auditing/db_conns
请求标头
钥匙 | 价值 | 描述 |
---|---|---|
主机 | cnm.cluster.fqdn 中 | 域名 |
接受 | 应用程序/JSON | 接受的媒体类型 |
响应
返回数据库连接审计配置对象。
示例 JSON 正文
{
"audit_address": "127.0.0.1",
"audit_port": 12345,
"audit_protocol": "TCP",
"audit_reconnect_interval": 1,
"audit_reconnect_max_attempts": 0
}
Error codes
When errors are reported, the server may return a JSON object with error_code
and message
fields that provide additional information. The following are possible error_code
values:
Code
Description
db_conns_auditing_unsupported_by_capability
Not all nodes support DB Connections Auditing capability
Status codes
Code
Description
200 OK
Success
406 Not Acceptable
Feature not supported for all nodes
Update database auditing
PUT /v1/cluster/auditing/db_conns
Updates the configuration settings for auditing database connections.
Required permissions
Permission name
update_cluster
Request
Example HTTP request
PUT /v1/cluster/auditing/db_conns
Example JSON body
{
"audit_protocol": "TCP",
"audit_address": "127.0.0.1",
"audit_port": 12345,
"audit_reconnect_interval": 1,
"audit_reconnect_max_attempts": 0
}
Request headers
Key
Value
Description
Host
cnm.cluster.fqdn
Domain name
Accept
application/json
Accepted media type
Request body
Include a database connection auditing configuration object with updated fields in the request body.
Response
Returns the updated database connection auditing configuration object.
Example JSON body
{
"audit_address": "127.0.0.1",
"audit_port": 12345,
"audit_protocol": "TCP",
"audit_reconnect_interval": 1,
"audit_reconnect_max_attempts": 0
}
Error codes
When errors are reported, the server may return a JSON object with error_code
and message
fields that provide additional information. The following are possible error_code
values:
Code
Description
db_conns_auditing_unsupported_by_capability
Not all nodes support DB Connections Auditing capability
Status codes
Code
Description
200 OK
Success
406 Not Acceptable
Feature not supported for all nodes
Delete database auditing settings
DELETE /v1/cluster/auditing/db_conns
Resets the configuration settings for auditing database connections.
Required permissions
Permission name
update_cluster
Request
Example HTTP request
DELETE /v1/cluster/auditing/db_conns
Request headers
Key
Value
Description
Host
cnm.cluster.fqdn
Domain name
Accept
application/json
Accepted media type
Response
Returns a status code that indicates whether the database connection auditing settings reset successfully or failed to reset.
Error codes
When errors are reported, the server may return a JSON object with error_code
and message
fields that provide additional information. The following are possible error_code
values:
Code
Description
db_conns_audit_config_not_found
Unable to find the auditing configuration
cannot_delete_audit_config_when_policy_enabled
Auditing cluster policy is 'enabled' when trying to delete the auditing configuration
cannot_delete_audit_config_when_bdb_enabled
One of the databases has auditing configuration 'enabled' when trying to delete the auditing configuration
Status codes
Code
Description
200 OK
Success
404 Not Found
Configuration not found
406 Not Acceptable
Feature not supported for all nodes
On this page