跳转至

转发规则接口

POST 添加四层转发规则

POST /cdn/layer4/rules/insertRule

Body 请求参数

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

请求参数

名称 位置 类型 必选 中文名 说明
Authorization header string none
body body PutTcpDomainVO PutTcpDomainVO none

返回示例

200 Response

{
  "msg": "保存成功",
  "code": 200
}

201 Response

{}

返回结果

状态码 状态码含义 说明 数据模型
200 OK none Inline
201 Created none Inline
401 Unauthorized none Inline
403 Forbidden none Inline
404 Not Found none Inline

返回数据结构

状态码 200

名称 类型 必选 约束 中文名 说明
» msg string true none none
» code integer true none none

数据模型

Layer4RuleVO

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

Layer4RuleVO

属性

名称 类型 必选 约束 中文名 说明
hyPort string true none 转发端口 none
limitConn integer(int32) false none 频率限速 none
listenPort string true none 源站端口 none
node string true none 实例 none
originAddress string true none 源站地址 多个地址用英文逗号(;) 分隔
protocolType string true none 转发协议 tcp:表示 TCP
udp:表示 UDP
proxyProtocol string true none proxy_protocl 协议 off:表示禁用
on:表示启用
remark string false none none
ruleId integer(int64) false none 规则 ID none
types string true none 会话保持 off:表示否:表示是

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

属性

名称 类型 必选 约束 中文名 说明
oid string true none 套餐 none
rules [Layer4RuleVO] false none 规则参数 none