content/operate/rs/references/rest-api/requests/cluster/auditing-db-conns.md
| Method | Path | Description |
|---|---|---|
| GET | /v1/cluster/auditing/db_conns | Get database connection auditing settings |
| PUT | /v1/cluster/auditing/db_conns | Update database connection auditing settings |
| DELETE | /v1/cluster/auditing/db_conns | Delete database connection auditing settings |
GET /v1/cluster/auditing/db_conns
Gets the configuration settings for [auditing database connections]({{< relref "/operate/rs/security/audit-events" >}}).
| Permission name |
|---|
| [view_cluster_info]({{< relref "/operate/rs/references/rest-api/permissions#view_cluster_info" >}}) |
GET /v1/cluster/auditing/db_conns
| Key | Value | Description |
|---|---|---|
| Host | cnm.cluster.fqdn | Domain name |
| Accept | application/json | Accepted media type |
Returns a [database connection auditing configuration object]({{< relref "/operate/rs/references/rest-api/objects/db-conns-auditing-config" >}}).
{
"audit_address": "127.0.0.1",
"audit_port": 12345,
"audit_protocol": "TCP",
"audit_reconnect_interval": 1,
"audit_reconnect_max_attempts": 0
}
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 |
| Code | Description |
|---|---|
| 200 OK | Success |
| 406 Not Acceptable | Feature not supported for all nodes |
PUT /v1/cluster/auditing/db_conns
Updates the configuration settings for [auditing database connections]({{< relref "/operate/rs/security/audit-events" >}}).
| Permission name |
|---|
| [update_cluster]({{< relref "/operate/rs/references/rest-api/permissions#update_cluster" >}}) |
PUT /v1/cluster/auditing/db_conns
{
"audit_protocol": "TCP",
"audit_address": "127.0.0.1",
"audit_port": 12345,
"audit_reconnect_interval": 1,
"audit_reconnect_max_attempts": 0
}
| Key | Value | Description |
|---|---|---|
| Host | cnm.cluster.fqdn | Domain name |
| Accept | application/json | Accepted media type |
Include a [database connection auditing configuration object]({{< relref "/operate/rs/references/rest-api/objects/db-conns-auditing-config" >}}) with updated fields in the request body.
Returns the updated [database connection auditing configuration object]({{< relref "/operate/rs/references/rest-api/objects/db-conns-auditing-config" >}}).
{
"audit_address": "127.0.0.1",
"audit_port": 12345,
"audit_protocol": "TCP",
"audit_reconnect_interval": 1,
"audit_reconnect_max_attempts": 0
}
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 |
| Code | Description |
|---|---|
| 200 OK | Success |
| 406 Not Acceptable | Feature not supported for all nodes |
DELETE /v1/cluster/auditing/db_conns
Resets the configuration settings for [auditing database connections]({{< relref "/operate/rs/security/audit-events" >}}).
| Permission name |
|---|
| [update_cluster]({{< relref "/operate/rs/references/rest-api/permissions#update_cluster" >}}) |
DELETE /v1/cluster/auditing/db_conns
| Key | Value | Description |
|---|---|---|
| Host | cnm.cluster.fqdn | Domain name |
| Accept | application/json | Accepted media type |
Returns a status code that indicates whether the database connection auditing settings reset successfully or failed to reset.
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 |
| Code | Description |
|---|---|
| 200 OK | Success |
| 404 Not Found | Configuration not found |
| 406 Not Acceptable | Feature not supported for all nodes |