Modifies a port forwarding rule, namely, the IP addresses of the origin server.

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 ConfigNetworkRules

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

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

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.
  • BackendPort: the port of the origin server. This field is required and must be of the INTEGER type.
  • RealServers: the IP addresses of the origin server. This field is required and must be a JSON array. It can contain up to 20 IP addresses.
Note You can only modify the value of RealServers when you modify a port forwarding rule.
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
RequestId String CC042262-15A3-4A49-ADF0-130968EA47BC

The ID of the request.

Examples

Sample requests

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

Sample success responses

XML format

<ConfigNetworkRulesResponse>
      <RequestId>CC042262-15A3-4A49-ADF0-130968EA47BC</RequestId>
</ConfigNetworkRulesResponse>

JSON format

{
    "RequestId": "CC042262-15A3-4A49-ADF0-130968EA47BC"
}

Error codes

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