Queries the details of a 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 |
The ID of the WAF instance. Note
Call the DescribeInstance operation to query the WAF instance ID. |
waf_cdnsdf3**** |
| TemplateId |
integer |
No |
The ID of the protection template. Note
This parameter is required only when DefenseType is set to template. |
10318 |
| RuleId |
integer |
Yes |
The ID of the protection rule. |
20026192 |
| DefenseType |
string |
No |
The type of the protection rule. Valid values:
Valid values:
|
template |
| RegionId |
string |
No |
The region of the WAF instance. Valid values:
|
cn-hangzhou |
| ResourceManagerResourceGroupId |
string |
No |
The ID of the Alibaba Cloud resource group. |
rg-acfm***q |
| Resource |
string |
No |
The protected object for the rule. Note
This parameter is required only when DefenseType is set to resource. |
rencs***-waf |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The data returned. |
||
| RequestId |
string |
The request ID. |
D7861F61-5B61-46CE-A47C-6B19160D5EB0 |
| Rule |
object |
The configurations of the protection rule, in a JSON string format. |
|
| 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, in a JSON string format. For more information, see the Protection rule parameters section in CreateDefenseRule. |
{\"status\":1,\"policyId\":1012,\"action\":\"block\"} |
| RuleId |
integer |
The ID of the protection rule. |
2732975 |
| DefenseScene |
string |
The protection scenario. If the DefenseType parameter is set to template, the valid values are:
If the DefenseType parameter is set to resource, the valid values are:
If the DefenseType parameter is set to global, the valid values are:
|
waf_group |
| GmtModified |
integer |
The time when the protection rule was 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 if the DefenseType parameter is set to template. |
9114 |
| Resource |
string |
The protected object to which the rule belongs. Note
This parameter is returned only if the DefenseType parameter 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.