文档

BindSlb - 为应用绑定SLB

更新时间:

调用BindSlb接口为应用绑定SLB。

调试

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

授权信息

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

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
sae:BindSlb
  • 全部资源
    *

请求语法

POST /pop/v1/sam/app/slb

请求参数

名称类型必填描述示例值
AppIdstring

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

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

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

  • port:SLB 端口。
  • targetPort:容器端口。
  • protocol:网络协议。支持 TCPHTTPHTTPS
  • httpsCertId:SSL 证书。仅限选择 HTTPS 时需配置 SSL 证书。
[{"port":80,"targetPort":8080,"protocol":"TCP"}]
Intranetstring

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

  • port:SLB 端口。
  • targetPort:容器端口。
  • protocol:网络协议。支持 TCPHTTPHTTPS
  • httpsCertId:SSL 证书。仅限选择 HTTPS 时需配置 SSL 证书。
[{"port":80,"targetPort":8080,"protocol":"TCP"}]
InternetSlbIdstring

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

lb-bp1tg0k6d9nqaw7l1****
IntranetSlbIdstring

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

lb-bp1tg0k6d9nqaw7l1****

返回参数

名称类型描述示例值
object

返回数据。

RequestIdstring

请求 ID。

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

调用结果的附加信息。

success
TraceIdstring

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

0a98a02315955564772843261e****
Dataobject

返回结果。

ChangeOrderIdstring

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

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

错误码。取值说明如下:

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

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

  • 2xx:成功。
  • 3xx:重定向。
  • 4xx:请求错误。
  • 5xx:服务器错误。
200
Successboolean

绑定 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错误码错误信息描述
400Slb.NotFoundThe SLB instance does not exist: slbId [%s]SLB不存在:slbId[%s]。
400InvalidApplication.NotFoundThe current application does not exist.找不到当前应用。
400InvalidParameter.NotEmptyYou must specify the parameter %s.不合法的参数:%s不能为空。
400InvalidParameter.ObviouslyThe specified parameter is invalid {%s}.不合法的参数{%s}。
400SlbHttpsCert.NotConsistentThe HTTPS listening certificate for each listener must match.SLB设置HTTPS监听证书配置必须一致。
400SlbHttpsCert.NotFoundYou must configure the certificate before you configure HTTPS listening for the SLB instance.SLB设置HTTPS监听必须有证书配置。
400SlbListenerPort.NotAvailableThe SLB listening port is unavailable: slbId [%s], port [%s]SLB监听端口被占用:slbId[%s], port[%s]。
400SlbListenerType.InvalidAn SLB listener type error occurred. Only HTTPS and TCP are supported.SLB监听类型异常,只支持HTTPS和TCP类型。
400SlbSpec.NotSupportShared performance SLB instances are not supported.不支持性能共享型SLB实例。
400SlbType.InvalidAn SLB network type error occurred.SLB网络类型异常。
400SSLCert.NotFoundThe specified SSL certificate cannot be found.找不到对应的SSL证书。
400System.UpgradingThe system is being upgraded. Please try again later.系统正在升级,请稍后操作。
400Application.ChangerOrderRunningAn application change process is in progress. Please try again later.应用有变更流程正在执行,请稍后重试。
400Application.InvalidStatusThe application status is abnormal. Please try again later.应用状态异常,请稍后重试。
400Application.NotDeployYetThe application has not been deployed. Please deploy it and try again.应用没有部署,请部署后重试。
400InvalidParam.ProtocolNotSupportOnly TCP protocol is supported.不支持指定的协议,只支持TCP协议。
400SLBInstanceQuota.OverQuotaThe total number of SLB instances exceeds the quota. Please reduce the instances and try again.SLB总实例数超过了限额,请您减少数量后重试。
400Slb.Tag.Not.QualifiedThe current SLB instance cannot be reused because it may have been occupied by %s.SLB实例正在被%s使用,不建议复用。
400Application.NoInstanceAvailableNo instance is available for the application. Please scale out and try again.应用没有可用实例,请扩容后重试。
400SlbAppVSwitch.NotMatchThe SLB instance does not match the vSwitch of the current application.SLB与应用vSwitch不匹配。
404InvalidAppId.NotFoundThe specified AppId does not exist.指定的AppId不存在。

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

变更历史

变更时间变更内容概要操作
2022-02-25OpenAPI 错误码发生变更查看变更详情