Skip to main content

CreateLoadBalancerHTTPListener

Description

call CreateLoadBalancerHTTPListener to create HTTP listeners.

Request Method

POST

Request Path

/apsara/route/Slb/CreateLoadBalancerHTTPListener

Request Parameters Common Parameters

NameLocationTypeRequiredSample valueDescription
CookieTimeoutBODYintegerNo500Cookie timeout. value:1~86400 seconds. description when StickySession is on and StickySessionType is insert, this parameter is required.
VServerGroupIdBODYstringNorsp-cige6j****virtual server group ID.
DescriptionBODYstringNolistening instructionsset the description information of the listener. The length is limited to 1 to 80 characters, including letters, numbers, dashes (-), forward slashes (/), English periods (.), and underscores (_). Chinese description is supported.
UnhealthyThresholdBODYintegerNo4after how many consecutive health checks have failed, determine the health check status of the back-end server from success to failure . value:2~10. description in HealthCheck value is on is valid.
SchedulerBODYstringNowrrscheduling algorithm. Value: wrr(Default value): The backend server with the higher the weight value, the higher the number of times (probability) it is polled. wlc: In addition to polling according to the weight value set by each back-end server, the actual load of the back-end server (that is, the number of connections) is also considered. When the weight value is the same, the number of times (probability) that the backend server with the smaller the current number of connections is polled is higher. rr: distribute external requests to backend servers in sequence according to the access order.
HealthCheckURIBODYstringNo/test/index.htmlURI for health check. length is limited to 1~80, only letters, numbers and -/.%? &# amp;amp; these characters. The URL cannot only be a forward slash (/), but must start with a forward slash (/). description in HealthCheck value is on is valid.
HealthCheckBODYstringYesonwhether to turn on health check. Value:on or off.
IdleTimeoutBODYintegerNo3specifies the connection idle timeout period, the value range is 1~60 seconds, and the default value is 15 seconds. there has been no access request during the timeout period. load balancing will temporarily interrupt the current connection until the next request comes to temporarily re-establish a new connection.
LoadBalancerIdBODYstringYeslb-bp1c9vixxjh92q83tw****ID of the load balancing instance.
BackendServerPortBODYintegerNo80the port used by the backend of the load balancing instance. value:1~65535. Description If the server group is not used (VServerGroupId parameter is not specified), this parameter is required.
XForwardedFor_SLBIDBODYstringNoonwhether to pass SLB-ID header field to obtain the load balancing instance ID. value:on or off(default value).
HealthCheckConnectPortBODYintegerNo80the port of the backend server for health check. value: 1~65535. description in HealthCheck value is on is valid.
BandwidthBODYintegerYes-1The peak bandwidth of the monitor, in Mbps. Value: -1: no bandwidth peak value is limited. 1~5120: the peak bandwidth of the listener. the sum of the peak bandwidth of all listeners cannot exceed the peak bandwidth of the instance. Description This parameter is only applicable to Mainland China.
GzipBODYstringNoonWhether to turn on Gzip compression to compress specific file types. The default value is on. value:on or off(default value).
StickySessionTypeBODYstringNoinsertCookie processing method. Value: insert: insert cookies. /span>/p> p data-tag = "p" class = "p"> when the client accesses for the first time, load balancing will implant Cookie in the return request (I .e. insert ServerId in HTTP or HTTPS response message). next time the client carries this Cookie for access, load balancing service will direct and forward the request to the backend server previously recorded. server: rewrite Cookie. /span>/p> p data-tag = "p" class = "p"> span data-tag = "text" class = "text"> load balancing finds that the user has customized the cookie and will rewrite the original cookie. next time the client carries a new cookie access, the load balancing service will direct and forward the request to the previously recorded back-end server. description when StickySession the value is on, this parameter must be specified.
XForwardedFor_SLBIPBODYstringNoonwhether to pass SLB-IP header field obtains the real IP of the client request. value:on or off(default value).
HealthCheckHttpCodeBODYstringNohttp_2xx,http_3xxnormal HTTP status code for health check, multiple status codes separated by commas. default value is http_2xx. value:http_2xx, http_3xx, http_4xx or http_5xx. description in HealthCheck value is on is valid.
CookieBODYstringNoB490B5EBF6F3CD402E515D22BCDA1598Cookie configured on the server. is 1 to 200 characters in length and can only contain ASCII English letters and numeric characters, cannot contain commas (,), semicolons (;) or spaces, and cannot start with dollar signs ($). description when StickySession is on and StickySessionType is server, this parameter is required.
ListenerPortBODYintegerYes80the port used by the front end of the load balancing instance. value:1~65535.
RequestTimeoutBODYintegerNo6specifies the request timeout period, which ranges from 1 to 180 seconds, and the default value is 60 seconds. /p> p data-tag = "p" class = "p"> span data-tag = "text" class = "text"> the back-end server has not responded during the timeout period, and load balancing will give up waiting, return HTTP 504 error code to the client.
HealthCheckIntervalBODYintegerNo5time interval for health check. value: 1~50 seconds. description in HealthCheck value is on is valid.
HealthCheckTimeoutBODYintegerNo3the time to wait to receive the response from the health check. If the backend ECS does not respond correctly within the specified time, the health check is determined to have failed. In HealthCheck the value is on will only be valid. value:1~300 seconds. description if HealthCHeckTimeout the value is less than HealthCheckInterval, then HealthCHeckTimeout is invalid, the timeout period is HealthCheckInterval.
versionBODYstringNo2016-01-01version of api
ListenerForwardBODYstringNooffwhether to enable HTTP to HTTPS forwarding. Value:on or off.
StickySessionBODYstringYesoffwhether to enable session persistence. Value:on or off.
ForwardPortBODYintegerNo443HTTP to HTTPS listening and forwarding port.
regionIdBODYstringYesNo sample value for this parameter.region id
HealthyThresholdBODYintegerNo4after how many consecutive successful health checks, determine the health check status of the back-end server from failure to success . value:2~10. description in HealthCheck value is on is valid.
XForwardedForBODYstringNoonwhether to open pass X-Forwarded-For header field to obtain the real IP of the visitor. the value is on.
HealthCheckDomainBODYstringNo172.XX.XX.6domain name used for health check, value: $_ ip: the private network IP of the backend server. When the IP address is specified or this parameter is not specified, Server Load Balancer uses the private IP address of each backend server as the domain name used for health check. domain: The domain name is 1 to 80 characters in length and can only contain letters, numbers, English periods (.) and dashes (-). description in HealthCheck value is on is valid.
XForwardedFor_protoBODYstringNoonwhether to pass X-Forwarded-Proto the header field obtains the listening protocol of the load balancing instance. value:on or off(default value).

Return data

NameTypeSample valueDescription
RequestIdstringCEF72CEB-54B6-4AE8-B225-F876FF7BA984request ID.

Example

Successful Response example

{
"RequestId":"CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
}

Failed Response example

{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}

}