Queries the forwarding rules of a website.

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 DescribeWebRules

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

RegionId String No cn-hangzhou

The region ID of the instance. Valid values:

  • cn-hangzhou: mainland China, which indicates an Anti-DDoS Pro instance. This is the default value.
  • ap-southeast-1: outside mainland China, which indicates an Anti-DDoS Premium instance.
ResourceGroupId String No rg-acfm2pz25js****

The ID of the resource group to which the instance belongs in Resource Management. This parameter is empty by default, which indicates that the instance belongs to the default resource group.

For more information about resource groups, see Create a resource group.

Domain String No www.aliyun.com

The domain name of the website that you want to query. If you do not specify this parameter, all domain names are queried.

Note A forwarding rule must be configured for the domain name. You can call the DescribeDomains operation to query the domain names for which forwarding rules are configured.
QueryDomainPattern String No fuzzy

The match mode. Valid values:

  • fuzzy: fuzzy match. This is the default value.
  • exact: exact match.
PageNumber Integer No 1

The number of the page to return. Pages start from page 1. Default value: 1.

PageSize Integer Yes 10

The number of entries to return on each page. Default value: 10.

InstanceIds.N String No ddoscoo-cn-i7m27nf3****

The ID of instance N.

Note You can call the DescribeInstanceIds operation to query the IDs of all instances.

All Alibaba Cloud API operations must include common request parameters. For more information about common request parameters, see Common parameters.

For more information about sample requests, see the "Examples" section of this topic.

Response parameters

Parameter Type Example Description
TotalCount Long 1

The total number of returned forwarding rules.

WebRules Array of WebRule

The details about the forwarding rule.

Domain String www.aliyun.com

The domain name of the website.

Http2HttpsEnable Boolean true

Indicates whether Enforce HTTPS Routing was turned on. Valid values:

  • true: The switch was turned on.
  • false: The switch was turned off.
CustomCiphers Array of String ECDHE-ECDSA-AES128-GCM-SHA256

The custom cipher suite.

BlackList Array of String 192.XX.XX.1

The IP addresses in the blacklist for the domain name.

Note This parameter is returned only when an IP address blacklist is configured for the domain name. You can call the ConfigWebIpSet operation to configure an IP address whitelist and blacklist for the domain name.
WhiteList Array of String 192.XX.XX.2

The IP addresses in the whitelist for the domain name.

Note This parameter is returned only when an IP address whitelist is configured for the domain name. You can call the ConfigWebIpSet operation to configure an IP address whitelist and blacklist for the domain name.
RealServers Array of RealServer

The details about the address of the origin server.

RsType Integer 0

The address type of the origin server. Valid values:

  • 0: IP address.
  • 1: domain name. Use the domain name of the origin server if you deploy proxies, such as Web Application Firewall (WAF), between the origin server and the Anti-DDoS Pro or Anti-DDoS Premium instance. If you use the domain name, you must enter the address of the proxy, such as the CNAME of WAF.
RealServer String 192.XX.XX.11

The address of the origin server.

ProxyTypes Array of ProxyConfig

The details about the protocol type and port number.

ProxyPorts Array of String 443

The port number.

ProxyType String https

The type of the protocol. Valid values:

  • http
  • https
  • websocket
  • websockets
SslProtocols String tls1.0

The version of the TLS protocol. Valid values:

  • tls1.0: TLS 1.0 or later
  • tls1.1: TLS 1.1 or later
  • tls1.2: TLS 1.2 or later
CcTemplate String default

The mode of the Frequency Control policy. Valid values:

  • default: the Normal mode
  • gf_under_attack: the Emergency mode
  • gf_sos_verify: the Strict mode
  • gf_sos_verify: the Super Strict mode
CcEnabled Boolean true

Indicates whether the Frequency Control policy was enabled. Valid values:

  • true: The policy was enabled.
  • false: The policy was disabled.
SslCiphers String default

The type of the cipher suite. Valid values:

  • default: custom cipher suite
  • all: all cipher suites, which contain strong and weak cipher suites.
  • strong: strong cipher suites.
CcRuleEnabled Boolean false

Indicates whether the Custom Rule switch of the Frequency Control policy was turned on. Valid values:

  • true: The switch was turned on.
  • false: The switch was turned off.
Ssl13Enabled Boolean false

Indicates whether TLS 1.3 is supported. Valid values:

  • true: TLS 1.3 is supported.
  • false: TLS 1.3 is not supported.
