建立HTTPS監聽。
介面說明
注意事項
建立的監聽的狀態為 stopped。建立完成後,調用 StartLoadBalancerListener 介面啟動監聽來轉寄流量。
前提條件
您已經建立傳統型負載平衡,具體操作,請參見 CreateLoadBalancer 。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
slb:CreateLoadBalancerHTTPSListener |
create |
*acl
*certificate
*loadbalancer
|
|
無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| RegionId |
string |
否 |
傳統型Server Load Balancer執行個體的地區 ID。 您可以從地區和可用性區域列表或通過調用 DescribeRegions 介面查詢地區 ID。 |
cn-hangzhou |
| LoadBalancerId |
string |
是 |
傳統型Server Load Balancer執行個體的 ID。 |
lb-bp1o94dp5i6earr**** |
| Bandwidth |
integer |
是 |
監聽的頻寬峰值。單位:Mbps。 取值範圍:
|
-1 |
| ListenerPort |
integer |
是 |
執行個體前端使用的連接埠。 取值範圍:1~65535。 |
80 |
| BackendServerPort |
integer |
否 |
執行個體後端使用的連接埠,取值範圍:1~65535。 如果不使用伺服器組(不指定 VServerGroupId),則該參數必選。 |
80 |
| Tag |
array<object> |
否 |
標籤列表。 |
|
|
object |
否 |
標籤列表。 |
||
| Key |
string |
否 |
監聽的標籤鍵。N 的取值範圍:1~20。一旦傳入該值,則不允許為空白字串。最多支援 64 個字元,不能以 |
TestKey |
| Value |
string |
否 |
監聽的標籤值。N 的取值範圍:1~20。一旦傳入該值,可以為空白字串。最多支援 128 個字元,不能以 |
TestValue |
| XForwardedFor |
string |
否 |
是否通過
|
on |
| Scheduler |
string |
否 |
調度演算法。取值:
|
wrr |
| StickySession |
string |
否 |
是否開啟會話保持。取值:
|
on |
| StickySessionType |
string |
否 |
Cookie 的處理方式。取值:insert 或 server。
用戶端第一次訪問時,負載平衡會在返回請求中植入 Cookie(即在 HTTP/HTTPS 響應報文中插入 SERVERID),下次用戶端攜帶此 Cookie 訪問,負載平衡服務會將請求定向轉寄給之前記錄到的後端伺服器上。
負載平衡發現使用者自訂了 Cookie,將會對原來的 Cookie 進行重寫,下次用戶端攜帶新的 Cookie 訪問,負載平衡服務會將請求定向轉寄給之前記錄到的後端伺服器。 說明
當 StickySession 的值為 on 時,必須指定該參數。 |
insert |
| CookieTimeout |
integer |
否 |
Cookie 逾時時間。單位:秒。 取值:1~86400。 說明
當 StickySession 為 on 且 StickySessionType 為 insert 時,該參數必選。 |
500 |
| Cookie |
string |
否 |
伺服器上配置的 Cookie。 長度為 1~200 個字元,只能包含 ASCII 英文字母和數字字元,不能包含半形逗號(,)、半形分號(;)或空格,也不能以貨幣符號($)開頭。 說明
當 StickySession 為 on 且 StickySessionType 為 server 時,該參數必選。 |
testCookie |
| HealthCheck |
string |
是 |
是否開啟健全狀態檢查。取值:
|
on |
| HealthCheckMethod |
string |
否 |
監聽 HTTP 類型健全狀態檢查的健全狀態檢查方法。取值:head 或 get。 說明
HealthCheck 值為 on 時才會有效。 |
get |
| HealthCheckDomain |
string |
否 |
用於健全狀態檢查的網域名稱。取值:
說明
在 HealthCheck 值為 on 時才會有效。 |
172.XX.XX.16 |
| HealthCheckURI |
string |
否 |
用於健全狀態檢查的 URI。 URI 長度為 1~80 個字元,可包含英文字母、數字和 說明
在 HealthCheck 值為 on 時才會有效。 |
/test/index.html |
| HealthyThreshold |
integer |
否 |
健全狀態檢查連續成功多少次後,將後端伺服器的健全狀態檢查狀態由 fail 判定為 success。 取值:2~10。 說明
在 HealthCheck 值為 on 時才會有效。 |
4 |
| UnhealthyThreshold |
integer |
否 |
健全狀態檢查連續失敗多少次後,將後端伺服器的健全狀態檢查狀態由 success 判定為 fail。 取值:2~10。 說明
在 HealthCheck 值為 on 時才會有效。 |
4 |
| HealthCheckTimeout |
integer |
否 |
接收來自健全狀態檢查的響應需要等待的時間。如果後端 ECS 在指定的時間內沒有正確響應,則判定為健全狀態檢查失敗。單位:秒。取值:1~300。 說明
在 HealthCheck 值為 on 時才會有效。 |
3 |
| HealthCheckConnectPort |
integer |
否 |
健全狀態檢查使用的連接埠。 取值:1~65535。 說明
當 HealthCheck 值為 on 時才會有效。 |
8080 |
| HealthCheckInterval |
integer |
否 |
健全狀態檢查的時間間隔。單位:秒。 取值:1~50。 說明
在 HealthCheck 值為 on 時才會有效。 |
5 |
| HealthCheckHttpCode |
string |
否 |
健全狀態檢查正常的 HTTP 狀態代碼,多個狀態代碼用半形逗號(,)分割。 取值:http_2xx、http_3xx、http_4xx或http_5xx。 說明
在 HealthCheck 值為 on 時才會有效。 |
http_2xx,http_3xx |
| ServerCertificateId |
string |
否 |
伺服器憑證的 ID。 |
idkp-123-cn-test-**** |
| VServerGroupId |
string |
否 |
伺服器組 ID。 |
rsp-cige6j5e7p**** |
| CACertificateId |
string |
否 |
CA 憑證 ID。 若既上傳 CA 憑證又上傳伺服器憑證,即採用雙向認證。 若使用者只上傳伺服器憑證,即為單向認證。 |
139a00604ad-cn-east-hangzh**** |
| XForwardedFor_SLBIP |
string |
否 |
是否通過
|
on |
| XForwardedFor_SLBID |
string |
否 |
是否通過
|
on |
| XForwardedFor_proto |
string |
否 |
是否通過
|
on |
| Gzip |
string |
否 |
是否開啟
|
on |
| AclId |
string |
否 |
監聽綁定的存取原則組 ID。 說明
當 AclStatus 參數的值為 on 時,該參數必選。 |
acl-a2do9e413e0spzasx**** |
| AclType |
string |
否 |
存取控制類型。取值:
如果開啟了白名單訪問,但存取原則組中沒有添加任何 IP,則負載平衡監聽會轉寄全部請求。
如果開啟了黑名單訪問,但存取原則組中沒有添加任何 IP,則負載平衡監聽會轉寄全部請求。 說明
當 AclStatus 參數的值為 on 時,該參數有效。 |
white |
| AclStatus |
string |
否 |
是否開啟存取控制功能。取值:
|
off |
| Description |
string |
否 |
自訂監聽名稱。 長度限制為 1~256 個字元,支援中文、字母、數字、短劃線(-)、正斜線(/)、半形句號(.)和底線(_)。 |
HTTPS_443 |
| IdleTimeout |
integer |
否 |
指定串連空閑逾時時間,取值範圍為1~60,預設值為 15。單位:秒。 在逾時時間內一直沒有訪問請求,負載平衡會暫時中斷當前串連,直到一下次請求來臨時重建立立新的串連。 |
12 |
| RequestTimeout |
integer |
否 |
指定請求逾時時間,取值範圍為1~180,預設值為 60。單位:秒。 在逾時時間內後端伺服器一直沒有響應,負載平衡將放棄等待,給用戶端返回 HTTP 504 錯誤碼。 |
23 |
| EnableHttp2 |
string |
否 |
是否開啟 HTTP2 特性。取值:
|
off |
| TLSCipherPolicy |
string |
否 |
安全性原則包含 HTTPS 可選的 TLS 協議版本和配套的密碼編譯演算法套件。
|
tls_cipher_policy_1_1 |
| XForwardedFor_SLBPORT |
string |
否 |
是否通過
|
off |
| XForwardedFor_ClientSrcPort |
string |
否 |
是否通過
|
off |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| RequestId |
string |
請求 ID。 |
CEF72CEB-54B6-4AE8-B225-F876FF7BA984 |
樣本
正常返回樣本
JSON格式
{
"RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | ParamDuplicateError | The specified parameter value of XForwardedFor_ClientCertSubjectDNAlias is duplicate. Please change to a different one. | |
| 400 | IpVersionConflict | The ip version of this LoadBalancer and the Acl is conflict. | |
| 400 | InvalidParameter.IdleTimeout | The specified IdleTimeout exceeds the limit. | |
| 400 | InvalidParameter.RequestTimeout | The specified RequestTimeout exceeds the limit. | |
| 400 | ListenerForwardNotSupport | X-Forward-For is not supported to a ipv6 instance. | |
| 400 | InvalidParameter.RegionNotSupport | The region does not support the parameter: %s. | |
| 400 | InvalidParameter.SpecNotSupport | The loadBalancer of shared spec does not support the parameter: %s. | |
| 400 | ListenerProcessing | A previous configuration of the listener is pending,please try again later. | |
| 400 | Certkey.Forbidden | The specified certkey is not owned by the current user. | |
| 400 | InvalidParameter.ListenerPortConflict | There is conflict listener port exists. | |
| 400 | ResourceNotAvailible.HttpsListener | The specified Zone did not have enough resource. | |
| 400 | AclNotExist | Acl does not exist. | |
| 400 | OperationUnsupported.CreateLoadBalancerLayer7Listener | The slb instance does not support create HTTP or HTTPS listener. | |
| 400 | InvalidParameter.VServerGroupId | The MasterSlaveServerGroup can not be attached to HTTP or HTTPS listener. | |
| 400 | MissingParam.HealthCheckDomain | The HealthCheckDomain is required when HealthCheckHttpVersion is http1.1. | |
| 400 | InvalidParameter.HealthCheckHttpVersion | The param HealthCheckHttpVersion is invalid. | |
| 400 | Duplicated.AclEntry | %s. | |
| 400 | CertificateNotExist | The specified CertificateId does not exist. | |
| 400 | OperationFailed.InsufficientResources | The loadbalancer does not support this operation because of insufficient resources. | |
| 400 | InvalidTLSPolicyId.NotExist | The specified TLS cipher policy does not exist. | |
| 400 | TLSPolicyConfiguring | The specified TLS cipher policy is configuring. | |
| 400 | TLSCipherPolicyVipRelationOverLimit | The number of listeners associated with a policy has exceeded. | |
| 400 | CertificateTypeMismatched | The certificate type does not match. | |
| 400 | MissingParam.ServerCertificates | Server certificates are required. | |
| 400 | TooManyCertificates | The number of certificates must not be greater than one. | |
| 400 | CnCertificateNotSupport | The cn certificate is not support. | |
| 400 | InvalidParam.CertificateBindingType | The param CertificateBindingType is invalid. | |
| 400 | InvalidParamSize.ServerCertificates | The size of param ServerCertificates is invalid. | |
| 400 | TooManyCertificates.ServerCertificates | The number of certificates must not be greater than one. | |
| 400 | SPEC_NOT_SUPPORT_PARAMETER | Share spec does not support the feature. | |
| 400 | LbNotSupportTcpssl | You cannot create a TCP SSL type listener for the specified load balancer. | |
| 400 | LbSupportTcpsslOnly | The specified load balancer supports TCP SSL type listener only. | |
| 400 | ListenerNotSupportRule | You cannot create a rule for the specified listener. | |
| 400 | Mismatch.SlbSpecTypeAndListenerProtocol | The SlbSpecType and ListenerProtocol are mismatched. | |
| 400 | InvalidParam.TagValue | %s. | |
| 400 | InvalidParam.TagKey | %s. | |
| 400 | SizeLimitExceeded.Tag | %s. | |
| 400 | MissingParam.TagKey | The param MissingParam.TagKey is missing. | |
| 400 | AclListenerOverLimit | This acl has reached the limit of binding to listeners. | |
| 400 | QuotaLimitExceeds.AclAttachedToListener | The number of Acl bound listeners has reached the quota limit | |
| 400 | QuotaLimitExceeds.TotalAclEntry | The number of Acl entries has reached the quota limit. | |
| 400 | QuotaLimitExceeds.AclListenerOverLimit | This acl has reached the limit of binding to listeners. | |
| 404 | ResourceNotFound.Certificate | The specified resource is not found. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。