account or zone Load Balancer Details·续4
priority: optional number
The order in which rules should be executed in relation to each other. Lower values are executed first. Values do not need to be sequential. If no value is provided for any rule the array order of the rules field will be used to assign a priority.
minimum0
<a href="#(resource)%20load_balancers%20%3E%20(method)%20get%20%3E%20(network%20schema)%20%3E%20(property)%20result%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20rules%20%3E%20(schema)%20%3E%20(property)%20priority">Link to this property</a>
terminates: optional boolean
If this rule’s condition is true, this causes rule evaluation to stop after processing this rule.
<a href="#(resource)%20load_balancers%20%3E%20(method)%20get%20%3E%20(network%20schema)%20%3E%20(property)%20result%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20rules%20%3E%20(schema)%20%3E%20(property)%20terminates">Link to this property</a>
</details>
<a href="#(resource)%20load_balancers%20%3E%20(method)%20get%20%3E%20(network%20schema)%20%3E%20(property)%20result%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20rules">Link to this property</a>
<details>
<summary>
session_affinity: optional <a href="https://developers.cloudflare.com/api/resources/load_balancers#(resource)%20load_balancers%20%3E%20(model)%20session_affinity%20%3E%20(schema)">SessionAffinity</a>
Specifies the type of session affinity the load balancer should use unless specified as <code>"none"</code>. The supported types are: - <code>"cookie"</code>: On the first request to a proxied load balancer, a cookie is generated, encoding information of which origin the request will be forwarded to. Subsequent requests, by the same client to the same load balancer, will be sent to the origin server the cookie encodes, for the duration of the cookie and as long as the origin server remains healthy. If the cookie has expired or the origin server is unhealthy, then a new origin server is calculated and used. - <code>"ip_cookie"</code>: Behaves the same as <code>"cookie"</code> except the initial origin selection is stable and based on the client’s ip address. - <code>"header"</code>: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see <code>session_affinity_attributes.headers</code>) is generated, encoding the request headers used for storing in the load balancer session state which origin the request will be forwarded to. Subsequent requests to the load balancer with the same headers will be sent to the same origin server, for the duration of the session and as long as the origin server remains healthy. If the session has been idle for the duration of <code>session_affinity_ttl</code> seconds or the origin server is unhealthy, then a new origin server is calculated and used. See <code>headers</code> in <code>session_affinity_attributes</code> for additional required configuration.
</summary>
One of the following:
"none"
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20session_affinity%20%3E%20(schema)%20%3E%20(member)%200">Link to this property</a>
"cookie"
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20session_affinity%20%3E%20(schema)%20%3E%20(member)%201">Link to this property</a>
"ip_cookie"
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20session_affinity%20%3E%20(schema)%20%3E%20(member)%202">Link to this property</a>
"header"
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20session_affinity%20%3E%20(schema)%20%3E%20(member)%203">Link to this property</a>
</details>
<a href="#(resource)%20load_balancers%20%3E%20(method)%20get%20%3E%20(network%20schema)%20%3E%20(property)%20result%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity">Link to this property</a>
<details>
<summary>
session_affinity_attributes: optional <a href="https://developers.cloudflare.com/api/resources/load_balancers#(resource)%20load_balancers%20%3E%20(model)%20session_affinity_attributes%20%3E%20(schema)">SessionAffinityAttributes</a> { drain_duration, headers, require_all_headers, 3 more }
Configures attributes for session affinity.
</summary>
drain_duration: optional number
Configures the drain duration in seconds. This field is only used when session affinity is enabled on the load balancer.
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity_attributes%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20session_affinity_attributes%20%3E%20(schema)%20%3E%20(property)%20drain_duration">Link to this property</a>
headers: optional array of string
Configures the names of HTTP headers to base session affinity on when header <code>session_affinity</code> is enabled. At least one HTTP header name must be provided. To specify the exact cookies to be used, include an item in the following format: <code>"cookie:<cookie-name-1>,<cookie-name-2>"</code> (example) where everything after the colon is a comma-separated list of cookie names. Providing only <code>"cookie"</code> will result in all cookies being used. The default max number of HTTP header names that can be provided depends on your plan: 5 for Enterprise, 1 for all other plans.
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity_attributes%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20session_affinity_attributes%20%3E%20(schema)%20%3E%20(property)%20headers">Link to this property</a>
require_all_headers: optional boolean
When header <code>session_affinity</code> is enabled, this option can be used to specify how HTTP headers on load balancing requests will be used. The supported values are: - <code>"true"</code>: Load balancing requests must contain all of the HTTP headers specified by the <code>headers</code> session affinity attribute, otherwise sessions aren’t created. - <code>"false"</code>: Load balancing requests must contain at least one of the HTTP headers specified by the <code>headers</code> session affinity attribute, otherwise sessions aren’t created.
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity_attributes%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20session_affinity_attributes%20%3E%20(schema)%20%3E%20(property)%20require_all_headers">Link to this property</a>
<details>
<summary>
samesite: optional "Auto"or "Lax"or "None"or "Strict"
Configures the SameSite attribute on session affinity cookie. Value “Auto” will be translated to “Lax” or “None” depending if Always Use HTTPS is enabled. Note: when using value “None”, the secure attribute can not be set to “Never”.
</summary>
One of the following:
"Auto"
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity_attributes%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20session_affinity_attributes%20%3E%20(schema)%20%3E%20(property)%20samesite%20%3E%20(member)%200">Link to this property</a>
"Lax"
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity_attributes%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20session_affinity_attributes%20%3E%20(schema)%20%3E%20(property)%20samesite%20%3E%20(member)%201">Link to this property</a>
"None"
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity_attributes%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20session_affinity_attributes%20%3E%20(schema)%20%3E%20(property)%20samesite%20%3E%20(member)%202">Link to this property</a>
"Strict"
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity_attributes%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20session_affinity_attributes%20%3E%20(schema)%20%3E%20(property)%20samesite%20%3E%20(member)%203">Link to this property</a>
</details>
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity_attributes%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20session_affinity_attributes%20%3E%20(schema)%20%3E%20(property)%20samesite">Link to this property</a>
<details>
<summary>
secure: optional "Auto"or "Always"or "Never"
Configures the Secure attribute on session affinity cookie. Value “Always” indicates the Secure attribute will be set in the Set-Cookie header, “Never” indicates the Secure attribute will not be set, and “Auto” will set the Secure attribute depending if Always Use HTTPS is enabled.
</summary>
One of the following:
"Auto"
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity_attributes%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20session_affinity_attributes%20%3E%20(schema)%20%3E%20(property)%20secure%20%3E%20(member)%200">Link to this property</a>
"Always"
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity_attributes%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20session_affinity_attributes%20%3E%20(schema)%20%3E%20(property)%20secure%20%3E%20(member)%201">Link to this property</a>
"Never"
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity_attributes%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20session_affinity_attributes%20%3E%20(schema)%20%3E%20(property)%20secure%20%3E%20(member)%202">Link to this property</a>
</details>
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity_attributes%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20session_affinity_attributes%20%3E%20(schema)%20%3E%20(property)%20secure">Link to this property</a>
<details>
<summary>
zero_downtime_failover: optional "none"or "temporary"or "sticky"
Configures the zero-downtime failover between origins within a pool when session affinity is enabled. This feature is currently incompatible with Argo, Tiered Cache, and Bandwidth Alliance. The supported values are: - <code>"none"</code>: No failover takes place for sessions pinned to the origin (default). - <code>"temporary"</code>: Traffic will be sent to another other healthy origin until the originally pinned origin is available; note that this can potentially result in heavy origin flapping. - <code>"sticky"</code>: The session affinity cookie is updated and subsequent requests are sent to the new origin. Note: Zero-downtime failover with sticky sessions is currently not supported for session affinity by header.
</summary>
One of the following:
"none"
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity_attributes%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20session_affinity_attributes%20%3E%20(schema)%20%3E%20(property)%20zero_downtime_failover%20%3E%20(member)%200">Link to this property</a>
"temporary"
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity_attributes%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20session_affinity_attributes%20%3E%20(schema)%20%3E%20(property)%20zero_downtime_failover%20%3E%20(member)%201">Link to this property</a>
"sticky"
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity_attributes%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20session_affinity_attributes%20%3E%20(schema)%20%3E%20(property)%20zero_downtime_failover%20%3E%20(member)%202">Link to this property</a>
</details>
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity_attributes%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20session_affinity_attributes%20%3E%20(schema)%20%3E%20(property)%20zero_downtime_failover">Link to this property</a>
</details>
<a href="#(resource)%20load_balancers%20%3E%20(method)%20get%20%3E%20(network%20schema)%20%3E%20(property)%20result%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity_attributes">Link to this property</a>
session_affinity_ttl: optional number
Time, in seconds, until a client’s session expires after being created. Once the expiry time has been reached, subsequent requests may get sent to a different origin server. The accepted ranges per <code>session_affinity</code> policy are: - <code>"cookie"</code> / <code>"ip_cookie"</code>: The current default of 23 hours will be used unless explicitly set. The accepted range of values is between [1800, 604800]. - <code>"header"</code>: The current default of 1800 seconds will be used unless explicitly set. The accepted range of values is between [30, 3600]. Note: With session affinity by header, sessions only expire after they haven’t been used for the number of seconds specified.
<a href="#(resource)%20load_balancers%20%3E%20(method)%20get%20%3E%20(network%20schema)%20%3E%20(property)%20result%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20session_affinity_ttl">Link to this property</a>
<details>
<summary>
steering_policy: optional <a href="https://developers.cloudflare.com/api/resources/load_balancers#(resource)%20load_balancers%20%3E%20(model)%20steering_policy%20%3E%20(schema)">SteeringPolicy</a>
Steering Policy for this load balancer.
- <code>"off"</code>: Use <code>default_pools</code>.
- <code>"geo"</code>: Use <code>region_pools</code>/<code>country_pools</code>/<code>pop_pools</code>. For non-proxied requests, the country for <code>country_pools</code> is determined by <code>location_strategy</code>.
- <code>"random"</code>: Select a pool randomly.
- <code>"dynamic_latency"</code>: Use round trip time to select the closest pool in default_pools (requires pool health checks).
- <code>"proximity"</code>: Use the pools’ latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by <code>location_strategy</code> for non-proxied requests.
- <code>"least_outstanding_requests"</code>: Select a pool by taking into consideration <code>random_steering</code> weights, as well as each pool’s number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.
- <code>"least_connections"</code>: Select a pool by taking into consideration <code>random_steering</code> weights, as well as each pool’s number of open connections. Pools with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.
- <code>""</code>: Will map to <code>"geo"</code> if you use <code>region_pools</code>/<code>country_pools</code>/<code>pop_pools</code> otherwise <code>"off"</code>.
</summary>
One of the following:
"off"
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20steering_policy%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20steering_policy%20%3E%20(schema)%20%3E%20(member)%200">Link to this property</a>
"geo"
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20steering_policy%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20steering_policy%20%3E%20(schema)%20%3E%20(member)%201">Link to this property</a>
"random"
<a href="#(resource)%20load_balancers%20%3E%20(model)%20load_balancer%20%3E%20(schema)%20%3E%20(property)%20steering_policy%20%2B%20(resource)%20load_balancers%20%3E%20(model)%20steering_policy%20%3E%20(schema)%20%3E%20(member)%202">Link to this property</a>
"dynamic_latency"
