调用CreateLoadBalancerHTTPSListener接口为传统型负载均衡创建HTTPS监听。
注意事项
新建的监听的状态为stopped。创建完成后,调用StartLoadBalancerListener接口启动监听来转发流量。
前提条件
您已经创建传统型负载均衡,具体操作,请参见CreateLoadBalancer。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
RegionId | String | 否 | cn-hangzhou |
传统型负载均衡实例的地域ID。 您可以从地域和可用区列表或通过调用DescribeRegions接口查询地域ID。 |
Action | String | 是 | CreateLoadBalancerHTTPSListener |
系统规定参数。取值:CreateLoadBalancerHTTPSListener。 |
LoadBalancerId | String | 是 | lb-bp1o94dp5i6earr**** |
传统型负载均衡实例的ID。 |
Bandwidth | Integer | 是 | -1 |
监听的带宽峰值。单位:Mbps。 取值范围:-1或1~5120。
|
ListenerPort | Integer | 是 | 80 |
实例前端使用的端口。 取值范围:1~65535。 |
BackendServerPort | Integer | 否 | 80 |
实例后端使用的端口,取值范围:1~65535。 如果不使用服务器组(不指定VServerGroupId),则该参数必选。 |
XForwardedFor | String | 否 | on |
是否通过
|
Scheduler | String | 否 | wrr |
调度算法。取值:
|
StickySession | String | 是 | on |
是否开启会话保持。取值:
|
StickySessionType | String | 否 | insert |
Cookie的处理方式。取值:insert或server。
说明 当StickySession的值为on时,必须指定该参数。
|
CookieTimeout | Integer | 否 | 500 |
Cookie超时时间。单位:秒。 取值:1~86400。 说明 当StickySession为on且StickySessionType为insert时,该参数必选。
|
Cookie | String | 否 | B490B5EBF6F3CD402E515D22BCDA**** |
服务器上配置的Cookie。 长度为1~200个字符,只能包含ASCII英文字母和数字字符,不能包含半角逗号(,)、半角分号(;)或空格,也不能以美元符号($)开头。 说明 当StickySession为on且StickySessionType为server时,该参数必选。
|
HealthCheck | String | 是 | on |
是否开启健康检查。取值:
|
HealthCheckMethod | String | 否 | get |
监听HTTP类型健康检查的健康检查方法。取值:head或get。 说明 HealthCheck值为on时才会有效。
|
HealthCheckDomain | String | 否 | 172.XX.XX.16 |
用于健康检查的域名。取值:
说明 在HealthCheck值为on时才会有效。
|
HealthCheckURI | String | 否 | /test/index.html |
用于健康检查的URI。 URI长度为1~80个字符,可包含英文字母、数字和 说明 在HealthCheck值为on时才会有效。
|
HealthyThreshold | Integer | 否 | 4 |
健康检查连续成功多少次后,将后端服务器的健康检查状态由fail判定为success。 取值:2~10。 说明 在HealthCheck值为on时才会有效。
|
UnhealthyThreshold | Integer | 否 | 4 |
健康检查连续失败多少次后,将后端服务器的健康检查状态由success判定为fail。 取值:2~10。 说明 在HealthCheck值为on时才会有效。
|
HealthCheckTimeout | Integer | 否 | 3 |
接收来自运行状况检查的响应需要等待的时间。如果后端ECS在指定的时间内没有正确响应,则判定为健康检查失败。单位:秒。 取值:1~300。 说明
|
HealthCheckConnectPort | Integer | 否 | 8080 |
健康检查使用的端口。 取值:1~65535。 说明 当HealthCheck值为on时才会有效。
|
HealthCheckInterval | Integer | 否 | 5 |
健康检查的时间间隔。单位:秒。 取值:1~50。 说明 在HealthCheck值为on时才会有效。
|
HealthCheckHttpCode | String | 否 | http_2xx,http_3xx |
健康检查正常的HTTP状态码,多个状态码用半角逗号(,)分割。 取值:http_2xx、http_3xx、http_4xx或http_5xx。 说明 在HealthCheck值为on时才会有效。
|
ServerCertificateId | String | 是 | idkp-123-cn-test-**** |
服务器证书的ID。 |
VServerGroupId | String | 否 | rsp-cige6j5e7p**** |
服务器组ID。 |
CACertificateId | String | 否 | 139a00604ad-cn-east-hangzh**** |
CA证书ID。 若既上传CA证书又上传服务器证书,即采用双向认证。 若用户只上传服务器证书,即为单向认证。 |
XForwardedFor_SLBIP | String | 否 | on |
是否通过
|
XForwardedFor_SLBID | String | 否 | on |
是否通过
|
XForwardedFor_proto | String | 否 | on |
是否通过
|
Gzip | String | 否 | on |
是否开启
|
AclId | String | 否 | nacl-a2do9e413e0spzasx**** |
监听绑定的访问策略组ID。 说明 当AclStatus参数的值为on时,该参数必选。
|
AclType | String | 否 | white |
访问控制类型。取值:
说明 当AclStatus参数的值为on时,该参数有效。
|
AclStatus | String | 否 | off |
是否开启访问控制功能。取值:
|
Description | String | 否 | HTTPS_443 |
自定义监听名称。 长度限制为1~256个字符,支持中文、字母、数字、短划线(-)、正斜线(/)、半角句号(.)和下划线(_)。 |
IdleTimeout | Integer | 否 | 12 |
指定连接空闲超时时间,取值范围为1~60,默认值为15。单位:秒。 在超时时间内一直没有访问请求,负载均衡会暂时中断当前连接,直到一下次请求来临时重新建立新的连接。 |
RequestTimeout | Integer | 否 | 23 |
指定请求超时时间,取值范围为1~180,默认值为60。单位:秒。 在超时时间内后端服务器一直没有响应,负载均衡将放弃等待,给客户端返回HTTP 504错误码。 |
EnableHttp2 | String | 否 | off |
是否开启HTTP2特性。取值:
|
TLSCipherPolicy | String | 否 | tls_cipher_policy_1_1 |
安全策略包含HTTPS可选的TLS协议版本和配套的加密算法套件。
|
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | CEF72CEB-54B6-4AE8-B225-F876FF7BA984 |
请求ID。 |
示例
请求示例
http(s)://[Endpoint]/?RegionId=cn-hangzhou
&Action=CreateLoadBalancerHTTPSListener
&LoadBalancerId=lb-bp1o94dp5i6earr****
&Bandwidth=-1
&ListenerPort=80
&BackendServerPort=80
&XForwardedFor=on
&Scheduler=wrr
&StickySession=on
&StickySessionType=insert
&CookieTimeout=500
&Cookie=B490B5EBF6F3CD402E515D22BCDA****
&HealthCheck=on
&HealthCheckMethod=get
&HealthCheckDomain=172.XX.XX.16
&HealthCheckURI=/test/index.html
&HealthyThreshold=4
&UnhealthyThreshold=4
&HealthCheckTimeout=3
&HealthCheckConnectPort=8080
&HealthCheckInterval=5
&HealthCheckHttpCode=http_2xx,http_3xx
&ServerCertificateId=idkp-123-cn-test-****
&VServerGroupId=rsp-cige6j5e7p****
&CACertificateId=139a00604ad-cn-east-hangzh****
&XForwardedFor_SLBIP=on
&XForwardedFor_SLBID=on
&XForwardedFor_proto=on
&Gzip=on
&AclId=nacl-a2do9e413e0spzasx****
&AclType=white
&AclStatus=off
&Description=HTTPS_443
&IdleTimeout=12
&RequestTimeout=23
&EnableHttp2=off
&TLSCipherPolicy=tls_cipher_policy_1_1
&ServerCertificate=[{}]
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateLoadBalancerHTTPSListenerResponse>
<RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
</CreateLoadBalancerHTTPSListenerResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | ParamDuplicateError | The specified parameter value of XForwardedFor_ClientCertSubjectDNAlias is duplicate. Please change to a different one. | 参数XForwardedFor_ClientCertSubjectDNAlias重复。 |
400 | ParamDuplicateError | The specified parameter value of XForwardedFor_ClientCertIssuerDNAlias is duplicate. Please change to a different one. | 参数XForwardedFor_ClientCertIssuerDNAlias重复。 |
400 | ParamDuplicateError | The specified parameter value of XForwardedFor_ClientCertFingerprintAlias is duplicate. Please change to a different one. | 参数XForwardedFor_ClientCertFingerprintAlias重复。 |
400 | ParamDuplicateError | The specified parameter value of XForwardedFor_ClientCertClientVerifyAlias is duplicate. Please change to a different one. | 参数XForwardedFor_ClientCertClientVerifyAlias重复。 |
400 | IpVersionConflict | The ip version of this LoadBalancer and the Acl is conflict. | 指定负载均衡的IP版本与ACL支持的IP类型冲突。 |
400 | InvalidParameter.IdleTimeout | The specified IdleTimeout exceeds the limit. | 指定的IdleTimeout无效。请检查参数约束,并在修改后重试。 |
400 | InvalidParameter.RequestTimeout | The specified RequestTimeout exceeds the limit. | 指定的RequestTimeout无效。请检查参数约束,并在修改后重试。 |
400 | ListenerForwardNotSupport | X-Forward-For is not supported to a ipv6 instance. | Ipv6负载均衡实例不支持X-Forward-For。 |
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. | 指定的certkey不属于当前用户。 |
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. | 指定的Acl不存在。 |
400 | OperationUnsupported.CreateLoadBalancerLayer7Listener | The slb instance does not support create HTTP or HTTPS listener. | 当前负载均衡实例不支持创建HTTP或者HTTPS类型的监听。 |
400 | InvalidParameter.VServerGroupId | The MasterSlaveServerGroup can not be attached to HTTP or HTTPS listener. | HTTP或HTTPS监听不支持挂载主备服务器组。 |
400 | MissingParam.HealthCheckDomain | The HealthCheckDomain is required when HealthCheckHttpVersion is http1.1. | 参数HealthCheckDomain缺失。 |
400 | InvalidParameter.HealthCheckHttpVersion | The param HealthCheckHttpVersion is invalid. | 指定的HealthCheckHttpVersion无效。请检查参数约束,并在修改后重试。 |
400 | QuotaLimitExceeds.AclAttachedToListener | %s. | Acl绑定监听数已达到配额上限。 |
400 | QuotaLimitExceeds.TotalAclEntry | %s. | Acl条目数已达到配额上限。 |
400 | Duplicated.AclEntry | %s. | Acl条目重复。 |
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. | 指定的TLS策略不存在。 |
400 | TLSPolicyConfiguring | The specified TLS cipher policy is configuring. | 指定的TLSCipherPolicy正在变配中。 |
400 | TLSCipherPolicyVipRelationOverLimit | The number of listeners associated with a policy has exceeded. | 监听关联TLSCipherPolicy的数量已达到配额上限。 |
400 | CertificateTypeMismatched | The certificate type does not match. | 指定证书的类型不匹配。 |
400 | MissingParam.ServerCertificates | Server certificates are required. | 参数ServerCertificates缺失。 |
400 | TooManyCertificates | The number of certificates must not be greater than one. | 证书的数量不得大于1个。 |
400 | CnCertificateNotSupport | The cn certificate is not support. | 不支持国密证书。 |
400 | InvalidParam.CertificateBindingType | The param CertificateBindingType is invalid. | 指定的CertificateBindingType无效。请检查参数约束,并在修改后重试。 |
400 | InvalidParamSize.ServerCertificates | The size of param ServerCertificates is invalid. | 指定的ServerCertificates长度无效。请检查参数约束,并在修改后重试。 |
400 | TooManyCertificates.ServerCertificates | The number of certificates must not be greater than one. | 证书的数量不得大于1个。 |
400 | LbNotSupportTcpssl | You cannot create a TCP SSL type listener for the specified load balancer. | 指定的实例不支持创建tcpssl类型的监听。 |
400 | LbSupportTcpsslOnly | The specified load balancer supports TCP SSL type listener only. | 指定的实例只支持创建tcpssl类型的监听。 |
400 | ListenerNotSupportRule | You cannot create a rule for the specified listener. | 指定的监听不支持创建转发规则。 |
400 | Mismatch.SlbSpecTypeAndListenerProtocol | The SlbSpecType and ListenerProtocol are mismatched. | 实例规格类型和监听类型不匹配。 |
访问错误中心查看更多错误码。