Queries a single protection rule.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
yundun-waf:DescribeDefenseRule |
get |
*All Resource
|
|
None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
Instance ID of the WAF instance. Note
You can call the DescribeInstance operation to query instance ID of your current WAF instance. |
waf_cdnsdf3**** |
| TemplateId |
integer |
No |
The ID of the protection template to query. Note
This parameter is required only when DefenseType is set to template. |
10318 |
| RuleId |
integer |
Yes |
The ID of the protection rule to query. |
20026192 |
| DefenseType |
string |
No |
The type of the protection rule. Valid values:
|
template |
| RegionId |
string |
No |
The region where the WAF instance is deployed. Valid values:
|
cn-hangzhou |
| ResourceManagerResourceGroupId |
string |
No |
The ID of the Alibaba Cloud resource group. |
rg-acfm***q |
| Resource |
string |
No |
The protected object associated with the rule to query. Note
This parameter is required only when DefenseType is set to resource. |
rencs***-waf |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
D7861F61-5B61-46CE-A47C-6B19160D5EB0 |
| Rule |
object |
The rule configuration, which is a string converted from a JSON object constructed with a series of parameters. |
|
| Status |
integer |
The status of the protection rule. Valid values:
|
1 |
| DefenseOrigin |
string |
The origin of the protection rule. Valid values:
|
custom |
| Config |
string |
The details of the protection rule, which is a string converted from a JSON object constructed with a series of parameters. For more information, refer to the protection rule parameter description in CreateDefenseRule. |
{\"status\":1,\"policyId\":1012,\"action\":\"block\"} |
| RuleId |
integer |
The ID of the protection rule. |
2732975 |
| DefenseScene |
string |
The protection scenario. When the DefenseType parameter is set to template, valid values:
When the DefenseType parameter is set to resource, valid values:
When the DefenseType parameter is set to global, valid values:
|
waf_group |
| GmtModified |
integer |
The time when the protection rule was last modified. |
1665196746000 |
| RuleName |
string |
The name of the protection rule. |
test1 |
| TemplateId |
integer |
The ID of the protection rule template. Note
This parameter is returned only when DefenseType is set to template. |
9114 |
| Resource |
string |
The protected object to which the rule belongs. Note
This parameter is returned only when DefenseType is set to resource. |
rencs***-waf |
| DefenseType |
string |
The type of the protection rule. Valid values:
|
template |
Examples
Success response
JSON format
{
"RequestId": "D7861F61-5B61-46CE-A47C-6B19160D5EB0",
"Rule": {
"Status": 1,
"DefenseOrigin": "custom",
"Config": "{\\\"status\\\":1,\\\"policyId\\\":1012,\\\"action\\\":\\\"block\\\"}",
"RuleId": 2732975,
"DefenseScene": "waf_group",
"GmtModified": 1665196746000,
"RuleName": "test1",
"TemplateId": 9114,
"Resource": "rencs***-waf",
"DefenseType": "template"
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.