Queries the back-to-origin settings of a port forwarding rule.

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 DescribeLayer4RulePolicy

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

Listeners String Yes [{\"InstanceId\":\"ddosDip-sg-4hr2b3l****\",\"FrontendPort\":2020,\"Protocol\":\"udp\"}]

The port forwarding rule that you want to query.

This parameter is a string that consists of JSON arrays. Each element in a JSON array indicates a port forwarding rule. You can query only one port forwarding rule at a time.

Note You can call the DescribeNetworkRules to query existing port forwarding rules.

Each port forwarding rule contains the following fields:

  • InstanceId: the ID of the instance. This field is required and must be of the STRING type.
  • Protocol: the forwarding protocol. This field is required and must be of the STRING type. Valid values: tcp and udp.
  • FrontendPort: the forwarding port. This field is required and must be of the INTEGER type.
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.

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
BackendPort Integer 2022

The port of the origin server.

BakMode String 1

The mode that is used to forward service traffic. Valid values:

  • 0: the default mode. In this mode, Anti-DDoS Pro or Anti-DDoS Premium forwards service traffic to the origin IP address that you specified when you created the port forwarding rule. You can call the CreateNetworkRules operation to create a port forwarding rule.
  • 1: the origin redundancy mode. In this mode, Anti-DDoS Pro or Anti-DDoS Premium forwards service traffic to the IP addresses of the primary or secondary origin servers. You can call the ConfigLayer4RulePolicy operation to configure IP addresses.
CurrentIndex Integer 1

The origin server that is used to receive service traffic. Valid values:

  • 1: the primary origin server, which indicates that Anti-DDoS Pro or Anti-DDoS Premium forwards service traffic to the IP addresses of the primary origin server.
  • 2: the secondary origin server, which indicates that Anti-DDoS Pro or Anti-DDoS Premium forwards service traffic to the IP addresses of the secondary origin server.
ForwardProtocol String udp

The forwarding protocol.

FrontendPort Integer 2020

The forwarding port.

InstanceId String ddosDip-sg-4hr2b3l****

The ID of the instance.

PriRealServers Array of PriRealServers

The details about the primary origin server, including the IP addresses, forwarding protocol, and forwarding port.

CurrentIndex Integer 1

The origin server that is used to receive service traffic. Valid values:

  • 1: the primary origin server, which indicates that Anti-DDoS Pro or Anti-DDoS Premium forwards service traffic to the IP addresses of the primary origin server.
  • 2: the secondary origin server, which indicates that Anti-DDoS Pro or Anti-DDoS Premium forwards service traffic to the IP addresses of the secondary origin server.
Eip String 203.107.XX.XX

The IP address of the instance.

FrontendPort Integer 2020

The forwarding port.

InstanceId String ddosDip-sg-4hr2b3l****

The ID of the instance.

Protocol String udp

The forwarding protocol.

RealServer String 192.0.2.1

The IP address of the primary origin server.

RequestId String 6E46CC51-36BE-1100-B14C-DAF8381B8F73

The ID of the request.

SecRealServers Array of SecRealServers

The details about the secondary origin server, including the IP addresses, forwarding protocol, and forwarding port.

CurrentIndex Integer 1

The origin server that is used to receive service traffic. Valid values:

  • 1: the primary origin server, which indicates that Anti-DDoS Pro or Anti-DDoS Premium forwards service traffic to the IP addresses of the primary origin server.
  • 2: the secondary origin server, which indicates that Anti-DDoS Pro or Anti-DDoS Premium forwards service traffic to the IP addresses of the secondary origin server.
Eip String 203.107.XX.XX

The IP address of the instance.

FrontendPort Integer 2020

The forwarding port.

InstanceId String ddosDip-sg-4hr2b3l****

The ID of the instance.

Protocol String udp

The forwarding protocol.

RealServer String 192.0.2.3

The IP address of the secondary origin server.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeLayer4RulePolicy
&Listeners=[{\"InstanceId\":\"ddosDip-sg-4hr2b3l****\",\"FrontendPort\":2020,\"Protocol\":\"udp\"}]
&<Common request parameters>

Sample success responses

XML format

<DescribeLayer4RulePolicyResponse>
	  <RequestId>BB95151E-FCAD-1C3C-872F-77166555E396</RequestId>
	  <InstanceId>ddosDip-sg-4hr2b3l****</InstanceId>
	  <BackendPort>2022</BackendPort>
	  <FrontendPort>2020</FrontendPort>
	  <CurrentIndex>1</CurrentIndex>
	  <bakMode>1</bakMode>
	  <ForwardProtocol>udp</ForwardProtocol>
	  <PriRealServers>
		    <RealServer>192.0.2.1</RealServer>
		    <InstanceId>ddosDip-sg-4hr2b3l****</InstanceId>
		    <FrontendPort>2020</FrontendPort>
		    <CurrentIndex>1</CurrentIndex>
		    <Protocol>udp</Protocol>
		    <Eip>203.107.XX.XX</Eip>
	  </PriRealServers>
	  <PriRealServers>
		    <RealServer>192.0.2.2</RealServer>
		    <InstanceId>ddosDip-sg-4hr2b3l****</InstanceId>
		    <FrontendPort>2020</FrontendPort>
		    <CurrentIndex>1</CurrentIndex>
		    <Protocol>udp</Protocol>
		    <Eip>203.107.XX.XX</Eip>
	  </PriRealServers>
	  <SecRealServers>
		    <RealServer>192.0.2.3</RealServer>
		    <InstanceId>ddosDip-sg-4hr2b3l****</InstanceId>
		    <FrontendPort>2020</FrontendPort>
		    <CurrentIndex>1</CurrentIndex>
		    <Protocol>udp</Protocol>
		    <Eip>203.107.XX.XX</Eip>
	  </SecRealServers>
	  <SecRealServers>
		    <RealServer>192.0.2.4</RealServer>
		    <InstanceId>ddosDip-sg-4hr2b3l****</InstanceId>
		    <FrontendPort>2020</FrontendPort>
		    <CurrentIndex>1</CurrentIndex>
		    <Protocol>udp</Protocol>
		    <Eip>203.107.XX.XX</Eip>
	  </SecRealServers>
</DescribeLayer4RulePolicyResponse>

JSON format

{
    "RequestId": "BB95151E-FCAD-1C3C-872F-77166555E396",
    "InstanceId": "ddosDip-sg-4hr2b3l****",
    "BackendPort": 2022,
    "FrontendPort": 2020,
    "CurrentIndex": 1,
    "bakMode": 1,
    "ForwardProtocol": "udp",
    "PriRealServers": [
        {
            "RealServer": "192.0.2.1",
            "InstanceId": "ddosDip-sg-4hr2b3l****",
            "FrontendPort": 2020,
            "CurrentIndex": 1,
            "Protocol": "udp",
            "Eip": "203.107.XX.XX"
        },
        {
            "RealServer": "192.0.2.2",
            "InstanceId": "ddosDip-sg-4hr2b3l****",
            "FrontendPort": 2020,
            "CurrentIndex": 1,
            "Protocol": "udp",
            "Eip": "203.107.XX.XX"
        }
    ],
    "SecRealServers": [
        {
            "RealServer": "192.0.2.3",
            "InstanceId": "ddosDip-sg-4hr2b3l****",
            "FrontendPort": 2020,
            "CurrentIndex": 1,
            "Protocol": "udp",
            "Eip": "203.107.XX.XX"
        },
        {
            "RealServer": "192.0.2.4",
            "InstanceId": "ddosDip-sg-4hr2b3l****",
            "FrontendPort": 2020,
            "CurrentIndex": 1,
            "Protocol": "udp",
            "Eip": "203.107.XX.XX"
        }
    ]
}

Error codes

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