Updated on 2024-01-15 GMT+08:00

Querying the Audit Scope Policy List

Function

This API is used to query the audit scope policy list.

URI

GET /v1/{project_id}/{instance_id}/dbss/audit/rule/scopes

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

instance_id

Yes

String

Instance ID

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

No

String

Offset

limit

No

String

Number of query records

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

scopes

Array of RuleScopeInfo objects

Audit scope rule list

total

Integer

Total

Table 5 RuleScopeInfo

Parameter

Type

Description

id

String

Audit scope rule ID

name

String

Audit scope name

action

String

Actions in the audit scope [REVOKE,DROP_TABLE,SELECT_FOR_UPDATE,SELECT,ROLLBACK,CREATE_TABLESPACE,DELETE,GRANT,DROP_USER,DROP_TABLESPACE,UPDATE,INSERT,CREATE_USER,CREATE_TABLE,LOGIN]

status

String

Audit scope rule status [Enabled,Disabled]

exception_ips

String

Exception IP address of the audit scope

source_ips

String

Source IP address of the audit scope rule

source_ports

String

Port of the audit scope rule

db_ids

String

Database ID

db_names

String

Database name

db_users

String

Database account

all_audit

Boolean

Full audit or not

true : Full audit

false : not Full audit

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error

Object

Error message.

Table 7 ErrorDetail

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error information.

Status code: 403

Table 8 Response body parameters

Parameter

Type

Description

error

Object

Error message.

Table 9 ErrorDetail

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error information.

Status code: 500

Table 10 Response body parameters

Parameter

Type

Description

error

Object

Error message.

Table 11 ErrorDetail

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error information.

Example Requests

/v1/{project_id}/{instance_id}/dbss/audit/rule/scopes

Example Responses

Status code: 200

Success

{
  "scopes" : [ {
    "id" : "zX4W2ngBo47GiyUSBuNs",
    "name" : "Full audit rule",
    "action" : "",
    "status" : "ON",
    "exception_ips" : "",
    "source_ips" : "",
    "source_ports" : "",
    "db_ids" : "",
    "db_names" : "",
    "db_users" : "",
    "all_audit" : true
  } ],
  "total" : 1
}

Status code: 400

Invalid parameter.

{
  "error" : {
    "error_code" : "DBSS.XXXX",
    "error_msg" : "XXX"
  }
}

Status code: 500

Internal server error.

{
  "error" : {
    "error_code" : "DBSS.XXXX",
    "error_msg" : "XXX"
  }
}

Status Codes

Status Code

Description

200

Success

400

Invalid parameter.

403

Authentication failed.

500

Internal server error.

Error Codes

See Error Codes.