api 四层转发 /v1/streams 1个月前发布45012 获取四层转发列表 GET/v1/streams调试 page integer 当前页码 limit integer 单页显示数量 listen_port integer 监听的端口 listen_protocol string 监听的协议,可选为tcp、udp backend_ip string 源IP,模糊匹配 group integer 所属的转发组 id integer 转发ID user_package integer 所属的套餐 enable boolean 启用或禁用 truefalse state string 四层转发状态,可选为200、512、513、514。200是正常,512是套餐过期,513是流量超限,514是被锁定 返回结果 { "code": 0, "count": 2, "data": [ { "acl": "{}", "backend": "[{\"state\": \"up\", \"addr\": \"1.1.1.1\", \"weight\": 1}]", "backend_port": "99", "backup_node_group": null, "backup_node_group_name": null, "balance_way": "rr", "cname_domain": "cdnfly.com", "cname_hostname": "cbsjyv4m", "cname_mode": "site", "cname_state": "done", "cname_task_id": 120525, "conn_limit": "", "create_at": null, "create_at2": "2021-11-26 19:06:02", "enable": 1, "enable_backup_group": 0, "id": 42, "listen": "[{\"protocol\": \"tcp\", \"port\": \"999\"}]", "name": "jason", "node_group_id": 490, "node_group_name": null, "package_name": "ff", "proxy_protocol": 0, "record_id": "732094354142733312", "region_id": 646, "region_name": "test", "s.cname_domain": "cdnfly.com", "s.cname_hostname": "cbsjyv4m", "s.cname_mode": "site", "state": "200", "stream_state": "200", "sync_state": "done", "task_id": 120524, "uid": 2, "up_cname_domain": "cdnfly.com", "up_cname_hostname": "v325sf8j-u", "update_at": null, "update_at2": "2021-11-26 19:06:02", "user_package": 425, "version": 1 }, { "acl": "{}", "backend": "[{\"state\": \"up\", \"addr\": \"1.1.1.1\", \"weight\": 1}]", "backend_port": "88", "backup_node_group": null, "backup_node_group_name": null, "balance_way": "rr", "cname_domain": "cdnfly.com", "cname_hostname": "knw42svf", "cname_mode": "site", "cname_state": "done", "cname_task_id": 120502, "conn_limit": "", "create_at": null, "create_at2": "2021-11-26 18:57:16", "enable": 1, "enable_backup_group": 0, "id": 41, "listen": "[{\"protocol\": \"tcp\", \"port\": \"88\"}]", "name": "jason", "node_group_id": 490, "node_group_name": null, "package_name": "ff", "proxy_protocol": 0, "record_id": "732093253135826944", "region_id": 646, "region_name": "test", "s.cname_domain": "cdnfly.com", "s.cname_hostname": "knw42svf", "s.cname_mode": "site", "state": "200", "stream_state": "200", "sync_state": "done", "task_id": 120501, "uid": 2, "up_cname_domain": "cdnfly.com", "up_cname_hostname": "v325sf8j-u", "update_at": null, "update_at2": "2021-11-26 18:57:16", "user_package": 425, "version": 1 } ] } 新增一个或多个转发(多个时,数据格式为数组) POST/v1/streams调试 user_package integer required 绑定的套餐 listen json required 监听的协议和端口,格式为json数组,如[{“protocol”:”tcp”,”port”:”88″}],protocol可选为tcp或udp balance_way string 源站负载均衡方式,可选为ip_hash、rr、least_conn、random proxy_protocol boolean 回源是否使用proxy protocol协议 truefalse backend_port integer required 回源端口 backend json required 源IP设置,格式为json数组,如[{“addr”:”1.1.1.1″,”weight”:1,”state”:”up”}],state可选为up、down、backup conn_limit integer 连接数限制 acl json acl配置,格式为json,如{“default_action”:”allow”,”rule”:[{“ip”:”1.1.1.1″,”action”:”deny”}]},default_action可选为allow、deny;rule中的action可选为allow,deny。 返回结果 提交内容 { "code": 0, "data": "", "msg": "四层转发添加成功" } 批量修改四层转发(数据格式为数组) PUT/v1/streams调试 id integer required 四层转发ID user_package integer 绑定的套餐 listen json 监听的协议和端口,格式为json数组,如[{“protocol”:”tcp”,”port”:”88″}],protocol可选为tcp或udp balance_way string 源站负载均衡方式,可选为ip_hash、rr、least_conn、random proxy_protocol boolean 回源是否使用proxy protocol协议 truefalse backend_port integer 回源端口 backend json 源IP设置,格式为json数组,如[{“addr”:”1.1.1.1″,”weight”:1,”state”:”up”}],state可选为up、down、backup conn_limit integer 连接数限制 acl json acl配置,格式为json,如{“default_action”:”allow”,”rule”:[{“ip”:”1.1.1.1″,”action”:”deny”}]},default_action可选为allow、deny;rule中的action可选为allow,deny。 enable boolean 启用或禁用 truefalse 返回结果 提交内容 { "code": 0, "data": "", "msg": "更新转发成功" } 获取指定四层转发 GET/v1/streams/41调试 返回结果 { "code": 0, "data": { "acl": "{}", "backend": "[{\"state\": \"up\", \"addr\": \"1.1.1.1\", \"weight\": 1}]", "backend_port": "88", "backup_node_group": null, "balance_way": "rr", "cname_domain": "cdnfly.com", "cname_hostname": "knw42svf", "cname_mode": "site", "cname_state": "done", "cname_task_id": 120502, "conn_limit": "", "create_at": null, "create_at2": "2021-11-26 18:57:16", "enable": 1, "enable_backup_group": 0, "end_at": "2021-12-16 14:47:38", "groups": null, "id": 41, "listen": "[{\"protocol\": \"tcp\", \"port\": \"88\"}]", "name": "jason", "node_group_id": 490, "node_group_name": null, "package_name": "ff", "proxy_protocol": 0, "record_id": "732093253135826944", "region_id": 646, "s.cname_domain": "cdnfly.com", "s.cname_hostname": "knw42svf", "s.cname_mode": "site", "state": "200", "stream_state": "200", "sync_state": "done", "task_id": 120501, "uid": 2, "up_cname_domain": "cdnfly.com", "up_cname_hostname": "v325sf8j-u", "update_at": null, "update_at2": "2021-11-26 18:57:16", "user_package": 425, "version": 1 }, "msg": "" } 修改指定四层转发 PUT/v1/streams/<四层转发ID>调试 user_package integer 绑定的套餐 listen json 监听的协议和端口,格式为json数组,如[{“protocol”:”tcp”,”port”:”88″}],protocol可选为tcp或udp balance_way string 源站负载均衡方式,可选为ip_hash、rr、least_conn、random proxy_protocol boolean 回源是否使用proxy protocol协议 truefalse backend_port integer 回源端口 backend json 源IP设置,格式为json数组,如[{“addr”:”1.1.1.1″,”weight”:1,”state”:”up”}],state可选为up、down、backup conn_limit integer 连接数限制 acl json acl配置,格式为json,如{“default_action”:”allow”,”rule”:[{“ip”:”1.1.1.1″,”action”:”deny”}]},default_action可选为allow、deny;rule中的action可选为allow,deny。 enable boolean 启用或禁用 truefalse 返回结果 提交内容 { "code": 0, "data": "", "msg": "更新转发成功" } 删除四层转发 DELETE/v1/streams/<四层转发ID,多个以逗号分隔>调试 返回结果 { "code": 0, "data": "", "msg": "四层转发删除成功" } © 版权声明文章版权归作者所有,转载请预留文章地址。s.wbsun.net
暂无评论内容