ProxyEnabled Boolean true

Indicates whether the forwarding rule was enabled. Valid values:

  • true: The forwarding rule was enabled.
  • false: The forwarding rule was disabled.
CertName String testcert

The name of the certificate.

PolicyMode String ip_hash

The load balancing algorithm for back-to-origin traffic. Valid values:

  • ip_hash: the IP hash algorithm. This algorithm is used to redirect the requests from the same IP address to the same origin server.
  • rr: the round-robin algorithm. This algorithm is used to redirect requests to origin servers in turn.
  • least_time: the least response time algorithm. This algorithm is used to minimize the latency when requests are forwarded from Anti-DDoS Pro or Anti-DDoS Premium instances to origin servers based on the intelligent DNS resolution feature.
Cname String o8fzz0ocxere****.aliyunddos****.com

The CNAME of the Anti-DDoS Pro or Anti-DDoS Premium instance to which the domain name is added.

Http2Enable Boolean true

Indicates whether Enable HTTP/2 was turned on. Valid values:

  • true: The switch was turned on.
  • false: The switch was turned off.
Https2HttpEnable Boolean true

Indicates whether Enable HTTP was turned on. Valid values:

  • true: The switch was turned on.
  • false: The switch was turned off.
RequestId String 0F5B72DD-96F4-423A-B12B-A5151DD746B8

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeWebRules
&Domain=www.aliyun.com
&QueryDomainPattern=fuzzy
&PageNumber=1
&PageSize=10
&Common request parameters

Sample success responses

XML format

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

<DescribeWebRulesResponse>
    <TotalCount>1</TotalCount>
    <WebRules>
        <Domain>www.aliyun.com</Domain>
        <Http2HttpsEnable>true</Http2HttpsEnable>
        <CustomCiphers>ECDHE-ECDSA-AES128-GCM-SHA256</CustomCiphers>
        <BlackList>192.XX.XX.1</BlackList>
        <WhiteList>192.XX.XX.2</WhiteList>
        <RealServers>
            <RsType>0</RsType>
            <RealServer>192.XX.XX.11</RealServer>
        </RealServers>
        <ProxyTypes>
            <ProxyPorts>443</ProxyPorts>
            <ProxyType>https</ProxyType>
        </ProxyTypes>
        <SslProtocols>tls1.0</SslProtocols>
        <CcTemplate>default</CcTemplate>
        <CcEnabled>true</CcEnabled>
        <SslCiphers>default</SslCiphers>
        <CcRuleEnabled>false</CcRuleEnabled>
        <Ssl13Enabled>false</Ssl13Enabled>
        <ProxyEnabled>true</ProxyEnabled>
        <CertName>testcert</CertName>
        <PolicyMode>ip_hash</PolicyMode>
        <Cname>o8fzz0ocxere****.aliyunddos****.com</Cname>
        <Http2Enable>true</Http2Enable>
        <Https2HttpEnable>true</Https2HttpEnable>
    </WebRules>
    <RequestId>0F5B72DD-96F4-423A-B12B-A5151DD746B8</RequestId>
</DescribeWebRulesResponse>

JSON format

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

{
  "TotalCount" : 1,
  "WebRules" : [ {
    "Domain" : "www.aliyun.com",
    "Http2HttpsEnable" : true,
    "CustomCiphers" : [ "ECDHE-ECDSA-AES128-GCM-SHA256" ],
    "BlackList" : [ "192.XX.XX.1" ],
    "WhiteList" : [ "192.XX.XX.2" ],
    "RealServers" : [ {
      "RsType" : 0,
      "RealServer" : "192.XX.XX.11"
    } ],
    "ProxyTypes" : [ {
      "ProxyPorts" : [ "443" ],
      "ProxyType" : "https"
    } ],
    "SslProtocols" : "tls1.0",
    "CcTemplate" : "default",
    "CcEnabled" : true,
    "SslCiphers" : "default",
    "CcRuleEnabled" : false,
    "Ssl13Enabled" : false,
    "ProxyEnabled" : true,
    "CertName" : "testcert",
    "PolicyMode" : "ip_hash",
    "Cname" : "o8fzz0ocxere****.aliyunddos****.com",
    "Http2Enable" : true,
    "Https2HttpEnable" : true
  } ],
  "RequestId" : "0F5B72DD-96F4-423A-B12B-A5151DD746B8"
}

Error codes

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