Queries protection rules by page.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
yundun-waf:DescribeDefenseRules | list |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
InstanceId | string | Yes | The ID of the Web Application Firewall (WAF) instance. Note
You can call the DescribeInstance operation to obtain the ID of the WAF instance.
| waf_cdnsdf3**** |
RuleType | string | No | The type of protection rule that you want to query. Valid values:
| whitelist |
Query | string | No | The query conditions. Specify a string that contains multiple parameters in the JSON format. Note
The results vary based on the query conditions. For more information, see the "Query parameters" section in this topic.
| {\\"name\\":\\"IP address blocking\_20220822\_10\\",\\"scene\\":\\"custom_acl\\",\\"templateId\\":5327} |
PageNumber | integer | No | The number of the page to return. Default value: 1. | 1 |
PageSize | integer | No | The number of entries to return on each page. Default value: 10. | 10 |
ResourceManagerResourceGroupId | string | No | The ID of the resource group. | rg-acfm***q |
RegionId | string | No | The region where the WAF instance resides. Valid values:
| cn-hangzhou |
Query parameters
Parameter description
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
name | String | No | test | The name of the protection rule that you want to query. You can specify this parameter to query a protection rule by using exact matching. |
nameId | String | No | test1 | The ID or name of the protection rule that you want to query. You can specify this parameter to query a protection rule by using fuzzy matching. |
nameLike | String | No | test.aliyundoc.c | The name of the protection rule that you want to query. You can specify this parameter to query a protection rule by using fuzzy matching. |
scene | String | No | waf_group | The scenario in which the protection rules that you want to query are used. You can specify this parameter to query the protection rules that are used in a specific scenario by using exact matching. For information about the valid values of this parameter, see the description of the DefenseScene parameter in the CreateDefenseRule topic. |
ruleId | Long | No | 33444 | The ID of the protection rule that you want to query. You can specify this parameter to query a protection rule by using exact matching. |
ruleIdIn | Array | No | [3334455643,345555] | The ID range of the protection rules that you want to query. You can specify this parameter to query multiple protection rules. Separate multiple protection rule IDs with commas (,). |
templateId | Long | No | 24354 | The ID of the protection rule template to which the protection rules that you want to query belong. You can specify this parameter to query protection rules in a specific protection rule template. |
orderBy | String | No | name | The method that you want to use to sort protection rules. Valid values:- name: sorts the protection rules by protection rule name.- gmtModified: sorts the protection rules by most recent modification time.- id: sorts the protection rules by protection rule ID.- templateId: sorts the protection rules by protection rule template ID. |
desc | Boolean | No | true | Specifies whether to sort the protection rules in ascending or descending order. Valid values:- false: sorts the protected objects in ascending order.- true: sorts the protected objects in descending order. |
Examples
{
"name": "test",
"nameId ": "test1,
"nameLike": "test.aliyundoc.c",
"nameIn": "test.aliyundoc.c",
"InstaneId": "test1.aliyundoc.com,test2.aliyundoc.com",
"templateId": 24354
}
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "80736FA5-FA87-55F6-AA69-C5477C6FE6D0",
"TotalCount": 2,
"Rules": [
{
"Config": "{\\\"policyId\\\":1012,\\\"action\\\":\\\"block\\\"}",
"DefenseOrigin": "custom",
"DefenseScene": "waf_group",
"GmtModified": 1665460629000,
"RuleId": 42755,
"RuleName": "rules_41",
"Status": 1,
"TemplateId": 5673
}
]
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|