Queries the mitigation settings of the port forwarding rule for a non-website service, which include session persistence and anti-DDoS protection policies.

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 DescribeNetworkRuleAttributes

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

NetworkRules String Yes [{"InstanceId":"ddoscoo-cn-mp91j1ao****","Protocol":"tcp","FrontendPort":8080}]

Details about the port forwarding rule. This parameter is a JSON string. The fields in the value are described as follows:

  • 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
  • ap-southeast-1: outside mainland China, which indicates an Anti-DDoS Premium instance

Response parameters

Parameter Type Example Description
NetworkRuleAttributes Array

Details about the mitigation settings of the port forwarding rule, which include session persistence and anti-DDoS protection policies.

Config Struct

The mitigation settings of the port forwarding rule.

Cc Struct

The protection policy applied when the number of connections initiated from a source IP address frequently exceeds the limit.

Sblack Array

The protection policy that a source IP address is added to the blacklist when the number of connections initiated from the IP address frequently exceeds the limit.

Cnt Integer 5

The threshold that the number of connections initiated from a source IP address can exceed the limit. Set the value to 5. If the number of connections initiated from a source IP address exceeds the limit five times during the check, the source IP address is added to the blacklist.

During Integer 60

The check intervals. Set the value to 60. Unit: seconds.

Expires Integer 600

The validity period of the IP address in the blacklist. Valid values: 60 to 604800. Unit: seconds.

Type Integer 1

The type of the limit that causes a source IP address to be added to the blacklist. Valid values:

  • 1: Source New Connection Rate Limit
  • 2: Source Concurrent Connection Rate Limit
  • 3: PPS Limit for Source
  • 4: Bandwidth Limit for Source
NodataConn String off

The status of the Empty Connection switch. Valid values:

  • on
  • off
PayloadLen Struct

The settings of the Packet Length Limit policy.

Max Integer 6000

The maximum length of a packet. Valid values: 0 to 6000. Unit: bytes.

Min Integer 0

The minimum length of a packet. Valid values: 0 to 6000. Unit: bytes.

PersistenceTimeout Integer 0

The timeout period of session persistence. Valid values: 30 to 3600. Unit: seconds. Default value: 0, which indicates that session persistence is disabled.

Sla Struct

The settings of the Speed Limit for Destination policy.

Cps Integer 100000

The maximum number of new connections per second that can be established over the port of the destination instance. Valid values: 100 to 100000.

CpsEnable Integer 1

The status of the Destination New Connection Rate Limit switch. Valid values:

  • 0: The switch is turned off.
  • 1: The switch is turned on.
Maxconn Integer 1000000

The maximum number of concurrent connections that can be established over the port of the destination instance. Valid values: 1000 to 1000000.

MaxconnEnable Integer 0

The status of the Destination Concurrent Connection Rate Limit switch. Valid values:

  • 0: The switch is turned off.
  • 1: The switch is turned on.
Slimit Struct

The settings of the Speed Limit for Source policy.

Bps Long 0

The bandwidth limit for a source IP address. Valid values: 1024 to 268435456. Unit: bytes/s. Default value: 0, which indicates that the bandwidth for a source IP address is unlimited.

Cps Integer 0

The maximum number of new connections per second that can be initiated from a source IP address. Valid values: 1 to 500000.

CpsEnable Integer 0

The status of the Source New Connection Rate Limit switch. Valid values:

  • 0: The switch is turned off.
  • 1: The switch is turned on.
CpsMode Integer 1

The mode of the Source New Connection Rate Limit switch. Valid values:

  • 1: the Manual mode
  • 2: the Automatic mode
Maxconn Integer 0

The maximum number of concurrent connections initiated from a source IP address. Valid values: 1 to 500000.

MaxconnEnable Integer 0

The status of the Source Concurrent Connection Rate Limit switch. Valid values:

  • 0: The switch is turned off.
  • 1: The switch is turned on.
Pps Long 0

The packets per second (pps) limit for a source IP address. Valid values: 1 to 100000. Unit: packets/s. Default value: 0, which indicates that the pps for a source IP address is unlimited.

Synproxy String off

The status of the False Source switch. Valid values:

  • on
  • off
FrontendPort Integer 8080

The forwarding port.

InstanceId String ddoscoo-cn-mp91j1ao****

The ID of the instance.

Protocol String tcp

The forwarding protocol. Valid values:

  • tcp
  • udp
RequestId String F9F2F77D-307C-4F15-8D02-AB5957EEBF97

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/? Action=DescribeNetworkRuleAttributes
&NetworkRules=[{"InstanceId":"ddoscoo-cn-mp91j1ao****","Protocol":"tcp","FrontendPort":8080}]
&<Common request parameters>

Sample success responses

XML format

<DescribeNetworkRuleAttributesResponse>
	  <NetworkRuleAttributes>
		    <InstanceId>ddoscoo-cn-mp91j1ao****</InstanceId>
		    <Config>
			      <NodataConn>off</NodataConn>
			      <Cc></Cc>
			      <PersistenceTimeout>0</PersistenceTimeout>
			      <PayloadLen>
				        <Min>0</Min>
				        <Max>6000</Max>
			      </PayloadLen>
			      <Sla>
				        <Cps>100000</Cps>
				        <CpsEnable>1</CpsEnable>
				        <MaxconnEnable>0</MaxconnEnable>
				        <Maxconn>1000000</Maxconn>
			      </Sla>
			      <Slimit>
				        <CpsMode>1</CpsMode>
				        <Pps>0</Pps>
				        <Bps>0</Bps>
				        <Cps>0</Cps>
				        <CpsEnable>0</CpsEnable>
				        <MaxconnEnable>0</MaxconnEnable>
				        <Maxconn>0</Maxconn>
			      </Slimit>
			      <Synproxy>on</Synproxy>
		    </Config>
		    <FrontendPort>8080</FrontendPort>
		    <Protocol>tcp</Protocol>
	  </NetworkRuleAttributes>
	  <RequestId>F9F2F77D-307C-4F15-8D02-AB5957EEBF97</RequestId>
</DescribeNetworkRuleAttributesResponse>

JSON format

{
	"NetworkRuleAttributes": [
		{
			"InstanceId": "ddoscoo-cn-mp91j1ao****",
			"Config": {
				"NodataConn": "off",
				"Cc": {
					"Sblack": []
				},
				"PersistenceTimeout": 0,
				"PayloadLen": {
					"Min": 0,
					"Max": 6000
				},
				"Sla": {
					"Cps": 100000,
					"CpsEnable": 1,
					"MaxconnEnable": 0,
					"Maxconn": 1000000
				},
				"Slimit": {
					"CpsMode": 1,
					"Pps": 0,
					"Bps": 0,
					"Cps": 0,
					"CpsEnable": 0,
					"MaxconnEnable": 0,
					"Maxconn": 0
				},
				"Synproxy": "on"
			},
			"FrontendPort": 8080,
			"Protocol": "tcp"
		}
	],
	"RequestId": "F9F2F77D-307C-4F15-8D02-AB5957EEBF97"
}

Error codes

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