Help Center/ Data Replication Service/ API Reference/ APIs V5.0/ Data Processing/ Obtaining Information About Data Filtering Rules
Updated on 2026-09-07 GMT+08:00

Obtaining Information About Data Filtering Rules

Function

This API is used to obtain information about data filtering rules.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permissions are required for calling this API.

URI

GET /v5/{project_id}/jobs/{job_id}/filter-rules/result

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID of a tenant in a region.

For details about how to obtain the project ID, see Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

job_id

Yes

String

Definition

Data migration task ID, which is used to specify the target task for which filtering rules are to be queried.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 2 Query parameters

Parameter

Mandatory

Type

Description

query_id

No

String

Definition

ID of the request for querying data filtering rules, which is used to associate with the previously submitted request for querying filtering verification.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

No

String

Definition

MIME type of the request body. Use the default value application/json. For APIs used to upload objects or images, the value varies depending on the flow type.

Constraints

N/A

Range

application/json

Default Value

application/json

X-Auth-Token

Yes

String

Definition

User token obtained from IAM. It is a response to the API for obtaining a user token. This API is the only one that does not require authentication. The token is the value of X-Subject-Token in the response header.

Constraints

N/A

Range

N/A

Default Value

N/A

X-Language

No

String

Definition

Request language type.

Constraints

Specify the request language type based on the supported languages.

Range

  • en-us: English
  • zh-cn: Chinese
  • es-us: Spanish
  • pt-br: Portuguese

Default Value

en-us

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total_count

Long

Definition

Total number.

Constraints

N/A

Range

N/A

rules

Array of objects

Definition

List of data filtering rules.

For details, see Table 5.

Constraints

N/A

Range

N/A

status

String

Definition

Progress of the filtering rule query.

Constraints

N/A

Range

N/A

Table 5 DataFilterRuleResp

Parameter

Type

Description

batch_id

Long

Definition

Batch ID of a data filtering rule, which identifies multiple filtering objects in the same batch as belonging to the same rule configuration.

Constraints

N/A

Range

N/A

filter_object_list

Array of objects

Definition

List of objects to be filtered. All database objects that require data filtering under this rule are listed.

For details, see Table 6.

filter_rules_resp

object

Definition

Response body for common data filtering criteria, which includes the SQL filtering condition expressions of the source and destination databases.

For details, see Table 7.

advanced_setting_resp

object

Definition

Response body for advanced filtering information. When the filtering rule involves fine-grained filtering at the database/table/column level, additional configuration parameters (such as indexes, primary keys, and custom values) are returned.

For details, see Table 8.

Table 6 DataFilterObjectResp

Parameter

Type

Description

batch_id

Long

Definition

Batch ID of the data filtering object information, which is associated with the batch_id of the parent DataFilterRuleResp and is used to trace the batch to which the object belongs.

Constraints

N/A

Range

N/A

id

String

Definition

Unique identifier of a data filtering object, which is generated based on the object hierarchy (such as the database name, table name, and object type).

Constraints

N/A

Range

N/A

parent_id

String

Definition

Identifier of the parent filtering object, which is used to indicate the hierarchical relationship between objects (for example, a column belongs to a table, and a table belongs to a database).

Constraints

N/A

Range

N/A

object_name

String

Definition

Name of a data filtering object. The value can be a database name, table name, or column name, depending on the value of object_type.

Constraints

N/A

Range

N/A

object_alias_name

String

Definition

Mapping name (alias) of a data filtering object. This parameter is used when the object name in the destination database is different from that in the source database.

Constraints

N/A

Range

N/A

object_type

String

Definition

Level type of a data filtering object, which identifies the granularity level of the current filtering rule.

Constraints

N/A

Range

N/A

db_name

String

Definition

Name of the database to which a data filtering object belongs.

Constraints

N/A

Range

N/A

schema_name

String

Definition

Name of the schema to which a data filtering object belongs.

Constraints

N/A

Range

N/A

table_name

String

Definition

Name of the table to which a data filtering object belongs.

Constraints

N/A

Range

N/A

is_data_filter

String

Definition

Whether data filtering is enabled for an object.

Constraints

N/A

Range

  • true: Data filtering is enabled.
  • false: Data filtering is disabled.

data_filter_type

String

Definition

Data filtering type, which identifies the filtering policy used.

Constraints

N/A

Range

N/A

filter_condition

String

Definition

Data filtering criteria.

Constraints

N/A

Range

N/A

is_synchronized

Boolean

Definition

Whether the data filtering criteria have been synchronized.

Constraints

N/A

Range

N/A

