全部產品
Search
文件中心

Serverless App Engine:BindSlb - 為應用綁定SLB

更新時間:Mar 17, 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:網路通訊協定。支援 TCPHTTPHTTPS

  • 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:網路通訊協定。支援 TCPHTTPHTTPS

  • 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不存在。

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情