Updated on 2025-11-17 GMT+08:00

Querying Dynamic Data Masking Policies

Function

This API is used to query dynamic data masking policies.

Calling Method

For details, see Calling APIs.

URI

GET /v1/{project_id}/security/masking/dynamic/policies

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Project ID and Account ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

Number of items displayed on each page

offset

No

Integer

Offset, which is the position where the query starts. The value must be greater than or equal to 0.

name

No

String

Name of a dynamic masking policy.

cluster_name

No

String

Cluster Name

database_name

No

String

Database name

table_name

No

String

Table name

order_by

No

String

Sorting parameter, for example, UPDATE_TIME

order_by_asc

No

Boolean

Whether to sort results in ascending order. This parameter is valid only when the sorting parameter is specified.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

workspace

Yes

String

Workspace ID. For details about how to obtain the workspace ID, see Instance ID and Workspace ID.

X-Auth-Token

Yes

String

IAM token, which is obtained by calling the IAM API for obtaining a user token (value of X-Subject-Token in the response header). This parameter is mandatory for token authentication.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total

Integer

Total number of dynamic data masking policies

policies

Array of DynamicMaskingPolicySet objects

List of dynamic data masking policies

Table 5 DynamicMaskingPolicySet

Parameter

Type

Description

id

String

ID of a dynamic masking policy

name

String

Name of a dynamic masking policy. The value must start with a letter and can contain 2 to 64 characters, including letters, digits, and underscores (_).

datasource_type

String

Data Source Type

  • Hive

  • GaussDB(DWS)

  • DLI

cluster_id

String

Cluster ID You can obtain the cluster ID on the cluster management page. When the data source type is DLI, set this parameter to DLI.

cluster_name

String

Cluster name. You can obtain the cluster name on the cluster management page. When the data source type is DLI, set this parameter to DLI.

database_name

String

Database name. For details about how to obtain the data source, see Obtaining Tables in the Data Source.

table_name

String

Data table name. For details about how to obtain the data table name, see Obtaining Tables in the Data Source.

user_groups

String

List of user groups. User group names are separated by commas (,). This parameter is optional, but either this parameter or users must be set. An example value is "userGroup1,userGroup2".

users

String

List of users. Usernames are separated by commas (,). This parameter is optional, but either this parameter or user_groups must be set. An example value is "user1,user2".

sync_status

String

Synchronization status.

  • UNKNOWN: unknown status

  • NOT_SYNC: unsynchronized

  • SYNCING: synchronizing

  • SYNC_SUCCESS: synchronized successfully

  • SYNC_FAIL: synchronization failed

  • SYNC_PARTIAL_FAIL: synchronization partially failed

  • DELETE_FAIL: deletion failed

  • DELETING: deleting

  • UPDATING: updating

  • DATA_UPDATED: data updated

sync_time

Long

Policy synchronization time

sync_msg

String

Policy synchronization log

create_time

Long

Time when the policy was created

create_user

String

User who created the policy

update_time

Long

Policy update time

update_user

String

User who updated the policy

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

None

Example Responses

Status code: 200

OK

{
  "policies" : [ {
    "cluster_id" : "ec26b187-626a-4e89-bd1f-6824fbcfb2b6",
    "cluster_name" : "mrs_noauth_autotest_do_not_del",
    "create_time" : 1715671906000,
    "create_user" : "ei_dayu_xxxx_01",
    "database_name" : "dls_property",
    "datasource_type" : "HIVE",
    "id" : "fa0adf4b660fe1a61abc7f990974537e",
    "name" : "test100",
    "sync_msg" : "",
    "sync_status" : "NOT_SYNC",
    "sync_time" : 1715756630000,
    "table_name" : "test100",
    "update_time" : 1715915649000,
    "update_user" : "ei_dayu_xxxx_01",
    "user_groups" : "yrc,fanxianggen_test",
    "users" : "autotest_tics,cdos_test"
  } ],
  "total" : 1
}

Status Codes

Status Code

Description

200

OK

400

Bad Request