Table 7 GeneralDataFilterResp

Parameter

Type

Description

source_filter_condition

String

Definition

SQL expression for the source database filtering criteria.

Constraints

N/A

Range

N/A

target_filter_condition

String

Definition

SQL expression for the destination database filtering criteria.

Constraints

N/A

Range

N/A

condition_separated

String

Definition

Whether the source and destination database filtering criteria are configured separately.

Constraints

N/A

Range

N/A

Table 8 DataFilteringAdvancedSetting

Parameter

Type

Description

db_name

String

Definition

Database name.

Constraints

N/A

Range

N/A

table_name

String

Definition

Table name.

Constraints

N/A

Range

N/A

col_names

String

Definition

Column name.

Constraints

N/A

Range

N/A

prim_key_or_indexes

String

Definition

Primary key or unique index.

Constraints

N/A

Range

N/A

indexes

String

Definition

Index required for optimizing the query.

Constraints

N/A

Range

N/A

values

String

Definition

Filtering criteria.

Constraints

N/A

Range

N/A

Status code: 400

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code returned when an error occurs during task execution.

Constraints

  • Minimum length: 12 characters
  • Maximum length: 12 characters

Range

The format is DRS.XXXXXX.

error_msg

String

Definition

Detailed error description returned when a task fails to be executed.

Constraints

  • Minimum length: 1 character
  • Maximum length: 512 characters

Range

N/A

Example Request

Obtaining information about data filtering rules

https://{endpoint}/v5/054ba152d480d55b2f5dc0069e7ddef0/jobs/c7debc9c-8e09-4a5d-8dd6-cc44f78jb20r/filter-rules/result?query_id=0eacda0b-9422-4535-8b62-537d1833638b

Example Response

Status code: 200

Response body for obtaining common data filtering rules

{ 
  "status" : "success", 
  "total_count" : 2, 
  "rules" : [ { 
    "batch_id" : 2, 
    "filter_object_list" : [ { 
      "batch_id" : "2", 
      "id" : "test_drs-*-*-mysql3-*-*---conditionFilter--", 
      "parent_id" : "test_drs-*-*-mysql3", 
      "object_type" : "column", 
      "object_name" : "--conditionFilter--", 
      "db_name" : "test_drs", 
      "schema_name" : null, 
      "table_name" : "mysql3", 
      "is_data_filter" : true, 
      "data_filter_type" : "contentConditionalFilter", 
      "filter_condition" : "id in (select id from test_drs.mysql5 where id > 1)" 
    } ], 
    "filter_rules_resp" : { 
      "data_filter_type" : "contentConditionalFilter", 
      "source_filter_condition" : "id in (select id from test_drs.mysql5 where id > 1)", 
      "target_filter_condition" : null, 
      "condition_separated" : false 
    }, 
    "advanced_setting_resp" : null 
  }, { 
    "batch_id" : 1, 
    "objectInfo" : [ { 
      "batch_id" : "1", 
      "id" : "test_drs-*-*-mysql1-*-*---conditionFilter--", 
      "parent_id" : "test_drs-*-*-mysql1", 
      "object_type" : "column", 
      "object_name" : "--conditionFilter--", 
      "db_name" : "test_drs", 
      "schema_name" : null, 
      "table_name" : "mysql3", 
      "is_data_filter" : true, 
      "data_filter_type" : "contentConditionalFilter", 
      "filter_condition" : "id in (select id from test_drs.mysql4 where id > 1)" 
    }, { 
      "batch_id" : "1", 
      "id" : "test_drs-*-*-mysql2-*-*---conditionFilter--", 
      "parent_id" : "test_drs-*-*-mysql2", 
      "object_type" : "column", 
      "object_name" : "--conditionFilter--", 
      "db_name" : "test_drs", 
      "schema_name" : null, 
      "table_name" : "mysql3", 
      "is_data_filter" : true, 
      "data_filter_type" : "contentConditionalFilter", 
      "filter_condition" : "id in (select id from test_drs.mysql4 where id > 1)" 
    } ], 
    "filter_rules_resp" : { 
      "source_filter_condition" : "id in (select id from test_drs.mysql4 where id > 1)", 
      "target_filter_condition" : null, 
      "condition_separated" : false 
    }, 
    "configTransformation" : null 
  } ] 
}

Status code: 400

Bad Request

{ 
  "error_code" : "DRS.10000010", 
  "error_msg" : "Job does not exist, please check job ID." 
}

Status Code

Status Code

Description

200

OK

400

Bad Request

For other statuses, see Status Code.

Error Code

For details, see Error Code.