全部产品
Search
文档中心

边缘安全加速:CreateTransportLayerApplication - 创建四层加速应用

更新时间:Jan 30, 2026

创建一个四层加速应用。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

当前API暂无授权信息透出。

请求参数

名称

类型

必填

描述

示例值

SiteId

integer

站点 ID,可通过调用 ListSites 接口获取。

123456****

RecordName

string

四层应用的域名。

aaa.example.com

Rules

array<object>

转发规则列表。

object

规则详情。每一条规则,除备注外,其他参数为必填。

Protocol

string

转发规则协议,取值:

  • TCP:TCP 协议。

  • UDP:UDP 协议。

TCP

EdgePort

string

边缘端口。支持:

  • 单个端口,例如 80。

  • 端口范围,例如 81-85,代表端口 81、82、83、84、85。

  • 端口和端口范围组合,端口、端口范围之间用逗号分隔,例如 80,81-85,90,代表端口 80、81、82、83、84、85、90。

单个规则的边缘端口以及多个规则之间的边缘端口不允许重叠。

80

SourceType

string

源站类型,支持:

  • ip: IP。

  • domain: 域名。

  • OP: 源地址池。

  • LB: 负载均衡器。

ip

SourcePort

string

源站端口。支持:

  • 单个端口,当源站端口为单个端口时,支持任意合法的边缘端口组合。

  • 端口范围,仅当边缘端口为端口段时,源站端口才允许设置为端口范围且范围大小需要与边缘端口一致。例如边缘端口若为 90-93,则不允许将源站端口设置为 81-85,因为源站端口范围为 5,边缘端口范围为 3,两者不一致。

80

ClientIPPassThroughMode

string

客户端 IP 传递协议,支持:

  • off: 不传递。

  • PPv1: PROXY Protocol v1 协议,支持 TCP 协议的客户端 IP 传递。

  • PPv2: PROXY Protocol v2 协议,支持 TCP 和 UDP 协议的客户端 IP 传递。

  • SPP: Simple Proxy Protocol 协议,支持 UDP 协议的客户端 IP 传递。

SPP

Source

string

源站具体的值,需要与源站类型相匹配。

1.1.1.1

Comment

string

规则的备注信息(可选)。

测试

IpAccessRule

string

IP 访问规则开关,开启后,WAF 中的 IP 访问规则对四层应用生效。

  • on: 开启。

  • off:关闭。

枚举值:

  • off :

    off

  • on :

    on

on

Ipv6

string

Ipv6 开关。

枚举值:

  • off :

    off

  • on :

    on

off

CrossBorderOptimization

string

是否开启中国大陆网络接入优化,默认关闭。取值范围:

  • on:开启。

  • off:关闭。

枚举值:

  • off :

    off

  • on :

    on

on

StaticIp

string

返回参数

名称

类型

描述

示例值

object

请求响应详情。

RequestId

string

请求 ID。

9e5448c7-edaf-49aa-9887-0fcd0832306c

ApplicationId

integer

四层应用 ID。

165503967****

示例

正常返回示例

JSON格式

{
  "RequestId": "9e5448c7-edaf-49aa-9887-0fcd0832306c",
  "ApplicationId": 0
}

错误码

HTTP status code

错误码

错误信息

描述

400 InvalidParameter The specified parameter is invalid. 输入参数规范校验失败。
400 ApplyVipError Failed to apply for ip resources, please contact customer service. 申请IP资源失败,请联系客服。
400 InternalException Failed to call the service. Try again later or contact technical support. 调用服务失败,请稍后重试或联系客服咨询详情。
400 InvalidParameter.RecordData Invalid record content. Adjust your configurations based on the API documentation. 记录内容参数错误,请根据接口文档调整参数内容。
400 InvalidParameter.RecordType Invalid record type. Adjust your configurations based on the API documentation. 记录类型错误,请根据接口文档调整参数内容。
400 Instance.NotOnline Your plan is unavailable due to an overdue payment. Complete the payment first. 您的套餐实例因欠费当前处于非上线状态,请先完成续费操作以继续使用。
400 QuotaExceed.RecordCount The maximum number of records has been reached. Delete some and try again or upgrade your plan. 记录数量已达上限,请删除部分记录后重试或升级套餐。
400 Record.Conflict The specified record content conflicts with existing records. Adjust your configurations based on the related product documentation. 和已有记录冲突,请根据冲突规则的产品文档调整记录内容。
400 Site.ServiceBusy This website is being configured. Try again later. 该站点正在配置中,请稍后再试。
400 TransportLayerRulesExceedLimit The configured forwarding rules have exceeded the maximum limit. Delete useless forwarding rules and try again. 您配置的转发规则已经超过了最大限制,请删除无用的转发规则后进行重试。
400 TransportLayerApplicationConflict The Layer -4 accelerated application conflicts with other applications. Check whether the application name and host record conflict with other applications in the site. 您当前操作的四层加速应用与其他应用冲突,请检查应用名、主机记录等是否与该站点下的其他应用冲突。
400 SourceCircleExist The host record of the resource to be operated on is already the source station of another resource, or the source station of the current resource has been added as a host record. To avoid loopback, modify the host record or source station and retry. 当前要操作资源的主机记录已经是其他资源的源站,或者当前资源的源站已经被添加为主机记录,为避免回环产生,请修改主机记录或者源站后进行重试。
400 InvalidParameter.InvalidRecordName The record name you entered does not meet the specifications. Change the record name according to the product documentation. 您输入的记录名称不符合规范,请根据产品文档调整记录名称。
400 EdgePortsOverlap There is overlap between multiple edge ports, please check and try again after modification. 多个边缘端口之间存在重叠,请检查后进行修改重试。
400 InvalidParameter.ClientIpPassThroughMode Invalid client IP transfer protocol, please refer to the interface document and pass in valid parameters. 无效的客户端IP传递协议,请参考接口文档,传入合法的参数。
400 InvalidParameter.RuleSource The origin of the forwarding rule does not exist or is invalid. Enter the correct origin and try again. 转发规则的源站不存在或者不合法,请传入正确的源站后进行重试。
400 InvalidParameter.Port Invalid edge port or origin port. Enter a valid port as required in the interface document. 无效的边缘端口或者源站端口,请按照接口文档中的要求,传入合法的端口。
400 InvalidParameter.Protocol Invalid port protocol. Enter a valid port protocol as required by the interface documentation. 无效的端口协议,请按照接口文档的要求,传入合法的端口协议。
400 InternalError An internal exception occurred, please try again later. 触发内部异常,请稍后再试。
400 IpaResourceUnavailable The resource is unavailable. 没有足够的资源可供新域名接入。
400 Record.NoResource Failed to allocate resources for the record. Please submit a ticket for processing. 为记录分配资源失败,请提工单处理。
400 InvalidParameter.PrivateIpAsSourceUnsupported The provided source is an invalid private IP address. Please verify and resubmit. 您输入的地址为无效的内网地址,请检查修改后重新提交。
400 InvalidParameter.SourceIpInBlacklist The provided source is an invalid private IP address. Please verify and resubmit. 您输入的地址为无效的内网地址,请检查修改后重新提交。
400 Site.NotActive The status of the applied site or site is not activated. 应用的站点或站点的状态不是已激活。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情