全部产品
Search
文档中心

Serverless 应用引擎:BindSlb - 为应用绑定SLB

更新时间:Aug 28, 2026

为应用绑定SLB。

调试

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

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

sae:BindSlb

create

*全部资源

*

无 无

请求语法

POST /pop/v1/sam/app/slb HTTP/1.1

请求参数

名称

类型

必填

描述

示例值

AppId

string

是

需要绑定 SLB 的目标应用 ID。

0099b7be-5f5b-4512-a7fc-56049ef1****

Internet

string

否

绑定公网 SLB。例如:[{"port":80,"targetPort":8080,"protocol":"TCP"}],表示通过 TCP 协议,将容器的 8080 端口通过 SLB 的 80 端口暴露服务。取值说明如下:

  • port:SLB 端口。

  • targetPort:容器端口。

  • protocol:网络协议。支持 TCP、HTTP 和 HTTPS。

  • httpsCertId:SSL 证书。仅限选择 HTTPS 时需配置 SSL 证书。

[{"port":80,"targetPort":8080,"protocol":"TCP"}]

Intranet

string

否

绑定私网 SLB。例如:[{"port":80,"targetPort":8080,"protocol":"TCP"}],表示通过 TCP 协议,将容器的 8080 端口通过 SLB 的 80 端口暴露服务。取值说明如下:

  • port:SLB 端口。

  • targetPort:容器端口。

  • protocol:网络协议。支持 TCP、HTTP 和 HTTPS。

  • httpsCertId:SSL 证书。仅限选择 HTTPS 时需配置 SSL 证书。

[{"port":80,"targetPort":8080,"protocol":"TCP"}]

InternetSlbId

string

否

使用指定的已购买的公网 SLB,支持非共享型实例。

lb-bp1tg0k6d9nqaw7l1****

IntranetSlbId

string

否

使用指定的已购买的私网 SLB,支持非共享型实例。

lb-bp1tg0k6d9nqaw7l1****

InternetSlbChargeType

string

否

公网负载均衡的计费方式。支持以下两种计费方式:

  • PayBySpec:表示按规格计费。

  • PayByCLCU:表示按使用量计费。

PayBySpec

IntranetSlbChargeType

string

否

内网负载均衡的计费方式。支持以下两种计费方式:

  • PayBySpec:表示按规格计费。

  • PayByCLCU:表示按使用量计费。

PayBySpec

返回参数

名称

类型

描述

示例值

object

返回数据。

RequestId

string

请求 ID。

91F93257-7A4A-4BD3-9A7E-2F6EAE6D****

Message

string

调用结果的附加信息。

success

TraceId

string

调用链 ID,可用于精确查询调用信息。

0a98a02315955564772843261e****

Data

object

返回结果。

ChangeOrderId

string

返回的发布单 ID,用于查询任务执行状态。

01db03d3-3ee9-48b3-b3d0-dfce2d88****

ErrorCode

string

错误码。取值说明如下:

  • 请求成功:不返回 ErrorCode 字段。

  • 请求失败:返回 ErrorCode 字段。具体信息,请参见本文的错误码列表。

空

Code

string

接口状态或 POP 错误码。取值说明如下:

  • 2xx:成功。

  • 3xx:重定向。

  • 4xx:请求错误。

  • 5xx:服务器错误。

200

Success

boolean

绑定 SLB 是否成功。取值说明如下:

  • true:绑定成功。

  • false:绑定失败。

true

示例

正常返回示例

JSON格式

{
  "RequestId": "91F93257-7A4A-4BD3-9A7E-2F6EAE6D****",
  "Message": "success",
  "TraceId": "0a98a02315955564772843261e****",
  "Data": {
    "ChangeOrderId": "01db03d3-3ee9-48b3-b3d0-dfce2d88****"
  },
  "ErrorCode": "空",
  "Code": "200",
  "Success": true
}

错误码

HTTP status code

错误码

错误信息

描述

400 Slb.NotFound The SLB instance does not exist: slbId [%s] SLB不存在:slbId[%s]。
400 InvalidApplication.NotFound The current application does not exist. 找不到当前应用。
400 InvalidParameter.NotEmpty You must specify the parameter %s. 不合法的参数:%s不能为空。
400 InvalidParameter.Obviously The specified parameter is invalid {%s}. 不合法的参数{%s}。
400 SlbHttpsCert.NotConsistent The HTTPS listening certificate for each listener must match. SLB设置HTTPS监听证书配置必须一致。
400 SlbHttpsCert.NotFound You must configure the certificate before you configure HTTPS listening for the SLB instance. SLB设置HTTPS监听必须有证书配置。
400 SlbListenerPort.NotAvailable The SLB listening port is unavailable: slbId [%s], port [%s] SLB监听端口被占用:slbId[%s], port[%s]。
400 SlbListenerType.Invalid An SLB listener type error occurred. Only HTTPS and TCP are supported. SLB监听类型异常,只支持HTTPS和TCP类型。
400 SlbSpec.NotSupport Shared performance SLB instances are not supported. 不支持性能共享型SLB实例。
400 SlbType.Invalid An SLB network type error occurred. SLB网络类型异常。
400 SSLCert.NotFound The specified SSL certificate cannot be found. 找不到对应的SSL证书。
400 System.Upgrading The system is being upgraded. Please try again later. 系统正在升级,请稍后操作。
400 Application.ChangerOrderRunning An application change process is in progress. Please try again later. 应用有变更流程正在执行,请稍后重试。
400 Application.InvalidStatus The application status is abnormal. Please try again later. 应用状态异常,请稍后重试。
400 Application.NotDeployYet The application has not been deployed. Please deploy it and try again. 应用没有部署,请部署后重试。
400 InvalidParam.ProtocolNotSupport Only TCP protocol is supported. 不支持指定的协议,只支持TCP协议。
400 SLBInstanceQuota.OverQuota The total number of SLB instances exceeds the quota. Please reduce the instances and try again. SLB总实例数超过了限额,请您减少数量后重试。
400 Slb.Tag.Not.Qualified The current SLB instance cannot be reused because it may have been occupied by %s. SLB实例正在被%s使用,不建议复用。
400 Application.NoInstanceAvailable No instance is available for the application. Please scale out and try again. 应用没有可用实例,请扩容后重试。
400 SlbAppVSwitch.NotMatch The SLB instance does not match the vSwitch of the current application. SLB与应用vSwitch不匹配。
404 InvalidAppId.NotFound The specified AppId does not exist. 指定的AppId不存在。

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

变更历史

更多信息,参考变更详情。