Queries the details of a specified protection rule.

Description

You can call this operation up to 20 times per second per account.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeDcdnWafRule

The operation that you want to perform. Set the value to DescribeDcdnWafRule.

RuleId Long Yes 1000001

The ID of the protection rule. You can specify only one ID in each request.

Response parameters

Parameter Type Example Description
RequestId String 66A98669-CC6E-4F3E-80A6-3014697B11AE

The ID of the request.

Rule Object

The information about the protection rule.

RuleStatus String on

The status of the protection rule. Valid values:

  • on
  • off
DefenseScene String custom_acl

The type of the protection policy. Valid values:

  • waf_group: basic web protection
  • custom_acl: custom
  • whitelist: whitelist
PolicyId Long 200001

The ID of the protection policy.

GmtModified String 2021-12-29T17:08:45Z

The time at which the protection rule was modified. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

RuleId Long 100001

The ID of the protection rule.

RuleName String rule_1

The name of the protection rule.

RuleConfig String {\"action\":\"monitor\",\"actionExternal\":\"{}\",\"ccStatus\":1,\"conditions\":[{\"key\":\"URL\",\"opValue\":\"eq\",\"targetKey\":\"request_uri\",\"values\":\"/example\"},{\"key\":\"Header\",\"opValue\":\"eq\",\"subKey\":\"trt\",\"targetKey\":\"header.trt\",\"values\":\"3333\"}],\"effect\":\"service\",\"name\":\"aaa333\",\"origin\":\"custom\",\"ratelimit\":{\"interval\":5,\"status\":{\"code\":404,\"count\":2,\"stat\":{\"mode\":\"count\",\"value\":2.0}},\"target\":\"remote_addr\",\"threshold\":2,\"ttl\":1800}}

The configurations of the protection rule.

Examples

Sample requests

http(s)://dcdn.aliyuncs.com/?Action=DescribeDcdnWafRule
&RuleId=1000001
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeDcdnWafRuleResponse>
    <Rule>
        <GmtModified>2021-12-29T17:08:45Z</GmtModified>
        <PolicyId>200001</PolicyId>
        <RuleId>100001</RuleId>
        <RuleName>rule_1</RuleName>
        <RuleStatus>on</RuleStatus>
        <RuleConfig>{"action":"monitor","actionExternal":"{}","ccStatus":1,"conditions":[{"key":"URL","opValue":"eq","targetKey":"request_uri","values":"/example"},{"key":"Header","opValue":"eq","subKey":"trt","targetKey":"header.trt","values":"3333"}],"effect":"service","name":"aaa333","origin":"custom","ratelimit":{"interval":5,"status":{"code":404,"count":2,"stat":{"mode":"count","value":2.0}},"target":"remote_addr","threshold":2,"ttl":1800}}</RuleConfig>
        <DefenseScene>custom_acl</DefenseScene>
    </Rule>
    <RequestId>66A98669-CC6E-4F3E-80A6-3014697B11AE</RequestId>
</DescribeDcdnWafRuleResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Rule" : {
    "GmtModified" : "2021-12-29T17:08:45Z",
    "PolicyId" : 200001,
    "RuleId" : 100001,
    "RuleName" : "rule_1",
    "RuleStatus" : "on",
    "RuleConfig" : "{\"action\":\"monitor\",\"actionExternal\":\"{}\",\"ccStatus\":1,\"conditions\":[{\"key\":\"URL\",\"opValue\":\"eq\",\"targetKey\":\"request_uri\",\"values\":\"/example\"},{\"key\":\"Header\",\"opValue\":\"eq\",\"subKey\":\"trt\",\"targetKey\":\"header.trt\",\"values\":\"3333\"}],\"effect\":\"service\",\"name\":\"aaa333\",\"origin\":\"custom\",\"ratelimit\":{\"interval\":5,\"status\":{\"code\":404,\"count\":2,\"stat\":{\"mode\":\"count\",\"value\":2.0}},\"target\":\"remote_addr\",\"threshold\":2,\"ttl\":1800}}",
    "DefenseScene" : "custom_acl"
  },
  "RequestId" : "66A98669-CC6E-4F3E-80A6-3014697B11AE"
}

Error codes

HTTP status code Error code Error message Description
400 InvalidParameter The specified parameter is invalid. The error message returned because the specified parameter value is invalid.

For a list of error codes, visit the API Error Center.