Skip to content

Forwarding Rules API

POST Add Layer 4 Forwarding Rule

POST /cdn/layer4/rules/insertRule

Body Request Parameters

{
  "oid": "202304241245319372",
  "rules": [
    {
      "originAddress": "1.1.1.1",
      "protocolType": "tcp",
      "types": "off",
      "limitConn": 20,
      "hyPort": "6665",
      "listenPort": "6666",
      "remark": "",
      "proxyProtocol": "off",
      "node": "line_1"
    }
  ]
}

Request Parameters

Name Location Type Required Chinese Name Description
Authorization header string No none
body body PutTcpDomainVO No PutTcpDomainVO none

Response Example

200 Response

{
  "msg": "Saved successfully",
  "code": 200
}

201 Response

{}

Responses

Status Code Status Meaning Description Data Model
200 OK none Inline
201 Created none Inline
401 Unauthorized none Inline
403 Forbidden none Inline
404 Not Found none Inline

Response Data Structure

Status Code 200

Name Type Required Constraints Chinese Name Description
» msg string true none none
» code integer true none none

Data Model

Layer4RuleVO

{
  "hyPort": "string",
  "limitConn": 0,
  "listenPort": "string",
  "node": "string",
  "originAddress": "string",
  "protocolType": "string",
  "proxyProtocol": "string",
  "remark": "string",
  "ruleId": 0,
  "types": "string"
}

Layer4RuleVO

Properties

Name Type Required Constraints Chinese Name Description
hyPort string true none Forwarding Port none
limitConn integer(int32) false none Rate Limiting none
listenPort string true none Origin Port none
node string true none Instance none
originAddress string true none Origin Address Multiple addresses separated by semicolons (;)
protocolType string true none Protocol tcp:TCP protocol
udp:UDP protocol
proxyProtocol string true none proxy_protocl off:Disabled
on:Enabled
remark string false none none
ruleId integer(int64) false none 规则 ID none
types string true none 会话保持 off:No:Yes

PutTcpDomainVO

{
  "oid": "string",
  "rules": [
    {
      "hyPort": "string",
      "limitConn": 0,
      "listenPort": "string",
      "node": "string",
      "originAddress": "string",
      "protocolType": "string",
      "proxyProtocol": "string",
      "remark": "string",
      "ruleId": 0,
      "types": "string"
    }
  ]
}

PutTcpDomainVO

Properties

Name Type Required Constraints Chinese Name Description
oid string true none Package none
rules [Layer4RuleVO] false none Rule Parameters none