All Products
Search
Document Center

Anti-DDoS:DescribeLayer4RulePolicy

Last Updated:Oct 23, 2024

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

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
yundun-ddoscoo:DescribeLayer4RulePolicyget
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ListenersstringYes

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.
[{\"InstanceId\":\"ddosDip-sg-4hr2b3l****\",\"FrontendPort\":2020,\"Protocol\":\"udp\"}]

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

ParameterTypeDescriptionExample
object
FrontendPortinteger

The forwarding port.

2020
BakModestring

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.
1
RequestIdstring

The ID of the request.

6E46CC51-36BE-1100-B14C-DAF8381B8F73
CurrentIndexinteger

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.
1
ForwardProtocolstring

The type of the protocol.

udp
InstanceIdstring

The ID of the instance.

ddosDip-sg-4hr2b3l****
BackendPortinteger

The port of the origin server.

2022
PriRealServersarray<object>

An array that consists of the information about the primary origin server, including the IP addresses, forwarding protocol, and forwarding port.

PriRealServersobject
FrontendPortinteger

The forwarding port.

2020
Eipstring

The IP address of the instance.

203.107.XX.XX
Protocolstring

The type of the protocol.

udp
CurrentIndexinteger

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.
1
InstanceIdstring

The ID of the instance.

ddosDip-sg-4hr2b3l****
RealServerstring

The IP address of the primary origin server.

192.0.2.1
SecRealServersarray<object>

An array that consists of the information about the secondary origin server, including the IP addresses, forwarding protocol, and forwarding port.

SecRealServersobject
FrontendPortinteger

The forwarding port.

2020
Eipstring

The IP address of the instance.

203.107.XX.XX
Protocolstring

The type of the protocol.

udp
CurrentIndexinteger

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.
1
InstanceIdstring

The ID of the instance.

ddosDip-sg-4hr2b3l****
RealServerstring

The IP address of the secondary origin server.

192.0.2.3

Examples

Sample success responses

JSONformat

{
  "FrontendPort": 2020,
  "BakMode": "1",
  "RequestId": "6E46CC51-36BE-1100-B14C-DAF8381B8F73",
  "CurrentIndex": 1,
  "ForwardProtocol": "udp",
  "InstanceId": "ddosDip-sg-4hr2b3l****",
  "BackendPort": 2022,
  "PriRealServers": [
    {
      "FrontendPort": 2020,
      "Eip": "203.107.XX.XX",
      "Protocol": "udp",
      "CurrentIndex": 1,
      "InstanceId": "ddosDip-sg-4hr2b3l****",
      "RealServer": "192.0.2.1"
    }
  ],
  "SecRealServers": [
    {
      "FrontendPort": 2020,
      "Eip": "203.107.XX.XX",
      "Protocol": "udp",
      "CurrentIndex": 1,
      "InstanceId": "ddosDip-sg-4hr2b3l****",
      "RealServer": "192.0.2.3"
    }
  ]
}

Error codes

For a list of error codes, visit the Service error codes.