CreateLoadBalancerHTTPListener_负载均衡_API文档

插件下载了解更多
VS Code 插件
安装插件之前,确保已安装 VS Code安装插件之前,确保已安装 VS Code
Alibaba Cloud Developer Toolkit is a collection of extensions that can help access Alibaba Cloud services in Visual Studio Code.
JetBrains 插件
安装插件之前,确保已安装 JetBrains IDE安装插件之前,确保已安装 JetBrains IDE
The Alibaba Cloud Developer Toolkit for JetBrains makes it easier to access Alibaba Cloud services.

接口说明

注意事项

新建的监听的状态为 stopped。创建完成后,调用 StartLoadBalancerListener 接口启动监听来转发流量。

前提条件

您已经创建传统型负载均衡,具体操作,请参见 CreateLoadBalancer

流控信息

请求速率为90/60(s)。更多流控信息,请前往配额中心查看

授权信息

如下是此API对应的授权信息,用于RAM权限策略语句的Action元素中,为RAM用户或RAM角色授予调用此API的权限。请通过 RAM 访问控制设置,使用方法可参考访问控制帮助文档

具体说明如下:展开详情

操作访问级别资源类型条件关键字关联操作
slb:CreateLoadBalancerHTTPListener
Create
acl
acs:slb:{#regionId}:{#accountId}:acl/{#aclId}
loadbalancer
acs:slb:{#regionId}:{#accountId}:loadbalancer/{#loadbalancerId}
slb:tag
slb:tag
slb:tag

请求参数

字段名称字段详情
RegionIdstring

传统型负载均衡实例的地域 ID。展开详情

示例值:cn-hangzhou参考取值来源:
    DescribeRegions
LoadBalancerIdstring

传统型负载均衡实例 ID。

示例值:lb-bp1c9vixxjh92q83tw*****参考取值来源:
    CreateLoadBalancer
    DescribeLoadBalancers
Bandwidthinteger<int32>

监听的带宽峰值,单位:Mbps。取值:展开详情

示例值:-1取值 <= 5120
ListenerPortinteger<int32>

实例前端使用的端口。展开详情

示例值:80取值 <= 65535
BackendServerPortinteger<int32>

实例后端使用的端口。展开详情

示例值:80取值 <= 65535
XForwardedForstring

是否开启通过X-Forwarded-For头字段获取来访客户端 IP。取值:展开详情

示例值:on
Schedulerstring

调度算法。取值:展开详情

示例值:wrr
StickySessionstring

是否开启会话保持。取值:展开详情

示例值:off
StickySessionTypestring

Cookie 处理方式。取值:展开详情

示例值:insert
Tagarray<object>

标签列表。

子级条数 <= 20
CookieTimeoutinteger<int32>

Cookie 超时时间。单位:秒。展开详情

示例值:500取值 <= 86400
Cookiestring

服务器上配置的 Cookie。展开详情

示例值:testCookie
HealthCheckstring

是否开启健康检查。取值:展开详情

示例值:on
HealthCheckMethodstring

监听 HTTP 类型健康检查的健康检查方法。取值:headget展开详情

示例值:get
HealthCheckDomainstring

用于健康检查的域名,取值:展开详情

示例值:172.16.*.*/12
HealthCheckURIstring

用于健康检查的 URI。展开详情

示例值:/test/index.html
HealthyThresholdinteger<int32>

健康检查连续成功多少次后,将后端服务器的健康检查状态由失败判定为成功展开详情

示例值:4取值 <= 10
UnhealthyThresholdinteger<int32>

健康检查连续失败多少次后,将后端服务器的健康检查状态由成功判定为失败展开详情

示例值:4取值 <= 10
HealthCheckTimeoutinteger<int32>

接收来自运行状况检查的响应需要等待的时间。如果后端 ECS 在指定的时间内没有正确响应,则判定为健康检查失败。单位:秒。展开详情

示例值:3取值 <= 300
HealthCheckConnectPortinteger<int32>

健康检查的后端服务器的端口。展开详情

示例值:80取值 <= 65535
HealthCheckIntervalinteger<int32>

健康检查的时间间隔。单位:秒。展开详情

示例值:5取值 <= 50
HealthCheckHttpCodestring

健康检查正常的 HTTP 状态码,多个状态码用逗号分隔。展开详情

示例值:http_2xx
VServerGroupIdstring

虚拟服务器组 ID。

示例值:rsp-cige6j*****参考取值来源:
    CreateVServerGroup
    DescribeVServerGroups
    SetVServerGroupAttribute
    AddVServerGroupBackendServers
    RemoveVServerGroupBackendServers
    ModifyVServerGroupBackendServers
XForwardedFor_SLBIPstring

是否通过SLB-IP头字段获取客户端请求的 VIP(Virtual IP address)。取值:展开详情

示例值:on
XForwardedFor_SLBIDstring

是否通过SLB-ID头字段获取负载均衡实例 ID。取值:展开详情

示例值:on参考取值来源:
    DescribeLoadBalancerListeners
XForwardedFor_protostring

是否通过X-Forwarded-Proto头字段获取负载均衡实例的监听协议。取值:展开详情

示例值:on
Gzipstring

是否开启Gzip压缩,对特定文件类型进行压缩。取值:展开详情

示例值:on
AclIdstring

监听绑定的访问策略组 ID。展开详情

示例值:acl-uf60jw******
AclTypestring

访问控制类型。取值:展开详情

示例值:white
AclStatusstring

是否开启访问控制功能。取值:展开详情

示例值:off
Descriptionstring

自定义监听名称。展开详情

示例值:HTTP_443
ListenerForwardstring

是否开启 HTTP 至 HTTPS 的转发。取值:展开详情

示例值:off参考取值来源:
    DescribeLoadBalancerListeners
ForwardPortinteger<int32>

HTTP 至 HTTPS 的监听转发端口。

示例值:443取值 <= 65535
IdleTimeoutinteger<int32>

指定连接空闲超时时间。单位:秒。展开详情

示例值:3取值 <= 9999
RequestTimeoutinteger<int32>

指定请求超时时间。单位:秒。展开详情

示例值:6取值 <= 9999
XForwardedFor_SLBPORTstring

是否通过XForwardedFor_SLBPORT头字段获取负载均衡实例的监听端口。取值:展开详情

示例值:off
XForwardedFor_ClientSrcPortstring

是否通过XForwardedFor_ClientSrcPort头字段获取访问负载均衡实例客户端的端口。取值:展开详情

示例值:off

返回参数

字段名称字段详情
RequestIdstring

请求 ID。

示例值:CEF72CEB-54B6-4AE8-B225-F876FF7BA984

返回示例

错误码

全局错误码
HTTP 状态码错误码错误信息操作
400
InvalidParameter.RegionNotSupport
The region does not support the parameter: %s.诊断
400
IpVersionConflict
The ip version of this LoadBalancer and the Acl is conflict.诊断
400
InvalidParameter
The specified ListenerPort or ForwardPort is invalid.诊断
400
ListenerForwardNotSupport
X-Forward-For is not supported to a ipv6 instance.诊断
400
InvalidParameter.IdleTimeout
The specified IdleTimeout exceeds the limit.诊断
400
InvalidParameter.RequestTimeout
The specified RequestTimeout exceeds the limit.诊断
400
ListenerProcessing
A previous configuration of the listener is pending,please try again later.诊断
400
InvalidParameter.ListenerPortConflict
There is conflict listener port exists.诊断
400
ResourceNotAvailible.HttpListener
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
OperationFailed.InsufficientResources
The loadbalancer does not support this operation because of insufficient resources.诊断
400
InvalidParameter.ForwardCode
The specified ForwardCode is invalid.诊断
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.诊断

变更历史

变更时间变更内容概要操作
2025-02-11
变更错误码400
2025-01-08
变更错误码400
2024-12-25
变更请求参数StickySession
2023-12-14
新增请求参数XForwardedFor_SLBPORT
新增请求参数XForwardedFor_ClientSrcPort
2023-06-02
变更请求参数Tag

相关示例

创建UDP/TCP/HTTP/HTTPS监听、查询和修改监听的配置
2021-11-16