Obtaining the Scan Rules of a Specified Identification Template
Function
This API is used to obtain the scan rules related to the template based on the specified template ID and project ID. Pagination query and multi-criteria query are supported, such as the keyword, category ID, and risk level.
Calling Method
For details, see Calling APIs.
URI
GET /v1/{project_id}/scan-templates/{template_id}/scan-rules
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID, which is used to identify a specific project. |
|
template_id |
Yes |
String |
Template ID, which is used to identify a specific scan template. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
offset |
No |
Integer |
Page number, which is used for pagination query. The default value is 0. |
|
limit |
No |
Integer |
Page size, which is used to limit the number of results returned on each page. The default value is 100. |
|
keyword |
No |
String |
Keyword of the sensitive information object name, which is used for fuzzy search. |
|
classification_ids |
No |
Array of strings |
Classification ID array, which is used to filter results. |
|
security_level_ids |
No |
Array of strings |
Risk level ID array, which is used to filter results. |
|
is_used |
No |
Boolean |
Whether to enable this function to filter results. |
|
rule_name |
No |
String |
Keyword of a rule name, which is used for fuzzy search. |
Request Parameters
None
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
total |
Long |
Total number of rules associated with the template. |
|
template_rules_list |
Array of TemplateRule objects |
Rule list, which contains the details of each rule. |
|
Parameter |
Type |
Description |
|---|---|---|
|
rule_id |
String |
Rule ID, which uniquely identifies a rule. |
|
project_id |
String |
Project ID, which is used to identify a specific project. |
|
rule_name |
String |
Rule name, which is used to identify and manage rules. |
|
template_id |
String |
Template ID, which is used to identify a specific scan template. |
|
classification_id |
String |
Classification and grading ID, which indicates the classification to which a rule belongs. |
|
security_level_id |
String |
Risk level ID, which indicates the risk level of a rule. |
|
security_level_name |
String |
Risk level name of a rule. |
|
security_level_color |
Integer |
Risk level color, which is displayed on the GUI. |
|
is_used |
Boolean |
Whether the rule is enabled. |
|
rule_description |
String |
Rule description, which briefly describes the rule function. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code, which uniquely identifies an error type. |
|
error_msg |
String |
Error information, which describes the error details. |
Example Requests
Query the associations between template rules.
GET /v1/{project_id}/scan-templates/{template_id}/scan-rules
Example Responses
Status code: 200
Request succeeded. Template rule associations are returned.
{
"template_rules_list" : [ {
"project_id" : "xxxxxxxxxxxx",
"template_id" : "xxxxxxxxxxxx",
"classification_id" : "xxxxxxxxxxxx",
"security_level_id" : "xxxxxxxxxxxx",
"security_level_name" : "L1",
"security_level_color" : 1,
"rule_id" : "xxxxxxxxxxxx",
"rule_name" : "xxxxxxxxxxxx",
"is_used" : true,
"rule_description" : "xxxxxxxxxxxx"
} ],
"total" : 1
}
Status code: 400
Invalid request. Incorrect parameter format or content.
{
"error_code" : "dsc.40000011",
"error_msg" : "Invalid parameter"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Request succeeded. Template rule associations are returned. |
|
400 |
Invalid request. Incorrect parameter format or content. |
Error Codes
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