Creating a Rule Group
Function
This API is used to create a rule group.
Calling Method
For details, see Calling APIs.
URI
POST /v1/{project_id}/security/data-classification/rule/group
| 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. |
Request 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. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | Yes | String | Rule name |
| rule_ids | Yes | Array of strings | Rule ID list |
| description | No | String | Rule group description |
| create_rules | No | Array of DataClassificationGroupCombineRuleDTO objects | Rules to be created |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | Yes | String | Rule name |
| secrecy_level_id | Yes | String | Security level ID |
| combine_expression | Yes | String | Condition expression |
| description | No | String | Rule description |
| category_id | No | String | Classification ID |
| enable | No | Boolean | Enabling status |
| method | Yes | String | Rule method, which is COMBINE |
| single_expressions | Yes | Array of DataClassificationSingleRuleDTO objects | Single expressions |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| rule_code | Yes | String | Rule No., in uppercase letters |
| algorithm_type | Yes | String | Algorithm type, which can be REGEX, REGEX_INSENSITIVE, GROOVY, LENGTH_EQ, LENGTH_GT, LENGTH_LT, or BUILTIN |
| match_type | Yes | String | Matching type, which can be CONTENT, COLUMN, COMMIT, TABLE_NAME, TABLE_COMMENT, or DATABASE_NAME |
| expression | Yes | String | expression |
| builtin_rule_id | No | String | Built-in rule ID |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| uuid | String | Rule group ID. |
| name | String | Rule group name. |
| rules | Array of DataClassificationRuleQueryDTO objects | Rule entity. |
| description | String | Rule group description. |
| created_by | String | Rule group creator. |
| created_at | Long | Time when a rule group is created. |
| updated_by | String | Person who updates a rule group. |
| updated_at | Long | Time when a rule group is updated. |
| project_id | String | Project ID. |
| Parameter | Type | Description |
|---|---|---|
| uuid | String | Rule ID. |
| rule_type | String | Rule type. The options are CUSTOM and BUILTIN. |
| secrecy_level | String | Security level name. |
| secrecy_level_num | Long | Confidentiality level. |
| name | String | Indicates the rule name. |
| guid | String | guid. |
| enable | Boolean | Indicates whether the rule is enabled. |
| method | String | Rule method. The value can be REGULAR, NONE, DEFAULT, or COMBINE. |
| content_expression | String | Content expression. |
| column_expression | String | Column expression. |
| commit_expression | String | Remarks expression. |
| combine_expression | String | Condition expression |
| project_id | String | Project ID. |
| description | String | Specifies the assignment description. |
| created_by | String | Policy creator. |
| created_at | Long | Time when a policy is created. |
| updated_by | String | Person who updates the policy. |
| updated_at | Long | Time when a policy is updated. |
| builtin_rule_id | String | ID of a built-in rule. |
| category_id | String | Category ID. |
| instance_id | String | Instance ID. |
| match_type | String | Match type. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error message. |
Example Requests
v1/0833a5737480d53b2f25c010dc1a7b88/security/data-classification/rule/group
{
"name" : "Special_Administrative_Region_test",
"description" : "testModifyDes",
"rule_ids" : [ "250f1e5f6cd3d48fd4d10dbd0f94f533" ]
} Example Responses
Status code: 200
ok
{
"created_at" : 1697600262611,
"created_by" : "ei_dayu_test_01",
"description" : "test",
"name" : "test_rule_group",
"project_id" : "0833a5737480d512fa51w010dc1a7b88",
"rules" : null,
"updated_at" : 1697600262611,
"updated_by" : "ei_dayu_test_01",
"uuid" : "8a125fdsesa0b421012saed35c770004"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | ok |
| 400 | Bad Request |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.