Overview
Query the configuration details of the SQL audit service for a specified OceanBase Cloud database instance. The response includes the status of the SQL audit service, data retention policy, storage capacity configuration, access address type, and related tenant-level filter rules. This API is used to obtain the current operational status and resource configuration of the SQL audit feature, helping you understand and manage the audit service.
API details
Constraints
The caller must have an AccessKey to access the multi-cloud API. For information about how to obtain the AccessKey ID and AccessKey Secret, see Manage AccessKeys.
Request path
GET /api/v2/instances/{instanceId}/sqlaudit/info
Request parameters
Path
Name |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| instanceId | String | Yes | OceanBase Cloud instance ID. | obcluster-***** |
Query
Name |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| openRequest | String | Yes | Open request parameter. | None |
Response parameters
Name |
Type |
Description |
Example value |
|---|---|---|---|
| success | Boolean | Indicates whether the request was successful. | true |
| errorCode | String | Error code. | INVALID_PARAMETER |
| errorMessage | String | Error message. | Invalid parameter |
| data | Array | Business data (object). | None |
| cost | Number | Time consumed. | 1.0 |
| server | String | Server address, typically the IP address of an OBServer node. | 10.0.0.10 |
| requestId | String | Request ID. | d04eabba**** |
| totalCount | Number | Total number of records. | 100.0 |
| extra | Object | Extended information. | {} |
data[] object fields
Name |
Type |
Description |
Example value |
|---|---|---|---|
| tenantId | String | Tenant ID. | t4louaeei**** |
| status | String | Current task or resource status. | ONLINE |
| retentionTime | Integer | Data retention period. | 30 |
| hotDays | Integer | Hot data retention period, in days. | 7 |
| serviceType | String | Address type. | PRIVATE |
| hotStorageSize | Integer | Hot data storage capacity. | 200 |
| coldStorageSize | Integer | Cold data storage capacity. | 200 |
| tenantName | String | Tenant name. | xxxxxx |
| filterRule | Object | Filter rule. | None |
| filterRule.allUsers | Boolean | Indicates whether all users are included. | true |
| filterRule.users | Array | User list. | ['admin'] |
| filterRule.auditResult | String | Audit result. | example-value |
| filterRule.sqlTypes | Array | SQL statement types. | [{'id': 'resource-123456'}] |
| supported | Boolean | Indicates whether sensitive-field protection rules are supported for the tenant. | true |
| disabledReason | String | Reason the feature is disabled. | example-value |
Examples
Request example
curl --digest -u '<Your AccessKey ID:AccessKey Secret>' \
-X GET \
'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/sqlaudit/info?openRequest=open'
Response example
JSON format
{
"success": true,
"errorCode": "INVALID_PARAMETER",
"errorMessage": "Invalid parameter",
"data": [
{
"tenantId": "t4louaeei****",
"status": "ONLINE",
"retentionTime": 30,
"hotDays": 7,
"serviceType": "PRIVATE",
"hotStorageSize": 200,
"coldStorageSize": 200,
"tenantName": "xxxxxx",
"filterRule": {
"allUsers": true,
"users": "---\n- \"admin\"",
"auditResult": "example-value",
"sqlTypes": [
{}
]
},
"supported": true,
"disabledReason": "example-value"
}
],
"cost": 1.0,
"server": "xxx.xxx.x.xxx:xxx",
"requestId": "d04eabba****",
"totalCount": 100.0,
"extra": "{}"
}
