Deleting a SQL Inspection Rule
Function
This API is used to delete a SQL inspection rule.
Authorization
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 the required permissions in Introduction.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependency
dli:sqldefendrule:delete
Write
-
-
-
-
URI
DELETE /v1/{project_id}/sql-defend-rules/{rule_id}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID, which is used for resource isolation. For details about how to obtain its value, see Obtaining a Project ID. Constraints None Range The value can contain up to 64 characters. Only letters and digits are allowed. Default Value None |
| rule_id | Yes | String | Definition Rule ID. For details, see the rule ID in Table 2. Constraints None Range For details about the enumerated values, see Table 2.
Default Value None |
| Rule ID | Rule Name | Description | Category | Applicable Engine | Action | Value | Default System Rule | Example SQL Statement | Supported Engine Version |
|---|---|---|---|---|---|---|---|---|---|
| dynamic_0001 | Scan files number | Maximum number of files to be scanned. | dynamic | spark | Hint Intercept | Value range: 1–2000000 Default value: 200000 | Yes | NA | Spark 3.3.1 |
| dynamic_0002 | Scan partitions number | Maximum number of partitions involved in the operations (select, delete, update, and alter) that can be performed on a table. | dynamic | spark | Hint Intercept | Value range: 1–500000 Default value: 5000 | Yes | select * from Partitioned table | Spark 3.3.1 |
| running_0002 | Memory used(MB) | Peak memory usage of the SQL statement. | running | spark | Block | Value range: 1–8388608 | No | NA | Spark 3.3.1 |
| running_0003 | Run time(S) | Maximum running duration of the SQL statement. | running | spark | Block | Unit: second Value range: 1–43200 | No | NA | Spark 3.3.1 |
| running_0004 | Scan data(GB) | Maximum amount of data to be scanned. | running | spark | Block | Unit: GB Value range: 1–10240 | No | NA | Spark 3.3.1 |
| running_0005 | Shuffle data(GB) | Maximum amount of data to be shuffled. | running | spark | Block | Unit: GB Value range: 1–10240 Default value: 2048 | Yes | NA | Spark 3.3.1 Spark 2.4.5 |
| static_0001 | Count(distinct) occurrences | Maximum number of occurrences of count(distinct) in the SQL statement. | static | spark | Hint Intercept | Value range: 1–100 Default value: 10 | Yes | SELECT COUNT(DISTINCT deviceId), COUNT(DISTINCT collDeviceId) FROM table GROUP BY deviceName, collDeviceName, collCurrentVersion; | Spark 3.3.1 |
| static_0002 | Not in<Subquery> | Check whether not in <subquery> is used in the SQL statement. | static | spark | Hint Intercept | Value range: Yes or No Default value: Yes | Yes | SELECT * FROM Orders o WHERE Orders.Order_ID not in (Select Order_ID FROM HeldOrders h where h.order_id = o.order_id); | Spark 3.3.1 |
| static_0003 | Join occurrences | Maximum number of joins in the SQL statement. | static | spark | Hint Intercept | Value range: 1–50 | No | SELECT name, text FROM table_1 JOIN table_2 ON table_1.Id = table_2.Id | Spark 3.3.1 |
| static_0004 | Union occurrences | Maximum number of union all times in the SQL statement. | static | spark | Hint Intercept | Value range: 1–100 | No | select * from tables t1 union all select * from tables t2 union all select * from tables t3 | Spark 3.3.1 |
| static_0005 | Subquery nesting layers | Maximum number of subquery nesting layers. | static | spark | Hint Intercept | Value range: 1–20 | No | select * from ( with temp1 as (select * from tables) select * from temp1); | Spark 3.3.1 |
| static_0006 | Sql size(KB) | Maximum size of a SQL file. | static | spark | Hint Intercept | Unit: KB Value range: 1–1024 | No | NA | Spark 3.3.1 |
| static_0007 | Cartesian product | Limitation of Cartesian products when multiple tables are being associated. | static | spark | Hint Intercept | Value range: 0–1 | No | select * from A,B; | Spark 3.3.1 |
Request Parameters
None
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| is_success | Boolean | Whether the request is successfully executed. true indicates that the request is successfully executed. |
| message | String | System prompt. If the execution succeeds, this parameter may be left blank. |
Example Request
None
Example Response
None
Status Codes
| Status Code | Description |
|---|---|
| 201 | The rule is successfully deleted. |
| 400 | Request error. |
| 500 | Internal server error. |
Error Codes
If an error occurs when this API is called, the system does not return the result similar to the preceding example, but returns an error code and error message. For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot