Skip to main content

SetLoadBalancerHTTPListenerAttribute

Description

call SetLoadBalancerHTTPListenerAttribute to modify the configuration of HTTP listening.

Request Method

POST

Request Path

/apsara/route/Slb/SetLoadBalancerHTTPListenerAttribute

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.
MaxConnectionBODYintegerNo10Maximum number of connections.
VServerGroupIdBODYstringNorsp-cige6j****server group ID.
DescriptionBODYstringNotestset the description information of the listener.
UnhealthyThresholdBODYintegerNo4after how many consecutive health checks have failed, the health check status of the backend server is determined from success to failure . Value: 2 ~ 10. description is valid only when HealthCheck is on.
SchedulerBODYstringNowrrscheduling algorithm. Value: wrr: the backend server with the higher the weight value, the number of times (probability) it is polled is also higher. wlc: in addition to polling according to the weight value set by each back-end server, the actual load (that is, the number of connections) of the back-end server 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 back-end servers in sequence according to the access order.
HealthCheckURIBODYstringNo/test/index.htmlURI for health check. the length is limited to 1~80, and only letters, numbers, dashes (-), forward slashes (/), half-width periods (.), percent signs (%), half-width question marks (?), pound signs (#), and(& amp;) characters can be used. The URL cannot only be a forward slash (/), but must start with a forward slash (/). description is valid only when HealthCheck is on.
HealthCheckBODYstringNoonwhether to turn on health check. Value: on or off.
IdleTimeoutBODYintegerNo12specify the connection idle timeout time, 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-bp1qjwo61pqz3ah****ID of the load balancing instance.
VServerGroupBODYstringNoonwhether to use virtual server groups. Value: on or off.
XForwardedFor_SLBIDBODYstringNoonwhether to obtain the load balancing instance ID through the SLB-ID header field. Value: on or off.
HealthCheckConnectPortBODYintegerNo8080port used for health check. value: 1 ~ 65535. description only valid when HealthCheck value is on.
BandwidthBODYintegerNo-1The peak bandwidth of the monitor, in Mbps. Value: -1: for public network load balancing instances billed by traffic, the peak bandwidth can be set to -1, that is, the bandwidth peak is not limited. 1 ~ 5120: for public network load balancing instances that are billed by bandwidth, you can set the peak bandwidth of each listener, but the sum of the peak bandwidth of all listeners cannot exceed the peak bandwidth of the instance.
GzipBODYstringNoonWhether to turn on Gzip compression to compress specific file types. Value: on or off.
StickySessionTypeBODYstringNoinsertCookie processing method. Value: insert: insert Cookie. /p> p data-tag = "p" class = "p"> when the client accesses for the first time, the load balancing service will insert a cookie into the return request (I .e. insert a ServerId into the HTTP or HTTPS response message). the next time the client carries this cookie for access, the load balancing service will directionally forward the request to the back-end server previously recorded. server: Rewrite Cookie. /p> p data-tag = "p" class = "p"> load balancing finds that the user has customized the cookie, and will rewrite the original cookie. next time the client carries a new cookie to access, the load balancing service will directionally forward the request to the previously recorded back-end server. description when StickySession is on, this parameter must be specified.
XForwardedFor_SLBIPBODYstringNoonwhether to obtain the real IP requested by the client through the SLB-IP header field. Value: on or off.
HealthCheckHttpCodeBODYstringNohttp_2xxnormal HTTP status code for health check. multiple status codes are divided by commas (,). Value: http_2xx, http_3xx, http_4xx or http_5xx. description is valid only when HealthCheck is on.
TagsBODYstringNo{"tagKey":"Key1","tagValue":"Value1"}tag key and value.
CookieBODYstringNoB490B5EBF6F3CD402E515D22BCDA1598Cookie configured on the server. The length is 1 ~ 200 characters, supports ASCII English letters and numeric characters, cannot contain half-width commas (,), half-width 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.
RequestTimeoutBODYintegerNo3specify the request timeout time, the value range is 1 ~ 180 seconds. the default value is 60 seconds. /p> p data-tag = "p" class = "p"> the back-end server has not responded during the timeout period. load balancing will give up waiting and return HTTP 504 error code to the client.
HealthCheckIntervalBODYintegerNo5time interval for health check. value: 1 ~ 50 seconds. description is valid only when HealthCheck is on.
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. Only valid when HealthCheck value is on. value: 1 ~ 300 seconds. description if the value of HealthCHeckTimeout is less than the value of HealthCheckInterval, then HealthCHeckTimeout is invalid, the timeout is the value of HealthCheckInterval.
versionBODYstringNo2016-01-01version of api
StickySessionBODYstringNoonwhether to enable session persistence. Value: on or off.
regionIdBODYstringYesNo sample value for this parameter.region id
HealthyThresholdBODYintegerNo4after how many consecutive successful health checks, the health check status of the backend server is determined from failure to success . Value: 2 ~ 10. description is valid only when HealthCheck is on.
XForwardedForBODYstringNoonwhether to obtain the real IP requested by the client through XForwardedFor. The value is on.
HealthCheckDomainBODYstringNo172.XX.XX.6domain name used for health check, value: $_ ip: the private IP address of the backend server. When $_ip is specified or the HealthCheckDomain is not specified, SLB 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, half-width periods (.) and dashes (-). description is valid only when HealthCheck is on.
XForwardedFor_protoBODYstringNoonwhether to obtain the listening protocol of the load balancing instance through the X-Forwarded-Proto header field. Value: on or off.

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
}

}