load_balancers

package
v2.0.0-beta.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error = apierror.Error

type LoadBalancer

type LoadBalancer struct {
	ID string `json:"id"`
	// Controls features that modify the routing of requests to pools and origins in
	// response to dynamic conditions, such as during the interval between active
	// health monitoring requests. For example, zero-downtime failover occurs
	// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
	// response codes. If there is another healthy origin in the same pool, the request
	// is retried once against this alternate origin.
	AdaptiveRouting LoadBalancerAdaptiveRouting `json:"adaptive_routing"`
	// A mapping of country codes to a list of pool IDs (ordered by their failover
	// priority) for the given country. Any country not explicitly defined will fall
	// back to using the corresponding region_pool mapping if it exists else to
	// default_pools.
	CountryPools interface{} `json:"country_pools"`
	CreatedOn    time.Time   `json:"created_on" format:"date-time"`
	// A list of pool IDs ordered by their failover priority. Pools defined here are
	// used by default, or when region_pools are not configured for a given region.
	DefaultPools []string `json:"default_pools"`
	// Object description.
	Description string `json:"description"`
	// Whether to enable (the default) this load balancer.
	Enabled bool `json:"enabled"`
	// The pool ID to use when all other pools are detected as unhealthy.
	FallbackPool interface{} `json:"fallback_pool"`
	// Controls location-based steering for non-proxied requests. See `steering_policy`
	// to learn how steering is affected.
	LocationStrategy LoadBalancerLocationStrategy `json:"location_strategy"`
	ModifiedOn       time.Time                    `json:"modified_on" format:"date-time"`
	// The DNS hostname to associate with your Load Balancer. If this hostname already
	// exists as a DNS record in Cloudflare's DNS, the Load Balancer will take
	// precedence and the DNS record will not be used.
	Name string `json:"name"`
	// (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
	// (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
	// explicitly defined will fall back to using the corresponding country_pool, then
	// region_pool mapping if it exists else to default_pools.
	PopPools interface{} `json:"pop_pools"`
	// Whether the hostname should be gray clouded (false) or orange clouded (true).
	Proxied bool `json:"proxied"`
	// Configures pool weights.
	//
	//   - `steering_policy="random"`: A random pool is selected with probability
	//     proportional to pool weights.
	//   - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
	//     pool's outstanding requests.
	//   - `steering_policy="least_connections"`: Use pool weights to scale each pool's
	//     open connections.
	RandomSteering LoadBalancerRandomSteering `json:"random_steering"`
	// A mapping of region codes to a list of pool IDs (ordered by their failover
	// priority) for the given region. Any regions not explicitly defined will fall
	// back to using default_pools.
	RegionPools interface{} `json:"region_pools"`
	// BETA Field Not General Access: A list of rules for this load balancer to
	// execute.
	Rules []LoadBalancerRule `json:"rules"`
	// Specifies the type of session affinity the load balancer should use unless
	// specified as `"none"` or "" (default). The supported types are:
	//
	//   - `"cookie"`: 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.
	//   - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
	//     selection is stable and based on the client's ip address.
	//   - `"header"`: On the first request to a proxied load balancer, a session key
	//     based on the configured HTTP headers (see
	//     `session_affinity_attributes.headers`) 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 `session_affinity_ttl` seconds or the origin
	//     server is unhealthy, then a new origin server is calculated and used. See
	//     `headers` in `session_affinity_attributes` for additional required
	//     configuration.
	SessionAffinity LoadBalancerSessionAffinity `json:"session_affinity"`
	// Configures attributes for session affinity.
	SessionAffinityAttributes LoadBalancerSessionAffinityAttributes `json:"session_affinity_attributes"`
	// 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 `session_affinity` policy are:
	//
	//   - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
	//     unless explicitly set. The accepted range of values is between [1800, 604800].
	//   - `"header"`: 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.
	SessionAffinityTTL float64 `json:"session_affinity_ttl"`
	// Steering Policy for this load balancer.
	//
	//   - `"off"`: Use `default_pools`.
	//   - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
	//     requests, the country for `country_pools` is determined by
	//     `location_strategy`.
	//   - `"random"`: Select a pool randomly.
	//   - `"dynamic_latency"`: Use round trip time to select the closest pool in
	//     default_pools (requires pool health checks).
	//   - `"proximity"`: Use the pools' latitude and longitude to select the closest
	//     pool using the Cloudflare PoP location for proxied requests or the location
	//     determined by `location_strategy` for non-proxied requests.
	//   - `"least_outstanding_requests"`: Select a pool by taking into consideration
	//     `random_steering` weights, as well as each pool's number of outstanding
	//     requests. Pools with more pending requests are weighted proportionately less
	//     relative to others.
	//   - `"least_connections"`: Select a pool by taking into consideration
	//     `random_steering` 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.
	//   - `""`: Will map to `"geo"` if you use
	//     `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
	SteeringPolicy LoadBalancerSteeringPolicy `json:"steering_policy"`
	// Time to live (TTL) of the DNS entry for the IP address returned by this load
	// balancer. This only applies to gray-clouded (unproxied) load balancers.
	TTL  float64          `json:"ttl"`
	JSON loadBalancerJSON `json:"-"`
}

func (*LoadBalancer) UnmarshalJSON

func (r *LoadBalancer) UnmarshalJSON(data []byte) (err error)

type LoadBalancerAdaptiveRouting

type LoadBalancerAdaptiveRouting struct {
	// Extends zero-downtime failover of requests to healthy origins from alternate
	// pools, when no healthy alternate exists in the same pool, according to the
	// failover order defined by traffic and origin steering. When set false (the
	// default) zero-downtime failover will only occur between origins within the same
	// pool. See `session_affinity_attributes` for control over when sessions are
	// broken or reassigned.
	FailoverAcrossPools bool                            `json:"failover_across_pools"`
	JSON                loadBalancerAdaptiveRoutingJSON `json:"-"`
}

Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin.

func (*LoadBalancerAdaptiveRouting) UnmarshalJSON

func (r *LoadBalancerAdaptiveRouting) UnmarshalJSON(data []byte) (err error)

type LoadBalancerDeleteParams

type LoadBalancerDeleteParams struct {
	ZoneID param.Field[string] `path:"zone_id,required"`
}

type LoadBalancerDeleteResponse

type LoadBalancerDeleteResponse struct {
	ID   string                         `json:"id"`
	JSON loadBalancerDeleteResponseJSON `json:"-"`
}

func (*LoadBalancerDeleteResponse) UnmarshalJSON

func (r *LoadBalancerDeleteResponse) UnmarshalJSON(data []byte) (err error)

type LoadBalancerDeleteResponseEnvelope

type LoadBalancerDeleteResponseEnvelope struct {
	Errors   []LoadBalancerDeleteResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerDeleteResponseEnvelopeMessages `json:"messages,required"`
	Result   LoadBalancerDeleteResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success LoadBalancerDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    loadBalancerDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*LoadBalancerDeleteResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerDeleteResponseEnvelopeErrors

type LoadBalancerDeleteResponseEnvelopeErrors struct {
	Code    int64                                        `json:"code,required"`
	Message string                                       `json:"message,required"`
	JSON    loadBalancerDeleteResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerDeleteResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerDeleteResponseEnvelopeMessages

type LoadBalancerDeleteResponseEnvelopeMessages struct {
	Code    int64                                          `json:"code,required"`
	Message string                                         `json:"message,required"`
	JSON    loadBalancerDeleteResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerDeleteResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerDeleteResponseEnvelopeSuccess

type LoadBalancerDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerDeleteResponseEnvelopeSuccessTrue LoadBalancerDeleteResponseEnvelopeSuccess = true
)

type LoadBalancerEditParams

type LoadBalancerEditParams struct {
	ZoneID param.Field[string] `path:"zone_id,required"`
	// Controls features that modify the routing of requests to pools and origins in
	// response to dynamic conditions, such as during the interval between active
	// health monitoring requests. For example, zero-downtime failover occurs
	// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
	// response codes. If there is another healthy origin in the same pool, the request
	// is retried once against this alternate origin.
	AdaptiveRouting param.Field[LoadBalancerEditParamsAdaptiveRouting] `json:"adaptive_routing"`
	// A mapping of country codes to a list of pool IDs (ordered by their failover
	// priority) for the given country. Any country not explicitly defined will fall
	// back to using the corresponding region_pool mapping if it exists else to
	// default_pools.
	CountryPools param.Field[interface{}] `json:"country_pools"`
	// A list of pool IDs ordered by their failover priority. Pools defined here are
	// used by default, or when region_pools are not configured for a given region.
	DefaultPools param.Field[[]string] `json:"default_pools"`
	// Object description.
	Description param.Field[string] `json:"description"`
	// Whether to enable (the default) this load balancer.
	Enabled param.Field[bool] `json:"enabled"`
	// The pool ID to use when all other pools are detected as unhealthy.
	FallbackPool param.Field[interface{}] `json:"fallback_pool"`
	// Controls location-based steering for non-proxied requests. See `steering_policy`
	// to learn how steering is affected.
	LocationStrategy param.Field[LoadBalancerEditParamsLocationStrategy] `json:"location_strategy"`
	// The DNS hostname to associate with your Load Balancer. If this hostname already
	// exists as a DNS record in Cloudflare's DNS, the Load Balancer will take
	// precedence and the DNS record will not be used.
	Name param.Field[string] `json:"name"`
	// (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
	// (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
	// explicitly defined will fall back to using the corresponding country_pool, then
	// region_pool mapping if it exists else to default_pools.
	PopPools param.Field[interface{}] `json:"pop_pools"`
	// Whether the hostname should be gray clouded (false) or orange clouded (true).
	Proxied param.Field[bool] `json:"proxied"`
	// Configures pool weights.
	//
	//   - `steering_policy="random"`: A random pool is selected with probability
	//     proportional to pool weights.
	//   - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
	//     pool's outstanding requests.
	//   - `steering_policy="least_connections"`: Use pool weights to scale each pool's
	//     open connections.
	RandomSteering param.Field[LoadBalancerEditParamsRandomSteering] `json:"random_steering"`
	// A mapping of region codes to a list of pool IDs (ordered by their failover
	// priority) for the given region. Any regions not explicitly defined will fall
	// back to using default_pools.
	RegionPools param.Field[interface{}] `json:"region_pools"`
	// BETA Field Not General Access: A list of rules for this load balancer to
	// execute.
	Rules param.Field[[]LoadBalancerEditParamsRule] `json:"rules"`
	// Specifies the type of session affinity the load balancer should use unless
	// specified as `"none"` or "" (default). The supported types are:
	//
	//   - `"cookie"`: 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.
	//   - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
	//     selection is stable and based on the client's ip address.
	//   - `"header"`: On the first request to a proxied load balancer, a session key
	//     based on the configured HTTP headers (see
	//     `session_affinity_attributes.headers`) 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 `session_affinity_ttl` seconds or the origin
	//     server is unhealthy, then a new origin server is calculated and used. See
	//     `headers` in `session_affinity_attributes` for additional required
	//     configuration.
	SessionAffinity param.Field[LoadBalancerEditParamsSessionAffinity] `json:"session_affinity"`
	// Configures attributes for session affinity.
	SessionAffinityAttributes param.Field[LoadBalancerEditParamsSessionAffinityAttributes] `json:"session_affinity_attributes"`
	// 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 `session_affinity` policy are:
	//
	//   - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
	//     unless explicitly set. The accepted range of values is between [1800, 604800].
	//   - `"header"`: 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.
	SessionAffinityTTL param.Field[float64] `json:"session_affinity_ttl"`
	// Steering Policy for this load balancer.
	//
	//   - `"off"`: Use `default_pools`.
	//   - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
	//     requests, the country for `country_pools` is determined by
	//     `location_strategy`.
	//   - `"random"`: Select a pool randomly.
	//   - `"dynamic_latency"`: Use round trip time to select the closest pool in
	//     default_pools (requires pool health checks).
	//   - `"proximity"`: Use the pools' latitude and longitude to select the closest
	//     pool using the Cloudflare PoP location for proxied requests or the location
	//     determined by `location_strategy` for non-proxied requests.
	//   - `"least_outstanding_requests"`: Select a pool by taking into consideration
	//     `random_steering` weights, as well as each pool's number of outstanding
	//     requests. Pools with more pending requests are weighted proportionately less
	//     relative to others.
	//   - `"least_connections"`: Select a pool by taking into consideration
	//     `random_steering` 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.
	//   - `""`: Will map to `"geo"` if you use
	//     `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
	SteeringPolicy param.Field[LoadBalancerEditParamsSteeringPolicy] `json:"steering_policy"`
	// Time to live (TTL) of the DNS entry for the IP address returned by this load
	// balancer. This only applies to gray-clouded (unproxied) load balancers.
	TTL param.Field[float64] `json:"ttl"`
}

func (LoadBalancerEditParams) MarshalJSON

func (r LoadBalancerEditParams) MarshalJSON() (data []byte, err error)

type LoadBalancerEditParamsAdaptiveRouting

type LoadBalancerEditParamsAdaptiveRouting struct {
	// Extends zero-downtime failover of requests to healthy origins from alternate
	// pools, when no healthy alternate exists in the same pool, according to the
	// failover order defined by traffic and origin steering. When set false (the
	// default) zero-downtime failover will only occur between origins within the same
	// pool. See `session_affinity_attributes` for control over when sessions are
	// broken or reassigned.
	FailoverAcrossPools param.Field[bool] `json:"failover_across_pools"`
}

Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin.

func (LoadBalancerEditParamsAdaptiveRouting) MarshalJSON

func (r LoadBalancerEditParamsAdaptiveRouting) MarshalJSON() (data []byte, err error)

type LoadBalancerEditParamsLocationStrategy

type LoadBalancerEditParamsLocationStrategy struct {
	// Determines the authoritative location when ECS is not preferred, does not exist
	// in the request, or its GeoIP lookup is unsuccessful.
	//
	//   - `"pop"`: Use the Cloudflare PoP location.
	//   - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
	//     unsuccessful, use the Cloudflare PoP location.
	Mode param.Field[LoadBalancerEditParamsLocationStrategyMode] `json:"mode"`
	// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
	// authoritative location.
	//
	// - `"always"`: Always prefer ECS.
	// - `"never"`: Never prefer ECS.
	// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
	// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
	PreferEcs param.Field[LoadBalancerEditParamsLocationStrategyPreferEcs] `json:"prefer_ecs"`
}

Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected.

func (LoadBalancerEditParamsLocationStrategy) MarshalJSON

func (r LoadBalancerEditParamsLocationStrategy) MarshalJSON() (data []byte, err error)

type LoadBalancerEditParamsLocationStrategyMode

type LoadBalancerEditParamsLocationStrategyMode string

Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.

  • `"pop"`: Use the Cloudflare PoP location.
  • `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.
const (
	LoadBalancerEditParamsLocationStrategyModePop        LoadBalancerEditParamsLocationStrategyMode = "pop"
	LoadBalancerEditParamsLocationStrategyModeResolverIP LoadBalancerEditParamsLocationStrategyMode = "resolver_ip"
)

type LoadBalancerEditParamsLocationStrategyPreferEcs

type LoadBalancerEditParamsLocationStrategyPreferEcs string

Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.

- `"always"`: Always prefer ECS. - `"never"`: Never prefer ECS. - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`. - `"geo"`: Prefer ECS only when `steering_policy="geo"`.

const (
	LoadBalancerEditParamsLocationStrategyPreferEcsAlways    LoadBalancerEditParamsLocationStrategyPreferEcs = "always"
	LoadBalancerEditParamsLocationStrategyPreferEcsNever     LoadBalancerEditParamsLocationStrategyPreferEcs = "never"
	LoadBalancerEditParamsLocationStrategyPreferEcsProximity LoadBalancerEditParamsLocationStrategyPreferEcs = "proximity"
	LoadBalancerEditParamsLocationStrategyPreferEcsGeo       LoadBalancerEditParamsLocationStrategyPreferEcs = "geo"
)

type LoadBalancerEditParamsRandomSteering

type LoadBalancerEditParamsRandomSteering struct {
	// The default weight for pools in the load balancer that are not specified in the
	// pool_weights map.
	DefaultWeight param.Field[float64] `json:"default_weight"`
	// A mapping of pool IDs to custom weights. The weight is relative to other pools
	// in the load balancer.
	PoolWeights param.Field[interface{}] `json:"pool_weights"`
}

Configures pool weights.

  • `steering_policy="random"`: A random pool is selected with probability proportional to pool weights.
  • `steering_policy="least_outstanding_requests"`: Use pool weights to scale each pool's outstanding requests.
  • `steering_policy="least_connections"`: Use pool weights to scale each pool's open connections.

func (LoadBalancerEditParamsRandomSteering) MarshalJSON

func (r LoadBalancerEditParamsRandomSteering) MarshalJSON() (data []byte, err error)

type LoadBalancerEditParamsRule

type LoadBalancerEditParamsRule struct {
	// The condition expressions to evaluate. If the condition evaluates to true, the
	// overrides or fixed_response in this rule will be applied. An empty condition is
	// always true. For more details on condition expressions, please see
	// https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions.
	Condition param.Field[string] `json:"condition"`
	// Disable this specific rule. It will no longer be evaluated by this load
	// balancer.
	Disabled param.Field[bool] `json:"disabled"`
	// A collection of fields used to directly respond to the eyeball instead of
	// routing to a pool. If a fixed_response is supplied the rule will be marked as
	// terminates.
	FixedResponse param.Field[LoadBalancerEditParamsRulesFixedResponse] `json:"fixed_response"`
	// Name of this rule. Only used for human readability.
	Name param.Field[string] `json:"name"`
	// A collection of overrides to apply to the load balancer when this rule's
	// condition is true. All fields are optional.
	Overrides param.Field[LoadBalancerEditParamsRulesOverrides] `json:"overrides"`
	// 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.
	Priority param.Field[int64] `json:"priority"`
	// If this rule's condition is true, this causes rule evaluation to stop after
	// processing this rule.
	Terminates param.Field[bool] `json:"terminates"`
}

A rule object containing conditions and overrides for this load balancer to evaluate.

func (LoadBalancerEditParamsRule) MarshalJSON

func (r LoadBalancerEditParamsRule) MarshalJSON() (data []byte, err error)

type LoadBalancerEditParamsRulesFixedResponse

type LoadBalancerEditParamsRulesFixedResponse struct {
	// The http 'Content-Type' header to include in the response.
	ContentType param.Field[string] `json:"content_type"`
	// The http 'Location' header to include in the response.
	Location param.Field[string] `json:"location"`
	// Text to include as the http body.
	MessageBody param.Field[string] `json:"message_body"`
	// The http status code to respond with.
	StatusCode param.Field[int64] `json:"status_code"`
}

A collection of fields used to directly respond to the eyeball instead of routing to a pool. If a fixed_response is supplied the rule will be marked as terminates.

func (LoadBalancerEditParamsRulesFixedResponse) MarshalJSON

func (r LoadBalancerEditParamsRulesFixedResponse) MarshalJSON() (data []byte, err error)

type LoadBalancerEditParamsRulesOverrides

type LoadBalancerEditParamsRulesOverrides struct {
	// Controls features that modify the routing of requests to pools and origins in
	// response to dynamic conditions, such as during the interval between active
	// health monitoring requests. For example, zero-downtime failover occurs
	// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
	// response codes. If there is another healthy origin in the same pool, the request
	// is retried once against this alternate origin.
	AdaptiveRouting param.Field[LoadBalancerEditParamsRulesOverridesAdaptiveRouting] `json:"adaptive_routing"`
	// A mapping of country codes to a list of pool IDs (ordered by their failover
	// priority) for the given country. Any country not explicitly defined will fall
	// back to using the corresponding region_pool mapping if it exists else to
	// default_pools.
	CountryPools param.Field[interface{}] `json:"country_pools"`
	// A list of pool IDs ordered by their failover priority. Pools defined here are
	// used by default, or when region_pools are not configured for a given region.
	DefaultPools param.Field[[]string] `json:"default_pools"`
	// The pool ID to use when all other pools are detected as unhealthy.
	FallbackPool param.Field[interface{}] `json:"fallback_pool"`
	// Controls location-based steering for non-proxied requests. See `steering_policy`
	// to learn how steering is affected.
	LocationStrategy param.Field[LoadBalancerEditParamsRulesOverridesLocationStrategy] `json:"location_strategy"`
	// (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
	// (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
	// explicitly defined will fall back to using the corresponding country_pool, then
	// region_pool mapping if it exists else to default_pools.
	PopPools param.Field[interface{}] `json:"pop_pools"`
	// Configures pool weights.
	//
	//   - `steering_policy="random"`: A random pool is selected with probability
	//     proportional to pool weights.
	//   - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
	//     pool's outstanding requests.
	//   - `steering_policy="least_connections"`: Use pool weights to scale each pool's
	//     open connections.
	RandomSteering param.Field[LoadBalancerEditParamsRulesOverridesRandomSteering] `json:"random_steering"`
	// A mapping of region codes to a list of pool IDs (ordered by their failover
	// priority) for the given region. Any regions not explicitly defined will fall
	// back to using default_pools.
	RegionPools param.Field[interface{}] `json:"region_pools"`
	// Specifies the type of session affinity the load balancer should use unless
	// specified as `"none"` or "" (default). The supported types are:
	//
	//   - `"cookie"`: 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.
	//   - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
	//     selection is stable and based on the client's ip address.
	//   - `"header"`: On the first request to a proxied load balancer, a session key
	//     based on the configured HTTP headers (see
	//     `session_affinity_attributes.headers`) 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 `session_affinity_ttl` seconds or the origin
	//     server is unhealthy, then a new origin server is calculated and used. See
	//     `headers` in `session_affinity_attributes` for additional required
	//     configuration.
	SessionAffinity param.Field[LoadBalancerEditParamsRulesOverridesSessionAffinity] `json:"session_affinity"`
	// Configures attributes for session affinity.
	SessionAffinityAttributes param.Field[LoadBalancerEditParamsRulesOverridesSessionAffinityAttributes] `json:"session_affinity_attributes"`
	// 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 `session_affinity` policy are:
	//
	//   - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
	//     unless explicitly set. The accepted range of values is between [1800, 604800].
	//   - `"header"`: 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.
	SessionAffinityTTL param.Field[float64] `json:"session_affinity_ttl"`
	// Steering Policy for this load balancer.
	//
	//   - `"off"`: Use `default_pools`.
	//   - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
	//     requests, the country for `country_pools` is determined by
	//     `location_strategy`.
	//   - `"random"`: Select a pool randomly.
	//   - `"dynamic_latency"`: Use round trip time to select the closest pool in
	//     default_pools (requires pool health checks).
	//   - `"proximity"`: Use the pools' latitude and longitude to select the closest
	//     pool using the Cloudflare PoP location for proxied requests or the location
	//     determined by `location_strategy` for non-proxied requests.
	//   - `"least_outstanding_requests"`: Select a pool by taking into consideration
	//     `random_steering` weights, as well as each pool's number of outstanding
	//     requests. Pools with more pending requests are weighted proportionately less
	//     relative to others.
	//   - `"least_connections"`: Select a pool by taking into consideration
	//     `random_steering` 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.
	//   - `""`: Will map to `"geo"` if you use
	//     `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
	SteeringPolicy param.Field[LoadBalancerEditParamsRulesOverridesSteeringPolicy] `json:"steering_policy"`
	// Time to live (TTL) of the DNS entry for the IP address returned by this load
	// balancer. This only applies to gray-clouded (unproxied) load balancers.
	TTL param.Field[float64] `json:"ttl"`
}

A collection of overrides to apply to the load balancer when this rule's condition is true. All fields are optional.

func (LoadBalancerEditParamsRulesOverrides) MarshalJSON

func (r LoadBalancerEditParamsRulesOverrides) MarshalJSON() (data []byte, err error)

type LoadBalancerEditParamsRulesOverridesAdaptiveRouting

type LoadBalancerEditParamsRulesOverridesAdaptiveRouting struct {
	// Extends zero-downtime failover of requests to healthy origins from alternate
	// pools, when no healthy alternate exists in the same pool, according to the
	// failover order defined by traffic and origin steering. When set false (the
	// default) zero-downtime failover will only occur between origins within the same
	// pool. See `session_affinity_attributes` for control over when sessions are
	// broken or reassigned.
	FailoverAcrossPools param.Field[bool] `json:"failover_across_pools"`
}

Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin.

func (LoadBalancerEditParamsRulesOverridesAdaptiveRouting) MarshalJSON

func (r LoadBalancerEditParamsRulesOverridesAdaptiveRouting) MarshalJSON() (data []byte, err error)

type LoadBalancerEditParamsRulesOverridesLocationStrategy

type LoadBalancerEditParamsRulesOverridesLocationStrategy struct {
	// Determines the authoritative location when ECS is not preferred, does not exist
	// in the request, or its GeoIP lookup is unsuccessful.
	//
	//   - `"pop"`: Use the Cloudflare PoP location.
	//   - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
	//     unsuccessful, use the Cloudflare PoP location.
	Mode param.Field[LoadBalancerEditParamsRulesOverridesLocationStrategyMode] `json:"mode"`
	// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
	// authoritative location.
	//
	// - `"always"`: Always prefer ECS.
	// - `"never"`: Never prefer ECS.
	// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
	// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
	PreferEcs param.Field[LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcs] `json:"prefer_ecs"`
}

Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected.

func (LoadBalancerEditParamsRulesOverridesLocationStrategy) MarshalJSON

func (r LoadBalancerEditParamsRulesOverridesLocationStrategy) MarshalJSON() (data []byte, err error)

type LoadBalancerEditParamsRulesOverridesLocationStrategyMode

type LoadBalancerEditParamsRulesOverridesLocationStrategyMode string

Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.

  • `"pop"`: Use the Cloudflare PoP location.
  • `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.
const (
	LoadBalancerEditParamsRulesOverridesLocationStrategyModePop        LoadBalancerEditParamsRulesOverridesLocationStrategyMode = "pop"
	LoadBalancerEditParamsRulesOverridesLocationStrategyModeResolverIP LoadBalancerEditParamsRulesOverridesLocationStrategyMode = "resolver_ip"
)

type LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcs

type LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcs string

Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.

- `"always"`: Always prefer ECS. - `"never"`: Never prefer ECS. - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`. - `"geo"`: Prefer ECS only when `steering_policy="geo"`.

const (
	LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcsAlways    LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcs = "always"
	LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcsNever     LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcs = "never"
	LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcsProximity LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcs = "proximity"
	LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcsGeo       LoadBalancerEditParamsRulesOverridesLocationStrategyPreferEcs = "geo"
)

type LoadBalancerEditParamsRulesOverridesRandomSteering

type LoadBalancerEditParamsRulesOverridesRandomSteering struct {
	// The default weight for pools in the load balancer that are not specified in the
	// pool_weights map.
	DefaultWeight param.Field[float64] `json:"default_weight"`
	// A mapping of pool IDs to custom weights. The weight is relative to other pools
	// in the load balancer.
	PoolWeights param.Field[interface{}] `json:"pool_weights"`
}

Configures pool weights.

  • `steering_policy="random"`: A random pool is selected with probability proportional to pool weights.
  • `steering_policy="least_outstanding_requests"`: Use pool weights to scale each pool's outstanding requests.
  • `steering_policy="least_connections"`: Use pool weights to scale each pool's open connections.

func (LoadBalancerEditParamsRulesOverridesRandomSteering) MarshalJSON

func (r LoadBalancerEditParamsRulesOverridesRandomSteering) MarshalJSON() (data []byte, err error)

type LoadBalancerEditParamsRulesOverridesSessionAffinity

type LoadBalancerEditParamsRulesOverridesSessionAffinity string

Specifies the type of session affinity the load balancer should use unless specified as `"none"` or "" (default). The supported types are:

  • `"cookie"`: 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.
  • `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client's ip address.
  • `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) 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 `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.
const (
	LoadBalancerEditParamsRulesOverridesSessionAffinityNone     LoadBalancerEditParamsRulesOverridesSessionAffinity = "none"
	LoadBalancerEditParamsRulesOverridesSessionAffinityCookie   LoadBalancerEditParamsRulesOverridesSessionAffinity = "cookie"
	LoadBalancerEditParamsRulesOverridesSessionAffinityIPCookie LoadBalancerEditParamsRulesOverridesSessionAffinity = "ip_cookie"
	LoadBalancerEditParamsRulesOverridesSessionAffinityHeader   LoadBalancerEditParamsRulesOverridesSessionAffinity = "header"
	LoadBalancerEditParamsRulesOverridesSessionAffinityEmpty    LoadBalancerEditParamsRulesOverridesSessionAffinity = "\"\""
)

type LoadBalancerEditParamsRulesOverridesSessionAffinityAttributes

type LoadBalancerEditParamsRulesOverridesSessionAffinityAttributes struct {
	// Configures the drain duration in seconds. This field is only used when session
	// affinity is enabled on the load balancer.
	DrainDuration param.Field[float64] `json:"drain_duration"`
	// Configures the names of HTTP headers to base session affinity on when header
	// `session_affinity` 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: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything
	// after the colon is a comma-separated list of cookie names. Providing only
	// `"cookie"` 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.
	Headers param.Field[[]string] `json:"headers"`
	// When header `session_affinity` is enabled, this option can be used to specify
	// how HTTP headers on load balancing requests will be used. The supported values
	// are:
	//
	//   - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
	//     specified by the `headers` session affinity attribute, otherwise sessions
	//     aren't created.
	//   - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
	//     headers specified by the `headers` session affinity attribute, otherwise
	//     sessions aren't created.
	RequireAllHeaders param.Field[bool] `json:"require_all_headers"`
	// 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".
	Samesite param.Field[LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesite] `json:"samesite"`
	// 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.
	Secure param.Field[LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecure] `json:"secure"`
	// 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:
	//
	//   - `"none"`: No failover takes place for sessions pinned to the origin (default).
	//   - `"temporary"`: 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.
	//   - `"sticky"`: 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.
	ZeroDowntimeFailover param.Field[LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover] `json:"zero_downtime_failover"`
}

Configures attributes for session affinity.

func (LoadBalancerEditParamsRulesOverridesSessionAffinityAttributes) MarshalJSON

type LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesite

type LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesite string

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".

const (
	LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesiteAuto   LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesite = "Auto"
	LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesiteLax    LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesite = "Lax"
	LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesiteNone   LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesite = "None"
	LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesiteStrict LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSamesite = "Strict"
)

type LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecure

type LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecure string

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.

const (
	LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecureAuto   LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecure = "Auto"
	LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecureAlways LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecure = "Always"
	LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecureNever  LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesSecure = "Never"
)

type LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover

type LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover string

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:

  • `"none"`: No failover takes place for sessions pinned to the origin (default).
  • `"temporary"`: 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.
  • `"sticky"`: 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.
const (
	LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverNone      LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "none"
	LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "temporary"
	LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky    LoadBalancerEditParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "sticky"
)

type LoadBalancerEditParamsRulesOverridesSteeringPolicy

type LoadBalancerEditParamsRulesOverridesSteeringPolicy string

Steering Policy for this load balancer.

  • `"off"`: Use `default_pools`.
  • `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.
  • `"random"`: Select a pool randomly.
  • `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).
  • `"proximity"`: Use the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.
  • `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.
  • `"least_connections"`: Select a pool by taking into consideration `random_steering` 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.
  • `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
const (
	LoadBalancerEditParamsRulesOverridesSteeringPolicyOff                      LoadBalancerEditParamsRulesOverridesSteeringPolicy = "off"
	LoadBalancerEditParamsRulesOverridesSteeringPolicyGeo                      LoadBalancerEditParamsRulesOverridesSteeringPolicy = "geo"
	LoadBalancerEditParamsRulesOverridesSteeringPolicyRandom                   LoadBalancerEditParamsRulesOverridesSteeringPolicy = "random"
	LoadBalancerEditParamsRulesOverridesSteeringPolicyDynamicLatency           LoadBalancerEditParamsRulesOverridesSteeringPolicy = "dynamic_latency"
	LoadBalancerEditParamsRulesOverridesSteeringPolicyProximity                LoadBalancerEditParamsRulesOverridesSteeringPolicy = "proximity"
	LoadBalancerEditParamsRulesOverridesSteeringPolicyLeastOutstandingRequests LoadBalancerEditParamsRulesOverridesSteeringPolicy = "least_outstanding_requests"
	LoadBalancerEditParamsRulesOverridesSteeringPolicyLeastConnections         LoadBalancerEditParamsRulesOverridesSteeringPolicy = "least_connections"
	LoadBalancerEditParamsRulesOverridesSteeringPolicyEmpty                    LoadBalancerEditParamsRulesOverridesSteeringPolicy = "\"\""
)

type LoadBalancerEditParamsSessionAffinity

type LoadBalancerEditParamsSessionAffinity string

Specifies the type of session affinity the load balancer should use unless specified as `"none"` or "" (default). The supported types are:

  • `"cookie"`: 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.
  • `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client's ip address.
  • `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) 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 `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.
const (
	LoadBalancerEditParamsSessionAffinityNone     LoadBalancerEditParamsSessionAffinity = "none"
	LoadBalancerEditParamsSessionAffinityCookie   LoadBalancerEditParamsSessionAffinity = "cookie"
	LoadBalancerEditParamsSessionAffinityIPCookie LoadBalancerEditParamsSessionAffinity = "ip_cookie"
	LoadBalancerEditParamsSessionAffinityHeader   LoadBalancerEditParamsSessionAffinity = "header"
	LoadBalancerEditParamsSessionAffinityEmpty    LoadBalancerEditParamsSessionAffinity = "\"\""
)

type LoadBalancerEditParamsSessionAffinityAttributes

type LoadBalancerEditParamsSessionAffinityAttributes struct {
	// Configures the drain duration in seconds. This field is only used when session
	// affinity is enabled on the load balancer.
	DrainDuration param.Field[float64] `json:"drain_duration"`
	// Configures the names of HTTP headers to base session affinity on when header
	// `session_affinity` 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: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything
	// after the colon is a comma-separated list of cookie names. Providing only
	// `"cookie"` 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.
	Headers param.Field[[]string] `json:"headers"`
	// When header `session_affinity` is enabled, this option can be used to specify
	// how HTTP headers on load balancing requests will be used. The supported values
	// are:
	//
	//   - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
	//     specified by the `headers` session affinity attribute, otherwise sessions
	//     aren't created.
	//   - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
	//     headers specified by the `headers` session affinity attribute, otherwise
	//     sessions aren't created.
	RequireAllHeaders param.Field[bool] `json:"require_all_headers"`
	// 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".
	Samesite param.Field[LoadBalancerEditParamsSessionAffinityAttributesSamesite] `json:"samesite"`
	// 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.
	Secure param.Field[LoadBalancerEditParamsSessionAffinityAttributesSecure] `json:"secure"`
	// 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:
	//
	//   - `"none"`: No failover takes place for sessions pinned to the origin (default).
	//   - `"temporary"`: 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.
	//   - `"sticky"`: 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.
	ZeroDowntimeFailover param.Field[LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailover] `json:"zero_downtime_failover"`
}

Configures attributes for session affinity.

func (LoadBalancerEditParamsSessionAffinityAttributes) MarshalJSON

func (r LoadBalancerEditParamsSessionAffinityAttributes) MarshalJSON() (data []byte, err error)

type LoadBalancerEditParamsSessionAffinityAttributesSamesite

type LoadBalancerEditParamsSessionAffinityAttributesSamesite string

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".

const (
	LoadBalancerEditParamsSessionAffinityAttributesSamesiteAuto   LoadBalancerEditParamsSessionAffinityAttributesSamesite = "Auto"
	LoadBalancerEditParamsSessionAffinityAttributesSamesiteLax    LoadBalancerEditParamsSessionAffinityAttributesSamesite = "Lax"
	LoadBalancerEditParamsSessionAffinityAttributesSamesiteNone   LoadBalancerEditParamsSessionAffinityAttributesSamesite = "None"
	LoadBalancerEditParamsSessionAffinityAttributesSamesiteStrict LoadBalancerEditParamsSessionAffinityAttributesSamesite = "Strict"
)

type LoadBalancerEditParamsSessionAffinityAttributesSecure

type LoadBalancerEditParamsSessionAffinityAttributesSecure string

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.

const (
	LoadBalancerEditParamsSessionAffinityAttributesSecureAuto   LoadBalancerEditParamsSessionAffinityAttributesSecure = "Auto"
	LoadBalancerEditParamsSessionAffinityAttributesSecureAlways LoadBalancerEditParamsSessionAffinityAttributesSecure = "Always"
	LoadBalancerEditParamsSessionAffinityAttributesSecureNever  LoadBalancerEditParamsSessionAffinityAttributesSecure = "Never"
)

type LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailover

type LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailover string

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:

  • `"none"`: No failover takes place for sessions pinned to the origin (default).
  • `"temporary"`: 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.
  • `"sticky"`: 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.
const (
	LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailoverNone      LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailover = "none"
	LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailover = "temporary"
	LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailoverSticky    LoadBalancerEditParamsSessionAffinityAttributesZeroDowntimeFailover = "sticky"
)

type LoadBalancerEditParamsSteeringPolicy

type LoadBalancerEditParamsSteeringPolicy string

Steering Policy for this load balancer.

  • `"off"`: Use `default_pools`.
  • `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.
  • `"random"`: Select a pool randomly.
  • `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).
  • `"proximity"`: Use the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.
  • `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.
  • `"least_connections"`: Select a pool by taking into consideration `random_steering` 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.
  • `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
const (
	LoadBalancerEditParamsSteeringPolicyOff                      LoadBalancerEditParamsSteeringPolicy = "off"
	LoadBalancerEditParamsSteeringPolicyGeo                      LoadBalancerEditParamsSteeringPolicy = "geo"
	LoadBalancerEditParamsSteeringPolicyRandom                   LoadBalancerEditParamsSteeringPolicy = "random"
	LoadBalancerEditParamsSteeringPolicyDynamicLatency           LoadBalancerEditParamsSteeringPolicy = "dynamic_latency"
	LoadBalancerEditParamsSteeringPolicyProximity                LoadBalancerEditParamsSteeringPolicy = "proximity"
	LoadBalancerEditParamsSteeringPolicyLeastOutstandingRequests LoadBalancerEditParamsSteeringPolicy = "least_outstanding_requests"
	LoadBalancerEditParamsSteeringPolicyLeastConnections         LoadBalancerEditParamsSteeringPolicy = "least_connections"
	LoadBalancerEditParamsSteeringPolicyEmpty                    LoadBalancerEditParamsSteeringPolicy = "\"\""
)

type LoadBalancerEditResponseEnvelope

type LoadBalancerEditResponseEnvelope struct {
	Errors   []LoadBalancerEditResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerEditResponseEnvelopeMessages `json:"messages,required"`
	Result   LoadBalancer                               `json:"result,required"`
	// Whether the API call was successful
	Success LoadBalancerEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    loadBalancerEditResponseEnvelopeJSON    `json:"-"`
}

func (*LoadBalancerEditResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerEditResponseEnvelopeErrors

type LoadBalancerEditResponseEnvelopeErrors struct {
	Code    int64                                      `json:"code,required"`
	Message string                                     `json:"message,required"`
	JSON    loadBalancerEditResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerEditResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerEditResponseEnvelopeMessages

type LoadBalancerEditResponseEnvelopeMessages struct {
	Code    int64                                        `json:"code,required"`
	Message string                                       `json:"message,required"`
	JSON    loadBalancerEditResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerEditResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerEditResponseEnvelopeSuccess

type LoadBalancerEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerEditResponseEnvelopeSuccessTrue LoadBalancerEditResponseEnvelopeSuccess = true
)

type LoadBalancerGetParams

type LoadBalancerGetParams struct {
	ZoneID param.Field[string] `path:"zone_id,required"`
}

type LoadBalancerGetResponseEnvelope

type LoadBalancerGetResponseEnvelope struct {
	Errors   []LoadBalancerGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerGetResponseEnvelopeMessages `json:"messages,required"`
	Result   LoadBalancer                              `json:"result,required"`
	// Whether the API call was successful
	Success LoadBalancerGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    loadBalancerGetResponseEnvelopeJSON    `json:"-"`
}

func (*LoadBalancerGetResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerGetResponseEnvelopeErrors

type LoadBalancerGetResponseEnvelopeErrors struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    loadBalancerGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerGetResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerGetResponseEnvelopeMessages

type LoadBalancerGetResponseEnvelopeMessages struct {
	Code    int64                                       `json:"code,required"`
	Message string                                      `json:"message,required"`
	JSON    loadBalancerGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerGetResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerGetResponseEnvelopeSuccess

type LoadBalancerGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerGetResponseEnvelopeSuccessTrue LoadBalancerGetResponseEnvelopeSuccess = true
)

type LoadBalancerListParams

type LoadBalancerListParams struct {
	ZoneID param.Field[string] `path:"zone_id,required"`
}

type LoadBalancerListResponseEnvelope

type LoadBalancerListResponseEnvelope struct {
	Errors   []LoadBalancerListResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerListResponseEnvelopeMessages `json:"messages,required"`
	Result   []LoadBalancer                             `json:"result,required,nullable"`
	// Whether the API call was successful
	Success    LoadBalancerListResponseEnvelopeSuccess    `json:"success,required"`
	ResultInfo LoadBalancerListResponseEnvelopeResultInfo `json:"result_info"`
	JSON       loadBalancerListResponseEnvelopeJSON       `json:"-"`
}

func (*LoadBalancerListResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerListResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerListResponseEnvelopeErrors

type LoadBalancerListResponseEnvelopeErrors struct {
	Code    int64                                      `json:"code,required"`
	Message string                                     `json:"message,required"`
	JSON    loadBalancerListResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerListResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerListResponseEnvelopeMessages

type LoadBalancerListResponseEnvelopeMessages struct {
	Code    int64                                        `json:"code,required"`
	Message string                                       `json:"message,required"`
	JSON    loadBalancerListResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerListResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerListResponseEnvelopeResultInfo

type LoadBalancerListResponseEnvelopeResultInfo struct {
	// Total number of results for the requested service
	Count float64 `json:"count"`
	// Current page within paginated list of results
	Page float64 `json:"page"`
	// Number of results per page of results
	PerPage float64 `json:"per_page"`
	// Total results available without any search parameters
	TotalCount float64                                        `json:"total_count"`
	JSON       loadBalancerListResponseEnvelopeResultInfoJSON `json:"-"`
}

func (*LoadBalancerListResponseEnvelopeResultInfo) UnmarshalJSON

func (r *LoadBalancerListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)

type LoadBalancerListResponseEnvelopeSuccess

type LoadBalancerListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerListResponseEnvelopeSuccessTrue LoadBalancerListResponseEnvelopeSuccess = true
)

type LoadBalancerLocationStrategy

type LoadBalancerLocationStrategy struct {
	// Determines the authoritative location when ECS is not preferred, does not exist
	// in the request, or its GeoIP lookup is unsuccessful.
	//
	//   - `"pop"`: Use the Cloudflare PoP location.
	//   - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
	//     unsuccessful, use the Cloudflare PoP location.
	Mode LoadBalancerLocationStrategyMode `json:"mode"`
	// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
	// authoritative location.
	//
	// - `"always"`: Always prefer ECS.
	// - `"never"`: Never prefer ECS.
	// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
	// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
	PreferEcs LoadBalancerLocationStrategyPreferEcs `json:"prefer_ecs"`
	JSON      loadBalancerLocationStrategyJSON      `json:"-"`
}

Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected.

func (*LoadBalancerLocationStrategy) UnmarshalJSON

func (r *LoadBalancerLocationStrategy) UnmarshalJSON(data []byte) (err error)

type LoadBalancerLocationStrategyMode

type LoadBalancerLocationStrategyMode string

Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.

  • `"pop"`: Use the Cloudflare PoP location.
  • `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.
const (
	LoadBalancerLocationStrategyModePop        LoadBalancerLocationStrategyMode = "pop"
	LoadBalancerLocationStrategyModeResolverIP LoadBalancerLocationStrategyMode = "resolver_ip"
)

type LoadBalancerLocationStrategyPreferEcs

type LoadBalancerLocationStrategyPreferEcs string

Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.

- `"always"`: Always prefer ECS. - `"never"`: Never prefer ECS. - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`. - `"geo"`: Prefer ECS only when `steering_policy="geo"`.

const (
	LoadBalancerLocationStrategyPreferEcsAlways    LoadBalancerLocationStrategyPreferEcs = "always"
	LoadBalancerLocationStrategyPreferEcsNever     LoadBalancerLocationStrategyPreferEcs = "never"
	LoadBalancerLocationStrategyPreferEcsProximity LoadBalancerLocationStrategyPreferEcs = "proximity"
	LoadBalancerLocationStrategyPreferEcsGeo       LoadBalancerLocationStrategyPreferEcs = "geo"
)

type LoadBalancerNewParams

type LoadBalancerNewParams struct {
	ZoneID param.Field[string] `path:"zone_id,required"`
	// A list of pool IDs ordered by their failover priority. Pools defined here are
	// used by default, or when region_pools are not configured for a given region.
	DefaultPools param.Field[[]string] `json:"default_pools,required"`
	// The pool ID to use when all other pools are detected as unhealthy.
	FallbackPool param.Field[interface{}] `json:"fallback_pool,required"`
	// The DNS hostname to associate with your Load Balancer. If this hostname already
	// exists as a DNS record in Cloudflare's DNS, the Load Balancer will take
	// precedence and the DNS record will not be used.
	Name param.Field[string] `json:"name,required"`
	// Controls features that modify the routing of requests to pools and origins in
	// response to dynamic conditions, such as during the interval between active
	// health monitoring requests. For example, zero-downtime failover occurs
	// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
	// response codes. If there is another healthy origin in the same pool, the request
	// is retried once against this alternate origin.
	AdaptiveRouting param.Field[LoadBalancerNewParamsAdaptiveRouting] `json:"adaptive_routing"`
	// A mapping of country codes to a list of pool IDs (ordered by their failover
	// priority) for the given country. Any country not explicitly defined will fall
	// back to using the corresponding region_pool mapping if it exists else to
	// default_pools.
	CountryPools param.Field[interface{}] `json:"country_pools"`
	// Object description.
	Description param.Field[string] `json:"description"`
	// Controls location-based steering for non-proxied requests. See `steering_policy`
	// to learn how steering is affected.
	LocationStrategy param.Field[LoadBalancerNewParamsLocationStrategy] `json:"location_strategy"`
	// (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
	// (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
	// explicitly defined will fall back to using the corresponding country_pool, then
	// region_pool mapping if it exists else to default_pools.
	PopPools param.Field[interface{}] `json:"pop_pools"`
	// Whether the hostname should be gray clouded (false) or orange clouded (true).
	Proxied param.Field[bool] `json:"proxied"`
	// Configures pool weights.
	//
	//   - `steering_policy="random"`: A random pool is selected with probability
	//     proportional to pool weights.
	//   - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
	//     pool's outstanding requests.
	//   - `steering_policy="least_connections"`: Use pool weights to scale each pool's
	//     open connections.
	RandomSteering param.Field[LoadBalancerNewParamsRandomSteering] `json:"random_steering"`
	// A mapping of region codes to a list of pool IDs (ordered by their failover
	// priority) for the given region. Any regions not explicitly defined will fall
	// back to using default_pools.
	RegionPools param.Field[interface{}] `json:"region_pools"`
	// BETA Field Not General Access: A list of rules for this load balancer to
	// execute.
	Rules param.Field[[]LoadBalancerNewParamsRule] `json:"rules"`
	// Specifies the type of session affinity the load balancer should use unless
	// specified as `"none"` or "" (default). The supported types are:
	//
	//   - `"cookie"`: 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.
	//   - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
	//     selection is stable and based on the client's ip address.
	//   - `"header"`: On the first request to a proxied load balancer, a session key
	//     based on the configured HTTP headers (see
	//     `session_affinity_attributes.headers`) 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 `session_affinity_ttl` seconds or the origin
	//     server is unhealthy, then a new origin server is calculated and used. See
	//     `headers` in `session_affinity_attributes` for additional required
	//     configuration.
	SessionAffinity param.Field[LoadBalancerNewParamsSessionAffinity] `json:"session_affinity"`
	// Configures attributes for session affinity.
	SessionAffinityAttributes param.Field[LoadBalancerNewParamsSessionAffinityAttributes] `json:"session_affinity_attributes"`
	// 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 `session_affinity` policy are:
	//
	//   - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
	//     unless explicitly set. The accepted range of values is between [1800, 604800].
	//   - `"header"`: 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.
	SessionAffinityTTL param.Field[float64] `json:"session_affinity_ttl"`
	// Steering Policy for this load balancer.
	//
	//   - `"off"`: Use `default_pools`.
	//   - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
	//     requests, the country for `country_pools` is determined by
	//     `location_strategy`.
	//   - `"random"`: Select a pool randomly.
	//   - `"dynamic_latency"`: Use round trip time to select the closest pool in
	//     default_pools (requires pool health checks).
	//   - `"proximity"`: Use the pools' latitude and longitude to select the closest
	//     pool using the Cloudflare PoP location for proxied requests or the location
	//     determined by `location_strategy` for non-proxied requests.
	//   - `"least_outstanding_requests"`: Select a pool by taking into consideration
	//     `random_steering` weights, as well as each pool's number of outstanding
	//     requests. Pools with more pending requests are weighted proportionately less
	//     relative to others.
	//   - `"least_connections"`: Select a pool by taking into consideration
	//     `random_steering` 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.
	//   - `""`: Will map to `"geo"` if you use
	//     `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
	SteeringPolicy param.Field[LoadBalancerNewParamsSteeringPolicy] `json:"steering_policy"`
	// Time to live (TTL) of the DNS entry for the IP address returned by this load
	// balancer. This only applies to gray-clouded (unproxied) load balancers.
	TTL param.Field[float64] `json:"ttl"`
}

func (LoadBalancerNewParams) MarshalJSON

func (r LoadBalancerNewParams) MarshalJSON() (data []byte, err error)

type LoadBalancerNewParamsAdaptiveRouting

type LoadBalancerNewParamsAdaptiveRouting struct {
	// Extends zero-downtime failover of requests to healthy origins from alternate
	// pools, when no healthy alternate exists in the same pool, according to the
	// failover order defined by traffic and origin steering. When set false (the
	// default) zero-downtime failover will only occur between origins within the same
	// pool. See `session_affinity_attributes` for control over when sessions are
	// broken or reassigned.
	FailoverAcrossPools param.Field[bool] `json:"failover_across_pools"`
}

Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin.

func (LoadBalancerNewParamsAdaptiveRouting) MarshalJSON

func (r LoadBalancerNewParamsAdaptiveRouting) MarshalJSON() (data []byte, err error)

type LoadBalancerNewParamsLocationStrategy

type LoadBalancerNewParamsLocationStrategy struct {
	// Determines the authoritative location when ECS is not preferred, does not exist
	// in the request, or its GeoIP lookup is unsuccessful.
	//
	//   - `"pop"`: Use the Cloudflare PoP location.
	//   - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
	//     unsuccessful, use the Cloudflare PoP location.
	Mode param.Field[LoadBalancerNewParamsLocationStrategyMode] `json:"mode"`
	// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
	// authoritative location.
	//
	// - `"always"`: Always prefer ECS.
	// - `"never"`: Never prefer ECS.
	// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
	// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
	PreferEcs param.Field[LoadBalancerNewParamsLocationStrategyPreferEcs] `json:"prefer_ecs"`
}

Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected.

func (LoadBalancerNewParamsLocationStrategy) MarshalJSON

func (r LoadBalancerNewParamsLocationStrategy) MarshalJSON() (data []byte, err error)

type LoadBalancerNewParamsLocationStrategyMode

type LoadBalancerNewParamsLocationStrategyMode string

Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.

  • `"pop"`: Use the Cloudflare PoP location.
  • `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.
const (
	LoadBalancerNewParamsLocationStrategyModePop        LoadBalancerNewParamsLocationStrategyMode = "pop"
	LoadBalancerNewParamsLocationStrategyModeResolverIP LoadBalancerNewParamsLocationStrategyMode = "resolver_ip"
)

type LoadBalancerNewParamsLocationStrategyPreferEcs

type LoadBalancerNewParamsLocationStrategyPreferEcs string

Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.

- `"always"`: Always prefer ECS. - `"never"`: Never prefer ECS. - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`. - `"geo"`: Prefer ECS only when `steering_policy="geo"`.

const (
	LoadBalancerNewParamsLocationStrategyPreferEcsAlways    LoadBalancerNewParamsLocationStrategyPreferEcs = "always"
	LoadBalancerNewParamsLocationStrategyPreferEcsNever     LoadBalancerNewParamsLocationStrategyPreferEcs = "never"
	LoadBalancerNewParamsLocationStrategyPreferEcsProximity LoadBalancerNewParamsLocationStrategyPreferEcs = "proximity"
	LoadBalancerNewParamsLocationStrategyPreferEcsGeo       LoadBalancerNewParamsLocationStrategyPreferEcs = "geo"
)

type LoadBalancerNewParamsRandomSteering

type LoadBalancerNewParamsRandomSteering struct {
	// The default weight for pools in the load balancer that are not specified in the
	// pool_weights map.
	DefaultWeight param.Field[float64] `json:"default_weight"`
	// A mapping of pool IDs to custom weights. The weight is relative to other pools
	// in the load balancer.
	PoolWeights param.Field[interface{}] `json:"pool_weights"`
}

Configures pool weights.

  • `steering_policy="random"`: A random pool is selected with probability proportional to pool weights.
  • `steering_policy="least_outstanding_requests"`: Use pool weights to scale each pool's outstanding requests.
  • `steering_policy="least_connections"`: Use pool weights to scale each pool's open connections.

func (LoadBalancerNewParamsRandomSteering) MarshalJSON

func (r LoadBalancerNewParamsRandomSteering) MarshalJSON() (data []byte, err error)

type LoadBalancerNewParamsRule

type LoadBalancerNewParamsRule struct {
	// The condition expressions to evaluate. If the condition evaluates to true, the
	// overrides or fixed_response in this rule will be applied. An empty condition is
	// always true. For more details on condition expressions, please see
	// https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions.
	Condition param.Field[string] `json:"condition"`
	// Disable this specific rule. It will no longer be evaluated by this load
	// balancer.
	Disabled param.Field[bool] `json:"disabled"`
	// A collection of fields used to directly respond to the eyeball instead of
	// routing to a pool. If a fixed_response is supplied the rule will be marked as
	// terminates.
	FixedResponse param.Field[LoadBalancerNewParamsRulesFixedResponse] `json:"fixed_response"`
	// Name of this rule. Only used for human readability.
	Name param.Field[string] `json:"name"`
	// A collection of overrides to apply to the load balancer when this rule's
	// condition is true. All fields are optional.
	Overrides param.Field[LoadBalancerNewParamsRulesOverrides] `json:"overrides"`
	// 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.
	Priority param.Field[int64] `json:"priority"`
	// If this rule's condition is true, this causes rule evaluation to stop after
	// processing this rule.
	Terminates param.Field[bool] `json:"terminates"`
}

A rule object containing conditions and overrides for this load balancer to evaluate.

func (LoadBalancerNewParamsRule) MarshalJSON

func (r LoadBalancerNewParamsRule) MarshalJSON() (data []byte, err error)

type LoadBalancerNewParamsRulesFixedResponse

type LoadBalancerNewParamsRulesFixedResponse struct {
	// The http 'Content-Type' header to include in the response.
	ContentType param.Field[string] `json:"content_type"`
	// The http 'Location' header to include in the response.
	Location param.Field[string] `json:"location"`
	// Text to include as the http body.
	MessageBody param.Field[string] `json:"message_body"`
	// The http status code to respond with.
	StatusCode param.Field[int64] `json:"status_code"`
}

A collection of fields used to directly respond to the eyeball instead of routing to a pool. If a fixed_response is supplied the rule will be marked as terminates.

func (LoadBalancerNewParamsRulesFixedResponse) MarshalJSON

func (r LoadBalancerNewParamsRulesFixedResponse) MarshalJSON() (data []byte, err error)

type LoadBalancerNewParamsRulesOverrides

type LoadBalancerNewParamsRulesOverrides struct {
	// Controls features that modify the routing of requests to pools and origins in
	// response to dynamic conditions, such as during the interval between active
	// health monitoring requests. For example, zero-downtime failover occurs
	// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
	// response codes. If there is another healthy origin in the same pool, the request
	// is retried once against this alternate origin.
	AdaptiveRouting param.Field[LoadBalancerNewParamsRulesOverridesAdaptiveRouting] `json:"adaptive_routing"`
	// A mapping of country codes to a list of pool IDs (ordered by their failover
	// priority) for the given country. Any country not explicitly defined will fall
	// back to using the corresponding region_pool mapping if it exists else to
	// default_pools.
	CountryPools param.Field[interface{}] `json:"country_pools"`
	// A list of pool IDs ordered by their failover priority. Pools defined here are
	// used by default, or when region_pools are not configured for a given region.
	DefaultPools param.Field[[]string] `json:"default_pools"`
	// The pool ID to use when all other pools are detected as unhealthy.
	FallbackPool param.Field[interface{}] `json:"fallback_pool"`
	// Controls location-based steering for non-proxied requests. See `steering_policy`
	// to learn how steering is affected.
	LocationStrategy param.Field[LoadBalancerNewParamsRulesOverridesLocationStrategy] `json:"location_strategy"`
	// (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
	// (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
	// explicitly defined will fall back to using the corresponding country_pool, then
	// region_pool mapping if it exists else to default_pools.
	PopPools param.Field[interface{}] `json:"pop_pools"`
	// Configures pool weights.
	//
	//   - `steering_policy="random"`: A random pool is selected with probability
	//     proportional to pool weights.
	//   - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
	//     pool's outstanding requests.
	//   - `steering_policy="least_connections"`: Use pool weights to scale each pool's
	//     open connections.
	RandomSteering param.Field[LoadBalancerNewParamsRulesOverridesRandomSteering] `json:"random_steering"`
	// A mapping of region codes to a list of pool IDs (ordered by their failover
	// priority) for the given region. Any regions not explicitly defined will fall
	// back to using default_pools.
	RegionPools param.Field[interface{}] `json:"region_pools"`
	// Specifies the type of session affinity the load balancer should use unless
	// specified as `"none"` or "" (default). The supported types are:
	//
	//   - `"cookie"`: 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.
	//   - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
	//     selection is stable and based on the client's ip address.
	//   - `"header"`: On the first request to a proxied load balancer, a session key
	//     based on the configured HTTP headers (see
	//     `session_affinity_attributes.headers`) 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 `session_affinity_ttl` seconds or the origin
	//     server is unhealthy, then a new origin server is calculated and used. See
	//     `headers` in `session_affinity_attributes` for additional required
	//     configuration.
	SessionAffinity param.Field[LoadBalancerNewParamsRulesOverridesSessionAffinity] `json:"session_affinity"`
	// Configures attributes for session affinity.
	SessionAffinityAttributes param.Field[LoadBalancerNewParamsRulesOverridesSessionAffinityAttributes] `json:"session_affinity_attributes"`
	// 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 `session_affinity` policy are:
	//
	//   - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
	//     unless explicitly set. The accepted range of values is between [1800, 604800].
	//   - `"header"`: 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.
	SessionAffinityTTL param.Field[float64] `json:"session_affinity_ttl"`
	// Steering Policy for this load balancer.
	//
	//   - `"off"`: Use `default_pools`.
	//   - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
	//     requests, the country for `country_pools` is determined by
	//     `location_strategy`.
	//   - `"random"`: Select a pool randomly.
	//   - `"dynamic_latency"`: Use round trip time to select the closest pool in
	//     default_pools (requires pool health checks).
	//   - `"proximity"`: Use the pools' latitude and longitude to select the closest
	//     pool using the Cloudflare PoP location for proxied requests or the location
	//     determined by `location_strategy` for non-proxied requests.
	//   - `"least_outstanding_requests"`: Select a pool by taking into consideration
	//     `random_steering` weights, as well as each pool's number of outstanding
	//     requests. Pools with more pending requests are weighted proportionately less
	//     relative to others.
	//   - `"least_connections"`: Select a pool by taking into consideration
	//     `random_steering` 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.
	//   - `""`: Will map to `"geo"` if you use
	//     `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
	SteeringPolicy param.Field[LoadBalancerNewParamsRulesOverridesSteeringPolicy] `json:"steering_policy"`
	// Time to live (TTL) of the DNS entry for the IP address returned by this load
	// balancer. This only applies to gray-clouded (unproxied) load balancers.
	TTL param.Field[float64] `json:"ttl"`
}

A collection of overrides to apply to the load balancer when this rule's condition is true. All fields are optional.

func (LoadBalancerNewParamsRulesOverrides) MarshalJSON

func (r LoadBalancerNewParamsRulesOverrides) MarshalJSON() (data []byte, err error)

type LoadBalancerNewParamsRulesOverridesAdaptiveRouting

type LoadBalancerNewParamsRulesOverridesAdaptiveRouting struct {
	// Extends zero-downtime failover of requests to healthy origins from alternate
	// pools, when no healthy alternate exists in the same pool, according to the
	// failover order defined by traffic and origin steering. When set false (the
	// default) zero-downtime failover will only occur between origins within the same
	// pool. See `session_affinity_attributes` for control over when sessions are
	// broken or reassigned.
	FailoverAcrossPools param.Field[bool] `json:"failover_across_pools"`
}

Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin.

func (LoadBalancerNewParamsRulesOverridesAdaptiveRouting) MarshalJSON

func (r LoadBalancerNewParamsRulesOverridesAdaptiveRouting) MarshalJSON() (data []byte, err error)

type LoadBalancerNewParamsRulesOverridesLocationStrategy

type LoadBalancerNewParamsRulesOverridesLocationStrategy struct {
	// Determines the authoritative location when ECS is not preferred, does not exist
	// in the request, or its GeoIP lookup is unsuccessful.
	//
	//   - `"pop"`: Use the Cloudflare PoP location.
	//   - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
	//     unsuccessful, use the Cloudflare PoP location.
	Mode param.Field[LoadBalancerNewParamsRulesOverridesLocationStrategyMode] `json:"mode"`
	// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
	// authoritative location.
	//
	// - `"always"`: Always prefer ECS.
	// - `"never"`: Never prefer ECS.
	// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
	// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
	PreferEcs param.Field[LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcs] `json:"prefer_ecs"`
}

Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected.

func (LoadBalancerNewParamsRulesOverridesLocationStrategy) MarshalJSON

func (r LoadBalancerNewParamsRulesOverridesLocationStrategy) MarshalJSON() (data []byte, err error)

type LoadBalancerNewParamsRulesOverridesLocationStrategyMode

type LoadBalancerNewParamsRulesOverridesLocationStrategyMode string

Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.

  • `"pop"`: Use the Cloudflare PoP location.
  • `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.
const (
	LoadBalancerNewParamsRulesOverridesLocationStrategyModePop        LoadBalancerNewParamsRulesOverridesLocationStrategyMode = "pop"
	LoadBalancerNewParamsRulesOverridesLocationStrategyModeResolverIP LoadBalancerNewParamsRulesOverridesLocationStrategyMode = "resolver_ip"
)

type LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcs

type LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcs string

Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.

- `"always"`: Always prefer ECS. - `"never"`: Never prefer ECS. - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`. - `"geo"`: Prefer ECS only when `steering_policy="geo"`.

const (
	LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcsAlways    LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcs = "always"
	LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcsNever     LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcs = "never"
	LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcsProximity LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcs = "proximity"
	LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcsGeo       LoadBalancerNewParamsRulesOverridesLocationStrategyPreferEcs = "geo"
)

type LoadBalancerNewParamsRulesOverridesRandomSteering

type LoadBalancerNewParamsRulesOverridesRandomSteering struct {
	// The default weight for pools in the load balancer that are not specified in the
	// pool_weights map.
	DefaultWeight param.Field[float64] `json:"default_weight"`
	// A mapping of pool IDs to custom weights. The weight is relative to other pools
	// in the load balancer.
	PoolWeights param.Field[interface{}] `json:"pool_weights"`
}

Configures pool weights.

  • `steering_policy="random"`: A random pool is selected with probability proportional to pool weights.
  • `steering_policy="least_outstanding_requests"`: Use pool weights to scale each pool's outstanding requests.
  • `steering_policy="least_connections"`: Use pool weights to scale each pool's open connections.

func (LoadBalancerNewParamsRulesOverridesRandomSteering) MarshalJSON

func (r LoadBalancerNewParamsRulesOverridesRandomSteering) MarshalJSON() (data []byte, err error)

type LoadBalancerNewParamsRulesOverridesSessionAffinity

type LoadBalancerNewParamsRulesOverridesSessionAffinity string

Specifies the type of session affinity the load balancer should use unless specified as `"none"` or "" (default). The supported types are:

  • `"cookie"`: 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.
  • `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client's ip address.
  • `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) 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 `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.
const (
	LoadBalancerNewParamsRulesOverridesSessionAffinityNone     LoadBalancerNewParamsRulesOverridesSessionAffinity = "none"
	LoadBalancerNewParamsRulesOverridesSessionAffinityCookie   LoadBalancerNewParamsRulesOverridesSessionAffinity = "cookie"
	LoadBalancerNewParamsRulesOverridesSessionAffinityIPCookie LoadBalancerNewParamsRulesOverridesSessionAffinity = "ip_cookie"
	LoadBalancerNewParamsRulesOverridesSessionAffinityHeader   LoadBalancerNewParamsRulesOverridesSessionAffinity = "header"
	LoadBalancerNewParamsRulesOverridesSessionAffinityEmpty    LoadBalancerNewParamsRulesOverridesSessionAffinity = "\"\""
)

type LoadBalancerNewParamsRulesOverridesSessionAffinityAttributes

type LoadBalancerNewParamsRulesOverridesSessionAffinityAttributes struct {
	// Configures the drain duration in seconds. This field is only used when session
	// affinity is enabled on the load balancer.
	DrainDuration param.Field[float64] `json:"drain_duration"`
	// Configures the names of HTTP headers to base session affinity on when header
	// `session_affinity` 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: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything
	// after the colon is a comma-separated list of cookie names. Providing only
	// `"cookie"` 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.
	Headers param.Field[[]string] `json:"headers"`
	// When header `session_affinity` is enabled, this option can be used to specify
	// how HTTP headers on load balancing requests will be used. The supported values
	// are:
	//
	//   - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
	//     specified by the `headers` session affinity attribute, otherwise sessions
	//     aren't created.
	//   - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
	//     headers specified by the `headers` session affinity attribute, otherwise
	//     sessions aren't created.
	RequireAllHeaders param.Field[bool] `json:"require_all_headers"`
	// 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".
	Samesite param.Field[LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesite] `json:"samesite"`
	// 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.
	Secure param.Field[LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecure] `json:"secure"`
	// 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:
	//
	//   - `"none"`: No failover takes place for sessions pinned to the origin (default).
	//   - `"temporary"`: 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.
	//   - `"sticky"`: 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.
	ZeroDowntimeFailover param.Field[LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover] `json:"zero_downtime_failover"`
}

Configures attributes for session affinity.

func (LoadBalancerNewParamsRulesOverridesSessionAffinityAttributes) MarshalJSON

type LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesite

type LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesite string

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".

const (
	LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesiteAuto   LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesite = "Auto"
	LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesiteLax    LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesite = "Lax"
	LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesiteNone   LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesite = "None"
	LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesiteStrict LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSamesite = "Strict"
)

type LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecure

type LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecure string

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.

const (
	LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecureAuto   LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecure = "Auto"
	LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecureAlways LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecure = "Always"
	LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecureNever  LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesSecure = "Never"
)

type LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover

type LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover string

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:

  • `"none"`: No failover takes place for sessions pinned to the origin (default).
  • `"temporary"`: 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.
  • `"sticky"`: 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.
const (
	LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverNone      LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "none"
	LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "temporary"
	LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky    LoadBalancerNewParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "sticky"
)

type LoadBalancerNewParamsRulesOverridesSteeringPolicy

type LoadBalancerNewParamsRulesOverridesSteeringPolicy string

Steering Policy for this load balancer.

  • `"off"`: Use `default_pools`.
  • `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.
  • `"random"`: Select a pool randomly.
  • `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).
  • `"proximity"`: Use the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.
  • `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.
  • `"least_connections"`: Select a pool by taking into consideration `random_steering` 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.
  • `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
const (
	LoadBalancerNewParamsRulesOverridesSteeringPolicyOff                      LoadBalancerNewParamsRulesOverridesSteeringPolicy = "off"
	LoadBalancerNewParamsRulesOverridesSteeringPolicyGeo                      LoadBalancerNewParamsRulesOverridesSteeringPolicy = "geo"
	LoadBalancerNewParamsRulesOverridesSteeringPolicyRandom                   LoadBalancerNewParamsRulesOverridesSteeringPolicy = "random"
	LoadBalancerNewParamsRulesOverridesSteeringPolicyDynamicLatency           LoadBalancerNewParamsRulesOverridesSteeringPolicy = "dynamic_latency"
	LoadBalancerNewParamsRulesOverridesSteeringPolicyProximity                LoadBalancerNewParamsRulesOverridesSteeringPolicy = "proximity"
	LoadBalancerNewParamsRulesOverridesSteeringPolicyLeastOutstandingRequests LoadBalancerNewParamsRulesOverridesSteeringPolicy = "least_outstanding_requests"
	LoadBalancerNewParamsRulesOverridesSteeringPolicyLeastConnections         LoadBalancerNewParamsRulesOverridesSteeringPolicy = "least_connections"
	LoadBalancerNewParamsRulesOverridesSteeringPolicyEmpty                    LoadBalancerNewParamsRulesOverridesSteeringPolicy = "\"\""
)

type LoadBalancerNewParamsSessionAffinity

type LoadBalancerNewParamsSessionAffinity string

Specifies the type of session affinity the load balancer should use unless specified as `"none"` or "" (default). The supported types are:

  • `"cookie"`: 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.
  • `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client's ip address.
  • `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) 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 `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.
const (
	LoadBalancerNewParamsSessionAffinityNone     LoadBalancerNewParamsSessionAffinity = "none"
	LoadBalancerNewParamsSessionAffinityCookie   LoadBalancerNewParamsSessionAffinity = "cookie"
	LoadBalancerNewParamsSessionAffinityIPCookie LoadBalancerNewParamsSessionAffinity = "ip_cookie"
	LoadBalancerNewParamsSessionAffinityHeader   LoadBalancerNewParamsSessionAffinity = "header"
	LoadBalancerNewParamsSessionAffinityEmpty    LoadBalancerNewParamsSessionAffinity = "\"\""
)

type LoadBalancerNewParamsSessionAffinityAttributes

type LoadBalancerNewParamsSessionAffinityAttributes struct {
	// Configures the drain duration in seconds. This field is only used when session
	// affinity is enabled on the load balancer.
	DrainDuration param.Field[float64] `json:"drain_duration"`
	// Configures the names of HTTP headers to base session affinity on when header
	// `session_affinity` 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: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything
	// after the colon is a comma-separated list of cookie names. Providing only
	// `"cookie"` 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.
	Headers param.Field[[]string] `json:"headers"`
	// When header `session_affinity` is enabled, this option can be used to specify
	// how HTTP headers on load balancing requests will be used. The supported values
	// are:
	//
	//   - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
	//     specified by the `headers` session affinity attribute, otherwise sessions
	//     aren't created.
	//   - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
	//     headers specified by the `headers` session affinity attribute, otherwise
	//     sessions aren't created.
	RequireAllHeaders param.Field[bool] `json:"require_all_headers"`
	// 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".
	Samesite param.Field[LoadBalancerNewParamsSessionAffinityAttributesSamesite] `json:"samesite"`
	// 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.
	Secure param.Field[LoadBalancerNewParamsSessionAffinityAttributesSecure] `json:"secure"`
	// 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:
	//
	//   - `"none"`: No failover takes place for sessions pinned to the origin (default).
	//   - `"temporary"`: 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.
	//   - `"sticky"`: 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.
	ZeroDowntimeFailover param.Field[LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailover] `json:"zero_downtime_failover"`
}

Configures attributes for session affinity.

func (LoadBalancerNewParamsSessionAffinityAttributes) MarshalJSON

func (r LoadBalancerNewParamsSessionAffinityAttributes) MarshalJSON() (data []byte, err error)

type LoadBalancerNewParamsSessionAffinityAttributesSamesite

type LoadBalancerNewParamsSessionAffinityAttributesSamesite string

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".

const (
	LoadBalancerNewParamsSessionAffinityAttributesSamesiteAuto   LoadBalancerNewParamsSessionAffinityAttributesSamesite = "Auto"
	LoadBalancerNewParamsSessionAffinityAttributesSamesiteLax    LoadBalancerNewParamsSessionAffinityAttributesSamesite = "Lax"
	LoadBalancerNewParamsSessionAffinityAttributesSamesiteNone   LoadBalancerNewParamsSessionAffinityAttributesSamesite = "None"
	LoadBalancerNewParamsSessionAffinityAttributesSamesiteStrict LoadBalancerNewParamsSessionAffinityAttributesSamesite = "Strict"
)

type LoadBalancerNewParamsSessionAffinityAttributesSecure

type LoadBalancerNewParamsSessionAffinityAttributesSecure string

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.

const (
	LoadBalancerNewParamsSessionAffinityAttributesSecureAuto   LoadBalancerNewParamsSessionAffinityAttributesSecure = "Auto"
	LoadBalancerNewParamsSessionAffinityAttributesSecureAlways LoadBalancerNewParamsSessionAffinityAttributesSecure = "Always"
	LoadBalancerNewParamsSessionAffinityAttributesSecureNever  LoadBalancerNewParamsSessionAffinityAttributesSecure = "Never"
)

type LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailover

type LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailover string

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:

  • `"none"`: No failover takes place for sessions pinned to the origin (default).
  • `"temporary"`: 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.
  • `"sticky"`: 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.
const (
	LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailoverNone      LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailover = "none"
	LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailover = "temporary"
	LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailoverSticky    LoadBalancerNewParamsSessionAffinityAttributesZeroDowntimeFailover = "sticky"
)

type LoadBalancerNewParamsSteeringPolicy

type LoadBalancerNewParamsSteeringPolicy string

Steering Policy for this load balancer.

  • `"off"`: Use `default_pools`.
  • `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.
  • `"random"`: Select a pool randomly.
  • `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).
  • `"proximity"`: Use the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.
  • `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.
  • `"least_connections"`: Select a pool by taking into consideration `random_steering` 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.
  • `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
const (
	LoadBalancerNewParamsSteeringPolicyOff                      LoadBalancerNewParamsSteeringPolicy = "off"
	LoadBalancerNewParamsSteeringPolicyGeo                      LoadBalancerNewParamsSteeringPolicy = "geo"
	LoadBalancerNewParamsSteeringPolicyRandom                   LoadBalancerNewParamsSteeringPolicy = "random"
	LoadBalancerNewParamsSteeringPolicyDynamicLatency           LoadBalancerNewParamsSteeringPolicy = "dynamic_latency"
	LoadBalancerNewParamsSteeringPolicyProximity                LoadBalancerNewParamsSteeringPolicy = "proximity"
	LoadBalancerNewParamsSteeringPolicyLeastOutstandingRequests LoadBalancerNewParamsSteeringPolicy = "least_outstanding_requests"
	LoadBalancerNewParamsSteeringPolicyLeastConnections         LoadBalancerNewParamsSteeringPolicy = "least_connections"
	LoadBalancerNewParamsSteeringPolicyEmpty                    LoadBalancerNewParamsSteeringPolicy = "\"\""
)

type LoadBalancerNewResponseEnvelope

type LoadBalancerNewResponseEnvelope struct {
	Errors   []LoadBalancerNewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerNewResponseEnvelopeMessages `json:"messages,required"`
	Result   LoadBalancer                              `json:"result,required"`
	// Whether the API call was successful
	Success LoadBalancerNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    loadBalancerNewResponseEnvelopeJSON    `json:"-"`
}

func (*LoadBalancerNewResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerNewResponseEnvelopeErrors

type LoadBalancerNewResponseEnvelopeErrors struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    loadBalancerNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerNewResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerNewResponseEnvelopeMessages

type LoadBalancerNewResponseEnvelopeMessages struct {
	Code    int64                                       `json:"code,required"`
	Message string                                      `json:"message,required"`
	JSON    loadBalancerNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerNewResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerNewResponseEnvelopeSuccess

type LoadBalancerNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerNewResponseEnvelopeSuccessTrue LoadBalancerNewResponseEnvelopeSuccess = true
)

type LoadBalancerRandomSteering

type LoadBalancerRandomSteering struct {
	// The default weight for pools in the load balancer that are not specified in the
	// pool_weights map.
	DefaultWeight float64 `json:"default_weight"`
	// A mapping of pool IDs to custom weights. The weight is relative to other pools
	// in the load balancer.
	PoolWeights interface{}                    `json:"pool_weights"`
	JSON        loadBalancerRandomSteeringJSON `json:"-"`
}

Configures pool weights.

  • `steering_policy="random"`: A random pool is selected with probability proportional to pool weights.
  • `steering_policy="least_outstanding_requests"`: Use pool weights to scale each pool's outstanding requests.
  • `steering_policy="least_connections"`: Use pool weights to scale each pool's open connections.

func (*LoadBalancerRandomSteering) UnmarshalJSON

func (r *LoadBalancerRandomSteering) UnmarshalJSON(data []byte) (err error)

type LoadBalancerRule

type LoadBalancerRule struct {
	// The condition expressions to evaluate. If the condition evaluates to true, the
	// overrides or fixed_response in this rule will be applied. An empty condition is
	// always true. For more details on condition expressions, please see
	// https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions.
	Condition string `json:"condition"`
	// Disable this specific rule. It will no longer be evaluated by this load
	// balancer.
	Disabled bool `json:"disabled"`
	// A collection of fields used to directly respond to the eyeball instead of
	// routing to a pool. If a fixed_response is supplied the rule will be marked as
	// terminates.
	FixedResponse LoadBalancerRulesFixedResponse `json:"fixed_response"`
	// Name of this rule. Only used for human readability.
	Name string `json:"name"`
	// A collection of overrides to apply to the load balancer when this rule's
	// condition is true. All fields are optional.
	Overrides LoadBalancerRulesOverrides `json:"overrides"`
	// 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.
	Priority int64 `json:"priority"`
	// If this rule's condition is true, this causes rule evaluation to stop after
	// processing this rule.
	Terminates bool                 `json:"terminates"`
	JSON       loadBalancerRuleJSON `json:"-"`
}

A rule object containing conditions and overrides for this load balancer to evaluate.

func (*LoadBalancerRule) UnmarshalJSON

func (r *LoadBalancerRule) UnmarshalJSON(data []byte) (err error)

type LoadBalancerRulesFixedResponse

type LoadBalancerRulesFixedResponse struct {
	// The http 'Content-Type' header to include in the response.
	ContentType string `json:"content_type"`
	// The http 'Location' header to include in the response.
	Location string `json:"location"`
	// Text to include as the http body.
	MessageBody string `json:"message_body"`
	// The http status code to respond with.
	StatusCode int64                              `json:"status_code"`
	JSON       loadBalancerRulesFixedResponseJSON `json:"-"`
}

A collection of fields used to directly respond to the eyeball instead of routing to a pool. If a fixed_response is supplied the rule will be marked as terminates.

func (*LoadBalancerRulesFixedResponse) UnmarshalJSON

func (r *LoadBalancerRulesFixedResponse) UnmarshalJSON(data []byte) (err error)

type LoadBalancerRulesOverrides

type LoadBalancerRulesOverrides struct {
	// Controls features that modify the routing of requests to pools and origins in
	// response to dynamic conditions, such as during the interval between active
	// health monitoring requests. For example, zero-downtime failover occurs
	// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
	// response codes. If there is another healthy origin in the same pool, the request
	// is retried once against this alternate origin.
	AdaptiveRouting LoadBalancerRulesOverridesAdaptiveRouting `json:"adaptive_routing"`
	// A mapping of country codes to a list of pool IDs (ordered by their failover
	// priority) for the given country. Any country not explicitly defined will fall
	// back to using the corresponding region_pool mapping if it exists else to
	// default_pools.
	CountryPools interface{} `json:"country_pools"`
	// A list of pool IDs ordered by their failover priority. Pools defined here are
	// used by default, or when region_pools are not configured for a given region.
	DefaultPools []string `json:"default_pools"`
	// The pool ID to use when all other pools are detected as unhealthy.
	FallbackPool interface{} `json:"fallback_pool"`
	// Controls location-based steering for non-proxied requests. See `steering_policy`
	// to learn how steering is affected.
	LocationStrategy LoadBalancerRulesOverridesLocationStrategy `json:"location_strategy"`
	// (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
	// (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
	// explicitly defined will fall back to using the corresponding country_pool, then
	// region_pool mapping if it exists else to default_pools.
	PopPools interface{} `json:"pop_pools"`
	// Configures pool weights.
	//
	//   - `steering_policy="random"`: A random pool is selected with probability
	//     proportional to pool weights.
	//   - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
	//     pool's outstanding requests.
	//   - `steering_policy="least_connections"`: Use pool weights to scale each pool's
	//     open connections.
	RandomSteering LoadBalancerRulesOverridesRandomSteering `json:"random_steering"`
	// A mapping of region codes to a list of pool IDs (ordered by their failover
	// priority) for the given region. Any regions not explicitly defined will fall
	// back to using default_pools.
	RegionPools interface{} `json:"region_pools"`
	// Specifies the type of session affinity the load balancer should use unless
	// specified as `"none"` or "" (default). The supported types are:
	//
	//   - `"cookie"`: 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.
	//   - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
	//     selection is stable and based on the client's ip address.
	//   - `"header"`: On the first request to a proxied load balancer, a session key
	//     based on the configured HTTP headers (see
	//     `session_affinity_attributes.headers`) 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 `session_affinity_ttl` seconds or the origin
	//     server is unhealthy, then a new origin server is calculated and used. See
	//     `headers` in `session_affinity_attributes` for additional required
	//     configuration.
	SessionAffinity LoadBalancerRulesOverridesSessionAffinity `json:"session_affinity"`
	// Configures attributes for session affinity.
	SessionAffinityAttributes LoadBalancerRulesOverridesSessionAffinityAttributes `json:"session_affinity_attributes"`
	// 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 `session_affinity` policy are:
	//
	//   - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
	//     unless explicitly set. The accepted range of values is between [1800, 604800].
	//   - `"header"`: 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.
	SessionAffinityTTL float64 `json:"session_affinity_ttl"`
	// Steering Policy for this load balancer.
	//
	//   - `"off"`: Use `default_pools`.
	//   - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
	//     requests, the country for `country_pools` is determined by
	//     `location_strategy`.
	//   - `"random"`: Select a pool randomly.
	//   - `"dynamic_latency"`: Use round trip time to select the closest pool in
	//     default_pools (requires pool health checks).
	//   - `"proximity"`: Use the pools' latitude and longitude to select the closest
	//     pool using the Cloudflare PoP location for proxied requests or the location
	//     determined by `location_strategy` for non-proxied requests.
	//   - `"least_outstanding_requests"`: Select a pool by taking into consideration
	//     `random_steering` weights, as well as each pool's number of outstanding
	//     requests. Pools with more pending requests are weighted proportionately less
	//     relative to others.
	//   - `"least_connections"`: Select a pool by taking into consideration
	//     `random_steering` 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.
	//   - `""`: Will map to `"geo"` if you use
	//     `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
	SteeringPolicy LoadBalancerRulesOverridesSteeringPolicy `json:"steering_policy"`
	// Time to live (TTL) of the DNS entry for the IP address returned by this load
	// balancer. This only applies to gray-clouded (unproxied) load balancers.
	TTL  float64                        `json:"ttl"`
	JSON loadBalancerRulesOverridesJSON `json:"-"`
}

A collection of overrides to apply to the load balancer when this rule's condition is true. All fields are optional.

func (*LoadBalancerRulesOverrides) UnmarshalJSON

func (r *LoadBalancerRulesOverrides) UnmarshalJSON(data []byte) (err error)

type LoadBalancerRulesOverridesAdaptiveRouting

type LoadBalancerRulesOverridesAdaptiveRouting struct {
	// Extends zero-downtime failover of requests to healthy origins from alternate
	// pools, when no healthy alternate exists in the same pool, according to the
	// failover order defined by traffic and origin steering. When set false (the
	// default) zero-downtime failover will only occur between origins within the same
	// pool. See `session_affinity_attributes` for control over when sessions are
	// broken or reassigned.
	FailoverAcrossPools bool                                          `json:"failover_across_pools"`
	JSON                loadBalancerRulesOverridesAdaptiveRoutingJSON `json:"-"`
}

Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin.

func (*LoadBalancerRulesOverridesAdaptiveRouting) UnmarshalJSON

func (r *LoadBalancerRulesOverridesAdaptiveRouting) UnmarshalJSON(data []byte) (err error)

type LoadBalancerRulesOverridesLocationStrategy

type LoadBalancerRulesOverridesLocationStrategy struct {
	// Determines the authoritative location when ECS is not preferred, does not exist
	// in the request, or its GeoIP lookup is unsuccessful.
	//
	//   - `"pop"`: Use the Cloudflare PoP location.
	//   - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
	//     unsuccessful, use the Cloudflare PoP location.
	Mode LoadBalancerRulesOverridesLocationStrategyMode `json:"mode"`
	// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
	// authoritative location.
	//
	// - `"always"`: Always prefer ECS.
	// - `"never"`: Never prefer ECS.
	// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
	// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
	PreferEcs LoadBalancerRulesOverridesLocationStrategyPreferEcs `json:"prefer_ecs"`
	JSON      loadBalancerRulesOverridesLocationStrategyJSON      `json:"-"`
}

Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected.

func (*LoadBalancerRulesOverridesLocationStrategy) UnmarshalJSON

func (r *LoadBalancerRulesOverridesLocationStrategy) UnmarshalJSON(data []byte) (err error)

type LoadBalancerRulesOverridesLocationStrategyMode

type LoadBalancerRulesOverridesLocationStrategyMode string

Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.

  • `"pop"`: Use the Cloudflare PoP location.
  • `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.
const (
	LoadBalancerRulesOverridesLocationStrategyModePop        LoadBalancerRulesOverridesLocationStrategyMode = "pop"
	LoadBalancerRulesOverridesLocationStrategyModeResolverIP LoadBalancerRulesOverridesLocationStrategyMode = "resolver_ip"
)

type LoadBalancerRulesOverridesLocationStrategyPreferEcs

type LoadBalancerRulesOverridesLocationStrategyPreferEcs string

Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.

- `"always"`: Always prefer ECS. - `"never"`: Never prefer ECS. - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`. - `"geo"`: Prefer ECS only when `steering_policy="geo"`.

const (
	LoadBalancerRulesOverridesLocationStrategyPreferEcsAlways    LoadBalancerRulesOverridesLocationStrategyPreferEcs = "always"
	LoadBalancerRulesOverridesLocationStrategyPreferEcsNever     LoadBalancerRulesOverridesLocationStrategyPreferEcs = "never"
	LoadBalancerRulesOverridesLocationStrategyPreferEcsProximity LoadBalancerRulesOverridesLocationStrategyPreferEcs = "proximity"
	LoadBalancerRulesOverridesLocationStrategyPreferEcsGeo       LoadBalancerRulesOverridesLocationStrategyPreferEcs = "geo"
)

type LoadBalancerRulesOverridesRandomSteering

type LoadBalancerRulesOverridesRandomSteering struct {
	// The default weight for pools in the load balancer that are not specified in the
	// pool_weights map.
	DefaultWeight float64 `json:"default_weight"`
	// A mapping of pool IDs to custom weights. The weight is relative to other pools
	// in the load balancer.
	PoolWeights interface{}                                  `json:"pool_weights"`
	JSON        loadBalancerRulesOverridesRandomSteeringJSON `json:"-"`
}

Configures pool weights.

  • `steering_policy="random"`: A random pool is selected with probability proportional to pool weights.
  • `steering_policy="least_outstanding_requests"`: Use pool weights to scale each pool's outstanding requests.
  • `steering_policy="least_connections"`: Use pool weights to scale each pool's open connections.

func (*LoadBalancerRulesOverridesRandomSteering) UnmarshalJSON

func (r *LoadBalancerRulesOverridesRandomSteering) UnmarshalJSON(data []byte) (err error)

type LoadBalancerRulesOverridesSessionAffinity

type LoadBalancerRulesOverridesSessionAffinity string

Specifies the type of session affinity the load balancer should use unless specified as `"none"` or "" (default). The supported types are:

  • `"cookie"`: 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.
  • `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client's ip address.
  • `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) 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 `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.
const (
	LoadBalancerRulesOverridesSessionAffinityNone     LoadBalancerRulesOverridesSessionAffinity = "none"
	LoadBalancerRulesOverridesSessionAffinityCookie   LoadBalancerRulesOverridesSessionAffinity = "cookie"
	LoadBalancerRulesOverridesSessionAffinityIPCookie LoadBalancerRulesOverridesSessionAffinity = "ip_cookie"
	LoadBalancerRulesOverridesSessionAffinityHeader   LoadBalancerRulesOverridesSessionAffinity = "header"
	LoadBalancerRulesOverridesSessionAffinityEmpty    LoadBalancerRulesOverridesSessionAffinity = "\"\""
)

type LoadBalancerRulesOverridesSessionAffinityAttributes

type LoadBalancerRulesOverridesSessionAffinityAttributes struct {
	// Configures the drain duration in seconds. This field is only used when session
	// affinity is enabled on the load balancer.
	DrainDuration float64 `json:"drain_duration"`
	// Configures the names of HTTP headers to base session affinity on when header
	// `session_affinity` 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: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything
	// after the colon is a comma-separated list of cookie names. Providing only
	// `"cookie"` 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.
	Headers []string `json:"headers"`
	// When header `session_affinity` is enabled, this option can be used to specify
	// how HTTP headers on load balancing requests will be used. The supported values
	// are:
	//
	//   - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
	//     specified by the `headers` session affinity attribute, otherwise sessions
	//     aren't created.
	//   - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
	//     headers specified by the `headers` session affinity attribute, otherwise
	//     sessions aren't created.
	RequireAllHeaders bool `json:"require_all_headers"`
	// 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".
	Samesite LoadBalancerRulesOverridesSessionAffinityAttributesSamesite `json:"samesite"`
	// 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.
	Secure LoadBalancerRulesOverridesSessionAffinityAttributesSecure `json:"secure"`
	// 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:
	//
	//   - `"none"`: No failover takes place for sessions pinned to the origin (default).
	//   - `"temporary"`: 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.
	//   - `"sticky"`: 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.
	ZeroDowntimeFailover LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailover `json:"zero_downtime_failover"`
	JSON                 loadBalancerRulesOverridesSessionAffinityAttributesJSON                 `json:"-"`
}

Configures attributes for session affinity.

func (*LoadBalancerRulesOverridesSessionAffinityAttributes) UnmarshalJSON

func (r *LoadBalancerRulesOverridesSessionAffinityAttributes) UnmarshalJSON(data []byte) (err error)

type LoadBalancerRulesOverridesSessionAffinityAttributesSamesite

type LoadBalancerRulesOverridesSessionAffinityAttributesSamesite string

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".

const (
	LoadBalancerRulesOverridesSessionAffinityAttributesSamesiteAuto   LoadBalancerRulesOverridesSessionAffinityAttributesSamesite = "Auto"
	LoadBalancerRulesOverridesSessionAffinityAttributesSamesiteLax    LoadBalancerRulesOverridesSessionAffinityAttributesSamesite = "Lax"
	LoadBalancerRulesOverridesSessionAffinityAttributesSamesiteNone   LoadBalancerRulesOverridesSessionAffinityAttributesSamesite = "None"
	LoadBalancerRulesOverridesSessionAffinityAttributesSamesiteStrict LoadBalancerRulesOverridesSessionAffinityAttributesSamesite = "Strict"
)

type LoadBalancerRulesOverridesSessionAffinityAttributesSecure

type LoadBalancerRulesOverridesSessionAffinityAttributesSecure string

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.

const (
	LoadBalancerRulesOverridesSessionAffinityAttributesSecureAuto   LoadBalancerRulesOverridesSessionAffinityAttributesSecure = "Auto"
	LoadBalancerRulesOverridesSessionAffinityAttributesSecureAlways LoadBalancerRulesOverridesSessionAffinityAttributesSecure = "Always"
	LoadBalancerRulesOverridesSessionAffinityAttributesSecureNever  LoadBalancerRulesOverridesSessionAffinityAttributesSecure = "Never"
)

type LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailover

type LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailover string

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:

  • `"none"`: No failover takes place for sessions pinned to the origin (default).
  • `"temporary"`: 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.
  • `"sticky"`: 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.
const (
	LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverNone      LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "none"
	LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "temporary"
	LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky    LoadBalancerRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "sticky"
)

type LoadBalancerRulesOverridesSteeringPolicy

type LoadBalancerRulesOverridesSteeringPolicy string

Steering Policy for this load balancer.

  • `"off"`: Use `default_pools`.
  • `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.
  • `"random"`: Select a pool randomly.
  • `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).
  • `"proximity"`: Use the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.
  • `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.
  • `"least_connections"`: Select a pool by taking into consideration `random_steering` 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.
  • `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
const (
	LoadBalancerRulesOverridesSteeringPolicyOff                      LoadBalancerRulesOverridesSteeringPolicy = "off"
	LoadBalancerRulesOverridesSteeringPolicyGeo                      LoadBalancerRulesOverridesSteeringPolicy = "geo"
	LoadBalancerRulesOverridesSteeringPolicyRandom                   LoadBalancerRulesOverridesSteeringPolicy = "random"
	LoadBalancerRulesOverridesSteeringPolicyDynamicLatency           LoadBalancerRulesOverridesSteeringPolicy = "dynamic_latency"
	LoadBalancerRulesOverridesSteeringPolicyProximity                LoadBalancerRulesOverridesSteeringPolicy = "proximity"
	LoadBalancerRulesOverridesSteeringPolicyLeastOutstandingRequests LoadBalancerRulesOverridesSteeringPolicy = "least_outstanding_requests"
	LoadBalancerRulesOverridesSteeringPolicyLeastConnections         LoadBalancerRulesOverridesSteeringPolicy = "least_connections"
	LoadBalancerRulesOverridesSteeringPolicyEmpty                    LoadBalancerRulesOverridesSteeringPolicy = "\"\""
)

type LoadBalancerService

type LoadBalancerService struct {
	Options  []option.RequestOption
	Monitors *MonitorService
	Pools    *PoolService
	Previews *PreviewService
	Regions  *RegionService
	Searches *SearchService
}

LoadBalancerService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewLoadBalancerService method instead.

func NewLoadBalancerService

func NewLoadBalancerService(opts ...option.RequestOption) (r *LoadBalancerService)

NewLoadBalancerService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*LoadBalancerService) Delete

Delete a configured load balancer.

func (*LoadBalancerService) Edit

func (r *LoadBalancerService) Edit(ctx context.Context, loadBalancerID string, params LoadBalancerEditParams, opts ...option.RequestOption) (res *LoadBalancer, err error)

Apply changes to an existing load balancer, overwriting the supplied properties.

func (*LoadBalancerService) Get

func (r *LoadBalancerService) Get(ctx context.Context, loadBalancerID string, query LoadBalancerGetParams, opts ...option.RequestOption) (res *LoadBalancer, err error)

Fetch a single configured load balancer.

func (*LoadBalancerService) List

List configured load balancers.

func (*LoadBalancerService) New

Create a new load balancer.

func (*LoadBalancerService) Update

func (r *LoadBalancerService) Update(ctx context.Context, loadBalancerID string, params LoadBalancerUpdateParams, opts ...option.RequestOption) (res *LoadBalancer, err error)

Update a configured load balancer.

type LoadBalancerSessionAffinity

type LoadBalancerSessionAffinity string

Specifies the type of session affinity the load balancer should use unless specified as `"none"` or "" (default). The supported types are:

  • `"cookie"`: 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.
  • `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client's ip address.
  • `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) 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 `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.
const (
	LoadBalancerSessionAffinityNone     LoadBalancerSessionAffinity = "none"
	LoadBalancerSessionAffinityCookie   LoadBalancerSessionAffinity = "cookie"
	LoadBalancerSessionAffinityIPCookie LoadBalancerSessionAffinity = "ip_cookie"
	LoadBalancerSessionAffinityHeader   LoadBalancerSessionAffinity = "header"
	LoadBalancerSessionAffinityEmpty    LoadBalancerSessionAffinity = "\"\""
)

type LoadBalancerSessionAffinityAttributes

type LoadBalancerSessionAffinityAttributes struct {
	// Configures the drain duration in seconds. This field is only used when session
	// affinity is enabled on the load balancer.
	DrainDuration float64 `json:"drain_duration"`
	// Configures the names of HTTP headers to base session affinity on when header
	// `session_affinity` 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: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything
	// after the colon is a comma-separated list of cookie names. Providing only
	// `"cookie"` 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.
	Headers []string `json:"headers"`
	// When header `session_affinity` is enabled, this option can be used to specify
	// how HTTP headers on load balancing requests will be used. The supported values
	// are:
	//
	//   - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
	//     specified by the `headers` session affinity attribute, otherwise sessions
	//     aren't created.
	//   - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
	//     headers specified by the `headers` session affinity attribute, otherwise
	//     sessions aren't created.
	RequireAllHeaders bool `json:"require_all_headers"`
	// 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".
	Samesite LoadBalancerSessionAffinityAttributesSamesite `json:"samesite"`
	// 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.
	Secure LoadBalancerSessionAffinityAttributesSecure `json:"secure"`
	// 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:
	//
	//   - `"none"`: No failover takes place for sessions pinned to the origin (default).
	//   - `"temporary"`: 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.
	//   - `"sticky"`: 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.
	ZeroDowntimeFailover LoadBalancerSessionAffinityAttributesZeroDowntimeFailover `json:"zero_downtime_failover"`
	JSON                 loadBalancerSessionAffinityAttributesJSON                 `json:"-"`
}

Configures attributes for session affinity.

func (*LoadBalancerSessionAffinityAttributes) UnmarshalJSON

func (r *LoadBalancerSessionAffinityAttributes) UnmarshalJSON(data []byte) (err error)

type LoadBalancerSessionAffinityAttributesSamesite

type LoadBalancerSessionAffinityAttributesSamesite string

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".

const (
	LoadBalancerSessionAffinityAttributesSamesiteAuto   LoadBalancerSessionAffinityAttributesSamesite = "Auto"
	LoadBalancerSessionAffinityAttributesSamesiteLax    LoadBalancerSessionAffinityAttributesSamesite = "Lax"
	LoadBalancerSessionAffinityAttributesSamesiteNone   LoadBalancerSessionAffinityAttributesSamesite = "None"
	LoadBalancerSessionAffinityAttributesSamesiteStrict LoadBalancerSessionAffinityAttributesSamesite = "Strict"
)

type LoadBalancerSessionAffinityAttributesSecure

type LoadBalancerSessionAffinityAttributesSecure string

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.

const (
	LoadBalancerSessionAffinityAttributesSecureAuto   LoadBalancerSessionAffinityAttributesSecure = "Auto"
	LoadBalancerSessionAffinityAttributesSecureAlways LoadBalancerSessionAffinityAttributesSecure = "Always"
	LoadBalancerSessionAffinityAttributesSecureNever  LoadBalancerSessionAffinityAttributesSecure = "Never"
)

type LoadBalancerSessionAffinityAttributesZeroDowntimeFailover

type LoadBalancerSessionAffinityAttributesZeroDowntimeFailover string

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:

  • `"none"`: No failover takes place for sessions pinned to the origin (default).
  • `"temporary"`: 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.
  • `"sticky"`: 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.
const (
	LoadBalancerSessionAffinityAttributesZeroDowntimeFailoverNone      LoadBalancerSessionAffinityAttributesZeroDowntimeFailover = "none"
	LoadBalancerSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerSessionAffinityAttributesZeroDowntimeFailover = "temporary"
	LoadBalancerSessionAffinityAttributesZeroDowntimeFailoverSticky    LoadBalancerSessionAffinityAttributesZeroDowntimeFailover = "sticky"
)

type LoadBalancerSteeringPolicy

type LoadBalancerSteeringPolicy string

Steering Policy for this load balancer.

  • `"off"`: Use `default_pools`.
  • `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.
  • `"random"`: Select a pool randomly.
  • `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).
  • `"proximity"`: Use the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.
  • `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.
  • `"least_connections"`: Select a pool by taking into consideration `random_steering` 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.
  • `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
const (
	LoadBalancerSteeringPolicyOff                      LoadBalancerSteeringPolicy = "off"
	LoadBalancerSteeringPolicyGeo                      LoadBalancerSteeringPolicy = "geo"
	LoadBalancerSteeringPolicyRandom                   LoadBalancerSteeringPolicy = "random"
	LoadBalancerSteeringPolicyDynamicLatency           LoadBalancerSteeringPolicy = "dynamic_latency"
	LoadBalancerSteeringPolicyProximity                LoadBalancerSteeringPolicy = "proximity"
	LoadBalancerSteeringPolicyLeastOutstandingRequests LoadBalancerSteeringPolicy = "least_outstanding_requests"
	LoadBalancerSteeringPolicyLeastConnections         LoadBalancerSteeringPolicy = "least_connections"
	LoadBalancerSteeringPolicyEmpty                    LoadBalancerSteeringPolicy = "\"\""
)

type LoadBalancerUpdateParams

type LoadBalancerUpdateParams struct {
	ZoneID param.Field[string] `path:"zone_id,required"`
	// A list of pool IDs ordered by their failover priority. Pools defined here are
	// used by default, or when region_pools are not configured for a given region.
	DefaultPools param.Field[[]string] `json:"default_pools,required"`
	// The pool ID to use when all other pools are detected as unhealthy.
	FallbackPool param.Field[interface{}] `json:"fallback_pool,required"`
	// The DNS hostname to associate with your Load Balancer. If this hostname already
	// exists as a DNS record in Cloudflare's DNS, the Load Balancer will take
	// precedence and the DNS record will not be used.
	Name param.Field[string] `json:"name,required"`
	// Controls features that modify the routing of requests to pools and origins in
	// response to dynamic conditions, such as during the interval between active
	// health monitoring requests. For example, zero-downtime failover occurs
	// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
	// response codes. If there is another healthy origin in the same pool, the request
	// is retried once against this alternate origin.
	AdaptiveRouting param.Field[LoadBalancerUpdateParamsAdaptiveRouting] `json:"adaptive_routing"`
	// A mapping of country codes to a list of pool IDs (ordered by their failover
	// priority) for the given country. Any country not explicitly defined will fall
	// back to using the corresponding region_pool mapping if it exists else to
	// default_pools.
	CountryPools param.Field[interface{}] `json:"country_pools"`
	// Object description.
	Description param.Field[string] `json:"description"`
	// Whether to enable (the default) this load balancer.
	Enabled param.Field[bool] `json:"enabled"`
	// Controls location-based steering for non-proxied requests. See `steering_policy`
	// to learn how steering is affected.
	LocationStrategy param.Field[LoadBalancerUpdateParamsLocationStrategy] `json:"location_strategy"`
	// (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
	// (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
	// explicitly defined will fall back to using the corresponding country_pool, then
	// region_pool mapping if it exists else to default_pools.
	PopPools param.Field[interface{}] `json:"pop_pools"`
	// Whether the hostname should be gray clouded (false) or orange clouded (true).
	Proxied param.Field[bool] `json:"proxied"`
	// Configures pool weights.
	//
	//   - `steering_policy="random"`: A random pool is selected with probability
	//     proportional to pool weights.
	//   - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
	//     pool's outstanding requests.
	//   - `steering_policy="least_connections"`: Use pool weights to scale each pool's
	//     open connections.
	RandomSteering param.Field[LoadBalancerUpdateParamsRandomSteering] `json:"random_steering"`
	// A mapping of region codes to a list of pool IDs (ordered by their failover
	// priority) for the given region. Any regions not explicitly defined will fall
	// back to using default_pools.
	RegionPools param.Field[interface{}] `json:"region_pools"`
	// BETA Field Not General Access: A list of rules for this load balancer to
	// execute.
	Rules param.Field[[]LoadBalancerUpdateParamsRule] `json:"rules"`
	// Specifies the type of session affinity the load balancer should use unless
	// specified as `"none"` or "" (default). The supported types are:
	//
	//   - `"cookie"`: 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.
	//   - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
	//     selection is stable and based on the client's ip address.
	//   - `"header"`: On the first request to a proxied load balancer, a session key
	//     based on the configured HTTP headers (see
	//     `session_affinity_attributes.headers`) 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 `session_affinity_ttl` seconds or the origin
	//     server is unhealthy, then a new origin server is calculated and used. See
	//     `headers` in `session_affinity_attributes` for additional required
	//     configuration.
	SessionAffinity param.Field[LoadBalancerUpdateParamsSessionAffinity] `json:"session_affinity"`
	// Configures attributes for session affinity.
	SessionAffinityAttributes param.Field[LoadBalancerUpdateParamsSessionAffinityAttributes] `json:"session_affinity_attributes"`
	// 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 `session_affinity` policy are:
	//
	//   - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
	//     unless explicitly set. The accepted range of values is between [1800, 604800].
	//   - `"header"`: 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.
	SessionAffinityTTL param.Field[float64] `json:"session_affinity_ttl"`
	// Steering Policy for this load balancer.
	//
	//   - `"off"`: Use `default_pools`.
	//   - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
	//     requests, the country for `country_pools` is determined by
	//     `location_strategy`.
	//   - `"random"`: Select a pool randomly.
	//   - `"dynamic_latency"`: Use round trip time to select the closest pool in
	//     default_pools (requires pool health checks).
	//   - `"proximity"`: Use the pools' latitude and longitude to select the closest
	//     pool using the Cloudflare PoP location for proxied requests or the location
	//     determined by `location_strategy` for non-proxied requests.
	//   - `"least_outstanding_requests"`: Select a pool by taking into consideration
	//     `random_steering` weights, as well as each pool's number of outstanding
	//     requests. Pools with more pending requests are weighted proportionately less
	//     relative to others.
	//   - `"least_connections"`: Select a pool by taking into consideration
	//     `random_steering` 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.
	//   - `""`: Will map to `"geo"` if you use
	//     `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
	SteeringPolicy param.Field[LoadBalancerUpdateParamsSteeringPolicy] `json:"steering_policy"`
	// Time to live (TTL) of the DNS entry for the IP address returned by this load
	// balancer. This only applies to gray-clouded (unproxied) load balancers.
	TTL param.Field[float64] `json:"ttl"`
}

func (LoadBalancerUpdateParams) MarshalJSON

func (r LoadBalancerUpdateParams) MarshalJSON() (data []byte, err error)

type LoadBalancerUpdateParamsAdaptiveRouting

type LoadBalancerUpdateParamsAdaptiveRouting struct {
	// Extends zero-downtime failover of requests to healthy origins from alternate
	// pools, when no healthy alternate exists in the same pool, according to the
	// failover order defined by traffic and origin steering. When set false (the
	// default) zero-downtime failover will only occur between origins within the same
	// pool. See `session_affinity_attributes` for control over when sessions are
	// broken or reassigned.
	FailoverAcrossPools param.Field[bool] `json:"failover_across_pools"`
}

Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin.

func (LoadBalancerUpdateParamsAdaptiveRouting) MarshalJSON

func (r LoadBalancerUpdateParamsAdaptiveRouting) MarshalJSON() (data []byte, err error)

type LoadBalancerUpdateParamsLocationStrategy

type LoadBalancerUpdateParamsLocationStrategy struct {
	// Determines the authoritative location when ECS is not preferred, does not exist
	// in the request, or its GeoIP lookup is unsuccessful.
	//
	//   - `"pop"`: Use the Cloudflare PoP location.
	//   - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
	//     unsuccessful, use the Cloudflare PoP location.
	Mode param.Field[LoadBalancerUpdateParamsLocationStrategyMode] `json:"mode"`
	// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
	// authoritative location.
	//
	// - `"always"`: Always prefer ECS.
	// - `"never"`: Never prefer ECS.
	// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
	// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
	PreferEcs param.Field[LoadBalancerUpdateParamsLocationStrategyPreferEcs] `json:"prefer_ecs"`
}

Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected.

func (LoadBalancerUpdateParamsLocationStrategy) MarshalJSON

func (r LoadBalancerUpdateParamsLocationStrategy) MarshalJSON() (data []byte, err error)

type LoadBalancerUpdateParamsLocationStrategyMode

type LoadBalancerUpdateParamsLocationStrategyMode string

Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.

  • `"pop"`: Use the Cloudflare PoP location.
  • `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.
const (
	LoadBalancerUpdateParamsLocationStrategyModePop        LoadBalancerUpdateParamsLocationStrategyMode = "pop"
	LoadBalancerUpdateParamsLocationStrategyModeResolverIP LoadBalancerUpdateParamsLocationStrategyMode = "resolver_ip"
)

type LoadBalancerUpdateParamsLocationStrategyPreferEcs

type LoadBalancerUpdateParamsLocationStrategyPreferEcs string

Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.

- `"always"`: Always prefer ECS. - `"never"`: Never prefer ECS. - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`. - `"geo"`: Prefer ECS only when `steering_policy="geo"`.

const (
	LoadBalancerUpdateParamsLocationStrategyPreferEcsAlways    LoadBalancerUpdateParamsLocationStrategyPreferEcs = "always"
	LoadBalancerUpdateParamsLocationStrategyPreferEcsNever     LoadBalancerUpdateParamsLocationStrategyPreferEcs = "never"
	LoadBalancerUpdateParamsLocationStrategyPreferEcsProximity LoadBalancerUpdateParamsLocationStrategyPreferEcs = "proximity"
	LoadBalancerUpdateParamsLocationStrategyPreferEcsGeo       LoadBalancerUpdateParamsLocationStrategyPreferEcs = "geo"
)

type LoadBalancerUpdateParamsRandomSteering

type LoadBalancerUpdateParamsRandomSteering struct {
	// The default weight for pools in the load balancer that are not specified in the
	// pool_weights map.
	DefaultWeight param.Field[float64] `json:"default_weight"`
	// A mapping of pool IDs to custom weights. The weight is relative to other pools
	// in the load balancer.
	PoolWeights param.Field[interface{}] `json:"pool_weights"`
}

Configures pool weights.

  • `steering_policy="random"`: A random pool is selected with probability proportional to pool weights.
  • `steering_policy="least_outstanding_requests"`: Use pool weights to scale each pool's outstanding requests.
  • `steering_policy="least_connections"`: Use pool weights to scale each pool's open connections.

func (LoadBalancerUpdateParamsRandomSteering) MarshalJSON

func (r LoadBalancerUpdateParamsRandomSteering) MarshalJSON() (data []byte, err error)

type LoadBalancerUpdateParamsRule

type LoadBalancerUpdateParamsRule struct {
	// The condition expressions to evaluate. If the condition evaluates to true, the
	// overrides or fixed_response in this rule will be applied. An empty condition is
	// always true. For more details on condition expressions, please see
	// https://developers.cloudflare.com/load-balancing/understand-basics/load-balancing-rules/expressions.
	Condition param.Field[string] `json:"condition"`
	// Disable this specific rule. It will no longer be evaluated by this load
	// balancer.
	Disabled param.Field[bool] `json:"disabled"`
	// A collection of fields used to directly respond to the eyeball instead of
	// routing to a pool. If a fixed_response is supplied the rule will be marked as
	// terminates.
	FixedResponse param.Field[LoadBalancerUpdateParamsRulesFixedResponse] `json:"fixed_response"`
	// Name of this rule. Only used for human readability.
	Name param.Field[string] `json:"name"`
	// A collection of overrides to apply to the load balancer when this rule's
	// condition is true. All fields are optional.
	Overrides param.Field[LoadBalancerUpdateParamsRulesOverrides] `json:"overrides"`
	// 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.
	Priority param.Field[int64] `json:"priority"`
	// If this rule's condition is true, this causes rule evaluation to stop after
	// processing this rule.
	Terminates param.Field[bool] `json:"terminates"`
}

A rule object containing conditions and overrides for this load balancer to evaluate.

func (LoadBalancerUpdateParamsRule) MarshalJSON

func (r LoadBalancerUpdateParamsRule) MarshalJSON() (data []byte, err error)

type LoadBalancerUpdateParamsRulesFixedResponse

type LoadBalancerUpdateParamsRulesFixedResponse struct {
	// The http 'Content-Type' header to include in the response.
	ContentType param.Field[string] `json:"content_type"`
	// The http 'Location' header to include in the response.
	Location param.Field[string] `json:"location"`
	// Text to include as the http body.
	MessageBody param.Field[string] `json:"message_body"`
	// The http status code to respond with.
	StatusCode param.Field[int64] `json:"status_code"`
}

A collection of fields used to directly respond to the eyeball instead of routing to a pool. If a fixed_response is supplied the rule will be marked as terminates.

func (LoadBalancerUpdateParamsRulesFixedResponse) MarshalJSON

func (r LoadBalancerUpdateParamsRulesFixedResponse) MarshalJSON() (data []byte, err error)

type LoadBalancerUpdateParamsRulesOverrides

type LoadBalancerUpdateParamsRulesOverrides struct {
	// Controls features that modify the routing of requests to pools and origins in
	// response to dynamic conditions, such as during the interval between active
	// health monitoring requests. For example, zero-downtime failover occurs
	// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
	// response codes. If there is another healthy origin in the same pool, the request
	// is retried once against this alternate origin.
	AdaptiveRouting param.Field[LoadBalancerUpdateParamsRulesOverridesAdaptiveRouting] `json:"adaptive_routing"`
	// A mapping of country codes to a list of pool IDs (ordered by their failover
	// priority) for the given country. Any country not explicitly defined will fall
	// back to using the corresponding region_pool mapping if it exists else to
	// default_pools.
	CountryPools param.Field[interface{}] `json:"country_pools"`
	// A list of pool IDs ordered by their failover priority. Pools defined here are
	// used by default, or when region_pools are not configured for a given region.
	DefaultPools param.Field[[]string] `json:"default_pools"`
	// The pool ID to use when all other pools are detected as unhealthy.
	FallbackPool param.Field[interface{}] `json:"fallback_pool"`
	// Controls location-based steering for non-proxied requests. See `steering_policy`
	// to learn how steering is affected.
	LocationStrategy param.Field[LoadBalancerUpdateParamsRulesOverridesLocationStrategy] `json:"location_strategy"`
	// (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
	// (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
	// explicitly defined will fall back to using the corresponding country_pool, then
	// region_pool mapping if it exists else to default_pools.
	PopPools param.Field[interface{}] `json:"pop_pools"`
	// Configures pool weights.
	//
	//   - `steering_policy="random"`: A random pool is selected with probability
	//     proportional to pool weights.
	//   - `steering_policy="least_outstanding_requests"`: Use pool weights to scale each
	//     pool's outstanding requests.
	//   - `steering_policy="least_connections"`: Use pool weights to scale each pool's
	//     open connections.
	RandomSteering param.Field[LoadBalancerUpdateParamsRulesOverridesRandomSteering] `json:"random_steering"`
	// A mapping of region codes to a list of pool IDs (ordered by their failover
	// priority) for the given region. Any regions not explicitly defined will fall
	// back to using default_pools.
	RegionPools param.Field[interface{}] `json:"region_pools"`
	// Specifies the type of session affinity the load balancer should use unless
	// specified as `"none"` or "" (default). The supported types are:
	//
	//   - `"cookie"`: 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.
	//   - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin
	//     selection is stable and based on the client's ip address.
	//   - `"header"`: On the first request to a proxied load balancer, a session key
	//     based on the configured HTTP headers (see
	//     `session_affinity_attributes.headers`) 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 `session_affinity_ttl` seconds or the origin
	//     server is unhealthy, then a new origin server is calculated and used. See
	//     `headers` in `session_affinity_attributes` for additional required
	//     configuration.
	SessionAffinity param.Field[LoadBalancerUpdateParamsRulesOverridesSessionAffinity] `json:"session_affinity"`
	// Configures attributes for session affinity.
	SessionAffinityAttributes param.Field[LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributes] `json:"session_affinity_attributes"`
	// 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 `session_affinity` policy are:
	//
	//   - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used
	//     unless explicitly set. The accepted range of values is between [1800, 604800].
	//   - `"header"`: 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.
	SessionAffinityTTL param.Field[float64] `json:"session_affinity_ttl"`
	// Steering Policy for this load balancer.
	//
	//   - `"off"`: Use `default_pools`.
	//   - `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied
	//     requests, the country for `country_pools` is determined by
	//     `location_strategy`.
	//   - `"random"`: Select a pool randomly.
	//   - `"dynamic_latency"`: Use round trip time to select the closest pool in
	//     default_pools (requires pool health checks).
	//   - `"proximity"`: Use the pools' latitude and longitude to select the closest
	//     pool using the Cloudflare PoP location for proxied requests or the location
	//     determined by `location_strategy` for non-proxied requests.
	//   - `"least_outstanding_requests"`: Select a pool by taking into consideration
	//     `random_steering` weights, as well as each pool's number of outstanding
	//     requests. Pools with more pending requests are weighted proportionately less
	//     relative to others.
	//   - `"least_connections"`: Select a pool by taking into consideration
	//     `random_steering` 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.
	//   - `""`: Will map to `"geo"` if you use
	//     `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
	SteeringPolicy param.Field[LoadBalancerUpdateParamsRulesOverridesSteeringPolicy] `json:"steering_policy"`
	// Time to live (TTL) of the DNS entry for the IP address returned by this load
	// balancer. This only applies to gray-clouded (unproxied) load balancers.
	TTL param.Field[float64] `json:"ttl"`
}

A collection of overrides to apply to the load balancer when this rule's condition is true. All fields are optional.

func (LoadBalancerUpdateParamsRulesOverrides) MarshalJSON

func (r LoadBalancerUpdateParamsRulesOverrides) MarshalJSON() (data []byte, err error)

type LoadBalancerUpdateParamsRulesOverridesAdaptiveRouting

type LoadBalancerUpdateParamsRulesOverridesAdaptiveRouting struct {
	// Extends zero-downtime failover of requests to healthy origins from alternate
	// pools, when no healthy alternate exists in the same pool, according to the
	// failover order defined by traffic and origin steering. When set false (the
	// default) zero-downtime failover will only occur between origins within the same
	// pool. See `session_affinity_attributes` for control over when sessions are
	// broken or reassigned.
	FailoverAcrossPools param.Field[bool] `json:"failover_across_pools"`
}

Controls features that modify the routing of requests to pools and origins in response to dynamic conditions, such as during the interval between active health monitoring requests. For example, zero-downtime failover occurs immediately when an origin becomes unavailable due to HTTP 521, 522, or 523 response codes. If there is another healthy origin in the same pool, the request is retried once against this alternate origin.

func (LoadBalancerUpdateParamsRulesOverridesAdaptiveRouting) MarshalJSON

type LoadBalancerUpdateParamsRulesOverridesLocationStrategy

type LoadBalancerUpdateParamsRulesOverridesLocationStrategy struct {
	// Determines the authoritative location when ECS is not preferred, does not exist
	// in the request, or its GeoIP lookup is unsuccessful.
	//
	//   - `"pop"`: Use the Cloudflare PoP location.
	//   - `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is
	//     unsuccessful, use the Cloudflare PoP location.
	Mode param.Field[LoadBalancerUpdateParamsRulesOverridesLocationStrategyMode] `json:"mode"`
	// Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the
	// authoritative location.
	//
	// - `"always"`: Always prefer ECS.
	// - `"never"`: Never prefer ECS.
	// - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`.
	// - `"geo"`: Prefer ECS only when `steering_policy="geo"`.
	PreferEcs param.Field[LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcs] `json:"prefer_ecs"`
}

Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected.

func (LoadBalancerUpdateParamsRulesOverridesLocationStrategy) MarshalJSON

type LoadBalancerUpdateParamsRulesOverridesLocationStrategyMode

type LoadBalancerUpdateParamsRulesOverridesLocationStrategyMode string

Determines the authoritative location when ECS is not preferred, does not exist in the request, or its GeoIP lookup is unsuccessful.

  • `"pop"`: Use the Cloudflare PoP location.
  • `"resolver_ip"`: Use the DNS resolver GeoIP location. If the GeoIP lookup is unsuccessful, use the Cloudflare PoP location.
const (
	LoadBalancerUpdateParamsRulesOverridesLocationStrategyModePop        LoadBalancerUpdateParamsRulesOverridesLocationStrategyMode = "pop"
	LoadBalancerUpdateParamsRulesOverridesLocationStrategyModeResolverIP LoadBalancerUpdateParamsRulesOverridesLocationStrategyMode = "resolver_ip"
)

type LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcs

type LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcs string

Whether the EDNS Client Subnet (ECS) GeoIP should be preferred as the authoritative location.

- `"always"`: Always prefer ECS. - `"never"`: Never prefer ECS. - `"proximity"`: Prefer ECS only when `steering_policy="proximity"`. - `"geo"`: Prefer ECS only when `steering_policy="geo"`.

const (
	LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcsAlways    LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcs = "always"
	LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcsNever     LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcs = "never"
	LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcsProximity LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcs = "proximity"
	LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcsGeo       LoadBalancerUpdateParamsRulesOverridesLocationStrategyPreferEcs = "geo"
)

type LoadBalancerUpdateParamsRulesOverridesRandomSteering

type LoadBalancerUpdateParamsRulesOverridesRandomSteering struct {
	// The default weight for pools in the load balancer that are not specified in the
	// pool_weights map.
	DefaultWeight param.Field[float64] `json:"default_weight"`
	// A mapping of pool IDs to custom weights. The weight is relative to other pools
	// in the load balancer.
	PoolWeights param.Field[interface{}] `json:"pool_weights"`
}

Configures pool weights.

  • `steering_policy="random"`: A random pool is selected with probability proportional to pool weights.
  • `steering_policy="least_outstanding_requests"`: Use pool weights to scale each pool's outstanding requests.
  • `steering_policy="least_connections"`: Use pool weights to scale each pool's open connections.

func (LoadBalancerUpdateParamsRulesOverridesRandomSteering) MarshalJSON

func (r LoadBalancerUpdateParamsRulesOverridesRandomSteering) MarshalJSON() (data []byte, err error)

type LoadBalancerUpdateParamsRulesOverridesSessionAffinity

type LoadBalancerUpdateParamsRulesOverridesSessionAffinity string

Specifies the type of session affinity the load balancer should use unless specified as `"none"` or "" (default). The supported types are:

  • `"cookie"`: 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.
  • `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client's ip address.
  • `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) 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 `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.
const (
	LoadBalancerUpdateParamsRulesOverridesSessionAffinityNone     LoadBalancerUpdateParamsRulesOverridesSessionAffinity = "none"
	LoadBalancerUpdateParamsRulesOverridesSessionAffinityCookie   LoadBalancerUpdateParamsRulesOverridesSessionAffinity = "cookie"
	LoadBalancerUpdateParamsRulesOverridesSessionAffinityIPCookie LoadBalancerUpdateParamsRulesOverridesSessionAffinity = "ip_cookie"
	LoadBalancerUpdateParamsRulesOverridesSessionAffinityHeader   LoadBalancerUpdateParamsRulesOverridesSessionAffinity = "header"
	LoadBalancerUpdateParamsRulesOverridesSessionAffinityEmpty    LoadBalancerUpdateParamsRulesOverridesSessionAffinity = "\"\""
)

type LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributes

type LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributes struct {
	// Configures the drain duration in seconds. This field is only used when session
	// affinity is enabled on the load balancer.
	DrainDuration param.Field[float64] `json:"drain_duration"`
	// Configures the names of HTTP headers to base session affinity on when header
	// `session_affinity` 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: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything
	// after the colon is a comma-separated list of cookie names. Providing only
	// `"cookie"` 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.
	Headers param.Field[[]string] `json:"headers"`
	// When header `session_affinity` is enabled, this option can be used to specify
	// how HTTP headers on load balancing requests will be used. The supported values
	// are:
	//
	//   - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
	//     specified by the `headers` session affinity attribute, otherwise sessions
	//     aren't created.
	//   - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
	//     headers specified by the `headers` session affinity attribute, otherwise
	//     sessions aren't created.
	RequireAllHeaders param.Field[bool] `json:"require_all_headers"`
	// 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".
	Samesite param.Field[LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesite] `json:"samesite"`
	// 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.
	Secure param.Field[LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecure] `json:"secure"`
	// 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:
	//
	//   - `"none"`: No failover takes place for sessions pinned to the origin (default).
	//   - `"temporary"`: 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.
	//   - `"sticky"`: 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.
	ZeroDowntimeFailover param.Field[LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover] `json:"zero_downtime_failover"`
}

Configures attributes for session affinity.

func (LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributes) MarshalJSON

type LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesite

type LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesite string

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".

const (
	LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesiteAuto   LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesite = "Auto"
	LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesiteLax    LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesite = "Lax"
	LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesiteNone   LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesite = "None"
	LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesiteStrict LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSamesite = "Strict"
)

type LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecure

type LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecure string

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.

const (
	LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecureAuto   LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecure = "Auto"
	LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecureAlways LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecure = "Always"
	LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecureNever  LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesSecure = "Never"
)

type LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover

type LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover string

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:

  • `"none"`: No failover takes place for sessions pinned to the origin (default).
  • `"temporary"`: 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.
  • `"sticky"`: 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.
const (
	LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverNone      LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "none"
	LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "temporary"
	LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailoverSticky    LoadBalancerUpdateParamsRulesOverridesSessionAffinityAttributesZeroDowntimeFailover = "sticky"
)

type LoadBalancerUpdateParamsRulesOverridesSteeringPolicy

type LoadBalancerUpdateParamsRulesOverridesSteeringPolicy string

Steering Policy for this load balancer.

  • `"off"`: Use `default_pools`.
  • `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.
  • `"random"`: Select a pool randomly.
  • `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).
  • `"proximity"`: Use the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.
  • `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.
  • `"least_connections"`: Select a pool by taking into consideration `random_steering` 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.
  • `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
const (
	LoadBalancerUpdateParamsRulesOverridesSteeringPolicyOff                      LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "off"
	LoadBalancerUpdateParamsRulesOverridesSteeringPolicyGeo                      LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "geo"
	LoadBalancerUpdateParamsRulesOverridesSteeringPolicyRandom                   LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "random"
	LoadBalancerUpdateParamsRulesOverridesSteeringPolicyDynamicLatency           LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "dynamic_latency"
	LoadBalancerUpdateParamsRulesOverridesSteeringPolicyProximity                LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "proximity"
	LoadBalancerUpdateParamsRulesOverridesSteeringPolicyLeastOutstandingRequests LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "least_outstanding_requests"
	LoadBalancerUpdateParamsRulesOverridesSteeringPolicyLeastConnections         LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "least_connections"
	LoadBalancerUpdateParamsRulesOverridesSteeringPolicyEmpty                    LoadBalancerUpdateParamsRulesOverridesSteeringPolicy = "\"\""
)

type LoadBalancerUpdateParamsSessionAffinity

type LoadBalancerUpdateParamsSessionAffinity string

Specifies the type of session affinity the load balancer should use unless specified as `"none"` or "" (default). The supported types are:

  • `"cookie"`: 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.
  • `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin selection is stable and based on the client's ip address.
  • `"header"`: On the first request to a proxied load balancer, a session key based on the configured HTTP headers (see `session_affinity_attributes.headers`) 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 `session_affinity_ttl` seconds or the origin server is unhealthy, then a new origin server is calculated and used. See `headers` in `session_affinity_attributes` for additional required configuration.
const (
	LoadBalancerUpdateParamsSessionAffinityNone     LoadBalancerUpdateParamsSessionAffinity = "none"
	LoadBalancerUpdateParamsSessionAffinityCookie   LoadBalancerUpdateParamsSessionAffinity = "cookie"
	LoadBalancerUpdateParamsSessionAffinityIPCookie LoadBalancerUpdateParamsSessionAffinity = "ip_cookie"
	LoadBalancerUpdateParamsSessionAffinityHeader   LoadBalancerUpdateParamsSessionAffinity = "header"
	LoadBalancerUpdateParamsSessionAffinityEmpty    LoadBalancerUpdateParamsSessionAffinity = "\"\""
)

type LoadBalancerUpdateParamsSessionAffinityAttributes

type LoadBalancerUpdateParamsSessionAffinityAttributes struct {
	// Configures the drain duration in seconds. This field is only used when session
	// affinity is enabled on the load balancer.
	DrainDuration param.Field[float64] `json:"drain_duration"`
	// Configures the names of HTTP headers to base session affinity on when header
	// `session_affinity` 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: `"cookie:<cookie-name-1>,<cookie-name-2>"` (example) where everything
	// after the colon is a comma-separated list of cookie names. Providing only
	// `"cookie"` 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.
	Headers param.Field[[]string] `json:"headers"`
	// When header `session_affinity` is enabled, this option can be used to specify
	// how HTTP headers on load balancing requests will be used. The supported values
	// are:
	//
	//   - `"true"`: Load balancing requests must contain _all_ of the HTTP headers
	//     specified by the `headers` session affinity attribute, otherwise sessions
	//     aren't created.
	//   - `"false"`: Load balancing requests must contain _at least one_ of the HTTP
	//     headers specified by the `headers` session affinity attribute, otherwise
	//     sessions aren't created.
	RequireAllHeaders param.Field[bool] `json:"require_all_headers"`
	// 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".
	Samesite param.Field[LoadBalancerUpdateParamsSessionAffinityAttributesSamesite] `json:"samesite"`
	// 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.
	Secure param.Field[LoadBalancerUpdateParamsSessionAffinityAttributesSecure] `json:"secure"`
	// 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:
	//
	//   - `"none"`: No failover takes place for sessions pinned to the origin (default).
	//   - `"temporary"`: 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.
	//   - `"sticky"`: 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.
	ZeroDowntimeFailover param.Field[LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailover] `json:"zero_downtime_failover"`
}

Configures attributes for session affinity.

func (LoadBalancerUpdateParamsSessionAffinityAttributes) MarshalJSON

func (r LoadBalancerUpdateParamsSessionAffinityAttributes) MarshalJSON() (data []byte, err error)

type LoadBalancerUpdateParamsSessionAffinityAttributesSamesite

type LoadBalancerUpdateParamsSessionAffinityAttributesSamesite string

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".

const (
	LoadBalancerUpdateParamsSessionAffinityAttributesSamesiteAuto   LoadBalancerUpdateParamsSessionAffinityAttributesSamesite = "Auto"
	LoadBalancerUpdateParamsSessionAffinityAttributesSamesiteLax    LoadBalancerUpdateParamsSessionAffinityAttributesSamesite = "Lax"
	LoadBalancerUpdateParamsSessionAffinityAttributesSamesiteNone   LoadBalancerUpdateParamsSessionAffinityAttributesSamesite = "None"
	LoadBalancerUpdateParamsSessionAffinityAttributesSamesiteStrict LoadBalancerUpdateParamsSessionAffinityAttributesSamesite = "Strict"
)

type LoadBalancerUpdateParamsSessionAffinityAttributesSecure

type LoadBalancerUpdateParamsSessionAffinityAttributesSecure string

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.

const (
	LoadBalancerUpdateParamsSessionAffinityAttributesSecureAuto   LoadBalancerUpdateParamsSessionAffinityAttributesSecure = "Auto"
	LoadBalancerUpdateParamsSessionAffinityAttributesSecureAlways LoadBalancerUpdateParamsSessionAffinityAttributesSecure = "Always"
	LoadBalancerUpdateParamsSessionAffinityAttributesSecureNever  LoadBalancerUpdateParamsSessionAffinityAttributesSecure = "Never"
)

type LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailover

type LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailover string

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:

  • `"none"`: No failover takes place for sessions pinned to the origin (default).
  • `"temporary"`: 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.
  • `"sticky"`: 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.
const (
	LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailoverNone      LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailover = "none"
	LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailoverTemporary LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailover = "temporary"
	LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailoverSticky    LoadBalancerUpdateParamsSessionAffinityAttributesZeroDowntimeFailover = "sticky"
)

type LoadBalancerUpdateParamsSteeringPolicy

type LoadBalancerUpdateParamsSteeringPolicy string

Steering Policy for this load balancer.

  • `"off"`: Use `default_pools`.
  • `"geo"`: Use `region_pools`/`country_pools`/`pop_pools`. For non-proxied requests, the country for `country_pools` is determined by `location_strategy`.
  • `"random"`: Select a pool randomly.
  • `"dynamic_latency"`: Use round trip time to select the closest pool in default_pools (requires pool health checks).
  • `"proximity"`: Use the pools' latitude and longitude to select the closest pool using the Cloudflare PoP location for proxied requests or the location determined by `location_strategy` for non-proxied requests.
  • `"least_outstanding_requests"`: Select a pool by taking into consideration `random_steering` weights, as well as each pool's number of outstanding requests. Pools with more pending requests are weighted proportionately less relative to others.
  • `"least_connections"`: Select a pool by taking into consideration `random_steering` 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.
  • `""`: Will map to `"geo"` if you use `region_pools`/`country_pools`/`pop_pools` otherwise `"off"`.
const (
	LoadBalancerUpdateParamsSteeringPolicyOff                      LoadBalancerUpdateParamsSteeringPolicy = "off"
	LoadBalancerUpdateParamsSteeringPolicyGeo                      LoadBalancerUpdateParamsSteeringPolicy = "geo"
	LoadBalancerUpdateParamsSteeringPolicyRandom                   LoadBalancerUpdateParamsSteeringPolicy = "random"
	LoadBalancerUpdateParamsSteeringPolicyDynamicLatency           LoadBalancerUpdateParamsSteeringPolicy = "dynamic_latency"
	LoadBalancerUpdateParamsSteeringPolicyProximity                LoadBalancerUpdateParamsSteeringPolicy = "proximity"
	LoadBalancerUpdateParamsSteeringPolicyLeastOutstandingRequests LoadBalancerUpdateParamsSteeringPolicy = "least_outstanding_requests"
	LoadBalancerUpdateParamsSteeringPolicyLeastConnections         LoadBalancerUpdateParamsSteeringPolicy = "least_connections"
	LoadBalancerUpdateParamsSteeringPolicyEmpty                    LoadBalancerUpdateParamsSteeringPolicy = "\"\""
)

type LoadBalancerUpdateResponseEnvelope

type LoadBalancerUpdateResponseEnvelope struct {
	Errors   []LoadBalancerUpdateResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerUpdateResponseEnvelopeMessages `json:"messages,required"`
	Result   LoadBalancer                                 `json:"result,required"`
	// Whether the API call was successful
	Success LoadBalancerUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    loadBalancerUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*LoadBalancerUpdateResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerUpdateResponseEnvelopeErrors

type LoadBalancerUpdateResponseEnvelopeErrors struct {
	Code    int64                                        `json:"code,required"`
	Message string                                       `json:"message,required"`
	JSON    loadBalancerUpdateResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerUpdateResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerUpdateResponseEnvelopeMessages

type LoadBalancerUpdateResponseEnvelopeMessages struct {
	Code    int64                                          `json:"code,required"`
	Message string                                         `json:"message,required"`
	JSON    loadBalancerUpdateResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerUpdateResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerUpdateResponseEnvelopeSuccess

type LoadBalancerUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerUpdateResponseEnvelopeSuccessTrue LoadBalancerUpdateResponseEnvelopeSuccess = true
)

type MonitorDeleteParams

type MonitorDeleteParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type MonitorDeleteResponse

type MonitorDeleteResponse struct {
	ID   string                    `json:"id"`
	JSON monitorDeleteResponseJSON `json:"-"`
}

func (*MonitorDeleteResponse) UnmarshalJSON

func (r *MonitorDeleteResponse) UnmarshalJSON(data []byte) (err error)

type MonitorDeleteResponseEnvelope

type MonitorDeleteResponseEnvelope struct {
	Errors   []MonitorDeleteResponseEnvelopeErrors   `json:"errors,required"`
	Messages []MonitorDeleteResponseEnvelopeMessages `json:"messages,required"`
	Result   MonitorDeleteResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success MonitorDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    monitorDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*MonitorDeleteResponseEnvelope) UnmarshalJSON

func (r *MonitorDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type MonitorDeleteResponseEnvelopeErrors

type MonitorDeleteResponseEnvelopeErrors struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    monitorDeleteResponseEnvelopeErrorsJSON `json:"-"`
}

func (*MonitorDeleteResponseEnvelopeErrors) UnmarshalJSON

func (r *MonitorDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type MonitorDeleteResponseEnvelopeMessages

type MonitorDeleteResponseEnvelopeMessages struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    monitorDeleteResponseEnvelopeMessagesJSON `json:"-"`
}

func (*MonitorDeleteResponseEnvelopeMessages) UnmarshalJSON

func (r *MonitorDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type MonitorDeleteResponseEnvelopeSuccess

type MonitorDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	MonitorDeleteResponseEnvelopeSuccessTrue MonitorDeleteResponseEnvelopeSuccess = true
)

type MonitorEditParams

type MonitorEditParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// The expected HTTP response code or code range of the health check. This
	// parameter is only valid for HTTP and HTTPS monitors.
	ExpectedCodes param.Field[string] `json:"expected_codes,required"`
	// Do not validate the certificate when monitor use HTTPS. This parameter is
	// currently only valid for HTTP and HTTPS monitors.
	AllowInsecure param.Field[bool] `json:"allow_insecure"`
	// To be marked unhealthy the monitored origin must fail this healthcheck N
	// consecutive times.
	ConsecutiveDown param.Field[int64] `json:"consecutive_down"`
	// To be marked healthy the monitored origin must pass this healthcheck N
	// consecutive times.
	ConsecutiveUp param.Field[int64] `json:"consecutive_up"`
	// Object description.
	Description param.Field[string] `json:"description"`
	// A case-insensitive sub-string to look for in the response body. If this string
	// is not found, the origin will be marked as unhealthy. This parameter is only
	// valid for HTTP and HTTPS monitors.
	ExpectedBody param.Field[string] `json:"expected_body"`
	// Follow redirects if returned by the origin. This parameter is only valid for
	// HTTP and HTTPS monitors.
	FollowRedirects param.Field[bool] `json:"follow_redirects"`
	// The HTTP request headers to send in the health check. It is recommended you set
	// a Host header by default. The User-Agent header cannot be overridden. This
	// parameter is only valid for HTTP and HTTPS monitors.
	Header param.Field[interface{}] `json:"header"`
	// The interval between each health check. Shorter intervals may improve failover
	// time, but will increase load on the origins as we check from multiple locations.
	Interval param.Field[int64] `json:"interval"`
	// The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
	// based checks and 'connection_established' for TCP based health checks.
	Method param.Field[string] `json:"method"`
	// The endpoint path you want to conduct a health check against. This parameter is
	// only valid for HTTP and HTTPS monitors.
	Path param.Field[string] `json:"path"`
	// The port number to connect to for the health check. Required for TCP, UDP, and
	// SMTP checks. HTTP and HTTPS checks should only define the port when using a
	// non-standard port (HTTP: default 80, HTTPS: default 443).
	Port param.Field[int64] `json:"port"`
	// Assign this monitor to emulate the specified zone while probing. This parameter
	// is only valid for HTTP and HTTPS monitors.
	ProbeZone param.Field[string] `json:"probe_zone"`
	// The number of retries to attempt in case of a timeout before marking the origin
	// as unhealthy. Retries are attempted immediately.
	Retries param.Field[int64] `json:"retries"`
	// The timeout (in seconds) before marking the health check as failed.
	Timeout param.Field[int64] `json:"timeout"`
	// The protocol to use for the health check. Currently supported protocols are
	// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
	Type param.Field[MonitorEditParamsType] `json:"type"`
}

func (MonitorEditParams) MarshalJSON

func (r MonitorEditParams) MarshalJSON() (data []byte, err error)

type MonitorEditParamsType

type MonitorEditParamsType string

The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.

const (
	MonitorEditParamsTypeHTTP     MonitorEditParamsType = "http"
	MonitorEditParamsTypeHTTPS    MonitorEditParamsType = "https"
	MonitorEditParamsTypeTcp      MonitorEditParamsType = "tcp"
	MonitorEditParamsTypeUdpIcmp  MonitorEditParamsType = "udp_icmp"
	MonitorEditParamsTypeIcmpPing MonitorEditParamsType = "icmp_ping"
	MonitorEditParamsTypeSmtp     MonitorEditParamsType = "smtp"
)

type MonitorEditResponseEnvelope

type MonitorEditResponseEnvelope struct {
	Errors   []MonitorEditResponseEnvelopeErrors   `json:"errors,required"`
	Messages []MonitorEditResponseEnvelopeMessages `json:"messages,required"`
	Result   user.LoadBalancingMonitor             `json:"result,required"`
	// Whether the API call was successful
	Success MonitorEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    monitorEditResponseEnvelopeJSON    `json:"-"`
}

func (*MonitorEditResponseEnvelope) UnmarshalJSON

func (r *MonitorEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type MonitorEditResponseEnvelopeErrors

type MonitorEditResponseEnvelopeErrors struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    monitorEditResponseEnvelopeErrorsJSON `json:"-"`
}

func (*MonitorEditResponseEnvelopeErrors) UnmarshalJSON

func (r *MonitorEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type MonitorEditResponseEnvelopeMessages

type MonitorEditResponseEnvelopeMessages struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    monitorEditResponseEnvelopeMessagesJSON `json:"-"`
}

func (*MonitorEditResponseEnvelopeMessages) UnmarshalJSON

func (r *MonitorEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type MonitorEditResponseEnvelopeSuccess

type MonitorEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	MonitorEditResponseEnvelopeSuccessTrue MonitorEditResponseEnvelopeSuccess = true
)

type MonitorGetParams

type MonitorGetParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type MonitorGetResponseEnvelope

type MonitorGetResponseEnvelope struct {
	Errors   []MonitorGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []MonitorGetResponseEnvelopeMessages `json:"messages,required"`
	Result   user.LoadBalancingMonitor            `json:"result,required"`
	// Whether the API call was successful
	Success MonitorGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    monitorGetResponseEnvelopeJSON    `json:"-"`
}

func (*MonitorGetResponseEnvelope) UnmarshalJSON

func (r *MonitorGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type MonitorGetResponseEnvelopeErrors

type MonitorGetResponseEnvelopeErrors struct {
	Code    int64                                `json:"code,required"`
	Message string                               `json:"message,required"`
	JSON    monitorGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*MonitorGetResponseEnvelopeErrors) UnmarshalJSON

func (r *MonitorGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type MonitorGetResponseEnvelopeMessages

type MonitorGetResponseEnvelopeMessages struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    monitorGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*MonitorGetResponseEnvelopeMessages) UnmarshalJSON

func (r *MonitorGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type MonitorGetResponseEnvelopeSuccess

type MonitorGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	MonitorGetResponseEnvelopeSuccessTrue MonitorGetResponseEnvelopeSuccess = true
)

type MonitorListParams

type MonitorListParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type MonitorListResponseEnvelope

type MonitorListResponseEnvelope struct {
	Errors   []MonitorListResponseEnvelopeErrors   `json:"errors,required"`
	Messages []MonitorListResponseEnvelopeMessages `json:"messages,required"`
	Result   []user.LoadBalancingMonitor           `json:"result,required,nullable"`
	// Whether the API call was successful
	Success    MonitorListResponseEnvelopeSuccess    `json:"success,required"`
	ResultInfo MonitorListResponseEnvelopeResultInfo `json:"result_info"`
	JSON       monitorListResponseEnvelopeJSON       `json:"-"`
}

func (*MonitorListResponseEnvelope) UnmarshalJSON

func (r *MonitorListResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type MonitorListResponseEnvelopeErrors

type MonitorListResponseEnvelopeErrors struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    monitorListResponseEnvelopeErrorsJSON `json:"-"`
}

func (*MonitorListResponseEnvelopeErrors) UnmarshalJSON

func (r *MonitorListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type MonitorListResponseEnvelopeMessages

type MonitorListResponseEnvelopeMessages struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    monitorListResponseEnvelopeMessagesJSON `json:"-"`
}

func (*MonitorListResponseEnvelopeMessages) UnmarshalJSON

func (r *MonitorListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type MonitorListResponseEnvelopeResultInfo

type MonitorListResponseEnvelopeResultInfo struct {
	// Total number of results for the requested service
	Count float64 `json:"count"`
	// Current page within paginated list of results
	Page float64 `json:"page"`
	// Number of results per page of results
	PerPage float64 `json:"per_page"`
	// Total results available without any search parameters
	TotalCount float64                                   `json:"total_count"`
	JSON       monitorListResponseEnvelopeResultInfoJSON `json:"-"`
}

func (*MonitorListResponseEnvelopeResultInfo) UnmarshalJSON

func (r *MonitorListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)

type MonitorListResponseEnvelopeSuccess

type MonitorListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	MonitorListResponseEnvelopeSuccessTrue MonitorListResponseEnvelopeSuccess = true
)

type MonitorNewParams

type MonitorNewParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// The expected HTTP response code or code range of the health check. This
	// parameter is only valid for HTTP and HTTPS monitors.
	ExpectedCodes param.Field[string] `json:"expected_codes,required"`
	// Do not validate the certificate when monitor use HTTPS. This parameter is
	// currently only valid for HTTP and HTTPS monitors.
	AllowInsecure param.Field[bool] `json:"allow_insecure"`
	// To be marked unhealthy the monitored origin must fail this healthcheck N
	// consecutive times.
	ConsecutiveDown param.Field[int64] `json:"consecutive_down"`
	// To be marked healthy the monitored origin must pass this healthcheck N
	// consecutive times.
	ConsecutiveUp param.Field[int64] `json:"consecutive_up"`
	// Object description.
	Description param.Field[string] `json:"description"`
	// A case-insensitive sub-string to look for in the response body. If this string
	// is not found, the origin will be marked as unhealthy. This parameter is only
	// valid for HTTP and HTTPS monitors.
	ExpectedBody param.Field[string] `json:"expected_body"`
	// Follow redirects if returned by the origin. This parameter is only valid for
	// HTTP and HTTPS monitors.
	FollowRedirects param.Field[bool] `json:"follow_redirects"`
	// The HTTP request headers to send in the health check. It is recommended you set
	// a Host header by default. The User-Agent header cannot be overridden. This
	// parameter is only valid for HTTP and HTTPS monitors.
	Header param.Field[interface{}] `json:"header"`
	// The interval between each health check. Shorter intervals may improve failover
	// time, but will increase load on the origins as we check from multiple locations.
	Interval param.Field[int64] `json:"interval"`
	// The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
	// based checks and 'connection_established' for TCP based health checks.
	Method param.Field[string] `json:"method"`
	// The endpoint path you want to conduct a health check against. This parameter is
	// only valid for HTTP and HTTPS monitors.
	Path param.Field[string] `json:"path"`
	// The port number to connect to for the health check. Required for TCP, UDP, and
	// SMTP checks. HTTP and HTTPS checks should only define the port when using a
	// non-standard port (HTTP: default 80, HTTPS: default 443).
	Port param.Field[int64] `json:"port"`
	// Assign this monitor to emulate the specified zone while probing. This parameter
	// is only valid for HTTP and HTTPS monitors.
	ProbeZone param.Field[string] `json:"probe_zone"`
	// The number of retries to attempt in case of a timeout before marking the origin
	// as unhealthy. Retries are attempted immediately.
	Retries param.Field[int64] `json:"retries"`
	// The timeout (in seconds) before marking the health check as failed.
	Timeout param.Field[int64] `json:"timeout"`
	// The protocol to use for the health check. Currently supported protocols are
	// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
	Type param.Field[MonitorNewParamsType] `json:"type"`
}

func (MonitorNewParams) MarshalJSON

func (r MonitorNewParams) MarshalJSON() (data []byte, err error)

type MonitorNewParamsType

type MonitorNewParamsType string

The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.

const (
	MonitorNewParamsTypeHTTP     MonitorNewParamsType = "http"
	MonitorNewParamsTypeHTTPS    MonitorNewParamsType = "https"
	MonitorNewParamsTypeTcp      MonitorNewParamsType = "tcp"
	MonitorNewParamsTypeUdpIcmp  MonitorNewParamsType = "udp_icmp"
	MonitorNewParamsTypeIcmpPing MonitorNewParamsType = "icmp_ping"
	MonitorNewParamsTypeSmtp     MonitorNewParamsType = "smtp"
)

type MonitorNewResponseEnvelope

type MonitorNewResponseEnvelope struct {
	Errors   []MonitorNewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []MonitorNewResponseEnvelopeMessages `json:"messages,required"`
	Result   user.LoadBalancingMonitor            `json:"result,required"`
	// Whether the API call was successful
	Success MonitorNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    monitorNewResponseEnvelopeJSON    `json:"-"`
}

func (*MonitorNewResponseEnvelope) UnmarshalJSON

func (r *MonitorNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type MonitorNewResponseEnvelopeErrors

type MonitorNewResponseEnvelopeErrors struct {
	Code    int64                                `json:"code,required"`
	Message string                               `json:"message,required"`
	JSON    monitorNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*MonitorNewResponseEnvelopeErrors) UnmarshalJSON

func (r *MonitorNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type MonitorNewResponseEnvelopeMessages

type MonitorNewResponseEnvelopeMessages struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    monitorNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*MonitorNewResponseEnvelopeMessages) UnmarshalJSON

func (r *MonitorNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type MonitorNewResponseEnvelopeSuccess

type MonitorNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	MonitorNewResponseEnvelopeSuccessTrue MonitorNewResponseEnvelopeSuccess = true
)

type MonitorPreviewNewParams

type MonitorPreviewNewParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// The expected HTTP response code or code range of the health check. This
	// parameter is only valid for HTTP and HTTPS monitors.
	ExpectedCodes param.Field[string] `json:"expected_codes,required"`
	// Do not validate the certificate when monitor use HTTPS. This parameter is
	// currently only valid for HTTP and HTTPS monitors.
	AllowInsecure param.Field[bool] `json:"allow_insecure"`
	// To be marked unhealthy the monitored origin must fail this healthcheck N
	// consecutive times.
	ConsecutiveDown param.Field[int64] `json:"consecutive_down"`
	// To be marked healthy the monitored origin must pass this healthcheck N
	// consecutive times.
	ConsecutiveUp param.Field[int64] `json:"consecutive_up"`
	// Object description.
	Description param.Field[string] `json:"description"`
	// A case-insensitive sub-string to look for in the response body. If this string
	// is not found, the origin will be marked as unhealthy. This parameter is only
	// valid for HTTP and HTTPS monitors.
	ExpectedBody param.Field[string] `json:"expected_body"`
	// Follow redirects if returned by the origin. This parameter is only valid for
	// HTTP and HTTPS monitors.
	FollowRedirects param.Field[bool] `json:"follow_redirects"`
	// The HTTP request headers to send in the health check. It is recommended you set
	// a Host header by default. The User-Agent header cannot be overridden. This
	// parameter is only valid for HTTP and HTTPS monitors.
	Header param.Field[interface{}] `json:"header"`
	// The interval between each health check. Shorter intervals may improve failover
	// time, but will increase load on the origins as we check from multiple locations.
	Interval param.Field[int64] `json:"interval"`
	// The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
	// based checks and 'connection_established' for TCP based health checks.
	Method param.Field[string] `json:"method"`
	// The endpoint path you want to conduct a health check against. This parameter is
	// only valid for HTTP and HTTPS monitors.
	Path param.Field[string] `json:"path"`
	// The port number to connect to for the health check. Required for TCP, UDP, and
	// SMTP checks. HTTP and HTTPS checks should only define the port when using a
	// non-standard port (HTTP: default 80, HTTPS: default 443).
	Port param.Field[int64] `json:"port"`
	// Assign this monitor to emulate the specified zone while probing. This parameter
	// is only valid for HTTP and HTTPS monitors.
	ProbeZone param.Field[string] `json:"probe_zone"`
	// The number of retries to attempt in case of a timeout before marking the origin
	// as unhealthy. Retries are attempted immediately.
	Retries param.Field[int64] `json:"retries"`
	// The timeout (in seconds) before marking the health check as failed.
	Timeout param.Field[int64] `json:"timeout"`
	// The protocol to use for the health check. Currently supported protocols are
	// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
	Type param.Field[MonitorPreviewNewParamsType] `json:"type"`
}

func (MonitorPreviewNewParams) MarshalJSON

func (r MonitorPreviewNewParams) MarshalJSON() (data []byte, err error)

type MonitorPreviewNewParamsType

type MonitorPreviewNewParamsType string

The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.

const (
	MonitorPreviewNewParamsTypeHTTP     MonitorPreviewNewParamsType = "http"
	MonitorPreviewNewParamsTypeHTTPS    MonitorPreviewNewParamsType = "https"
	MonitorPreviewNewParamsTypeTcp      MonitorPreviewNewParamsType = "tcp"
	MonitorPreviewNewParamsTypeUdpIcmp  MonitorPreviewNewParamsType = "udp_icmp"
	MonitorPreviewNewParamsTypeIcmpPing MonitorPreviewNewParamsType = "icmp_ping"
	MonitorPreviewNewParamsTypeSmtp     MonitorPreviewNewParamsType = "smtp"
)

type MonitorPreviewNewResponse

type MonitorPreviewNewResponse struct {
	// Monitored pool IDs mapped to their respective names.
	Pools     map[string]string             `json:"pools"`
	PreviewID string                        `json:"preview_id"`
	JSON      monitorPreviewNewResponseJSON `json:"-"`
}

func (*MonitorPreviewNewResponse) UnmarshalJSON

func (r *MonitorPreviewNewResponse) UnmarshalJSON(data []byte) (err error)

type MonitorPreviewNewResponseEnvelope

type MonitorPreviewNewResponseEnvelope struct {
	Errors   []MonitorPreviewNewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []MonitorPreviewNewResponseEnvelopeMessages `json:"messages,required"`
	Result   MonitorPreviewNewResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success MonitorPreviewNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    monitorPreviewNewResponseEnvelopeJSON    `json:"-"`
}

func (*MonitorPreviewNewResponseEnvelope) UnmarshalJSON

func (r *MonitorPreviewNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type MonitorPreviewNewResponseEnvelopeErrors

type MonitorPreviewNewResponseEnvelopeErrors struct {
	Code    int64                                       `json:"code,required"`
	Message string                                      `json:"message,required"`
	JSON    monitorPreviewNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*MonitorPreviewNewResponseEnvelopeErrors) UnmarshalJSON

func (r *MonitorPreviewNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type MonitorPreviewNewResponseEnvelopeMessages

type MonitorPreviewNewResponseEnvelopeMessages struct {
	Code    int64                                         `json:"code,required"`
	Message string                                        `json:"message,required"`
	JSON    monitorPreviewNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*MonitorPreviewNewResponseEnvelopeMessages) UnmarshalJSON

func (r *MonitorPreviewNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type MonitorPreviewNewResponseEnvelopeSuccess

type MonitorPreviewNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	MonitorPreviewNewResponseEnvelopeSuccessTrue MonitorPreviewNewResponseEnvelopeSuccess = true
)

type MonitorPreviewService

type MonitorPreviewService struct {
	Options []option.RequestOption
}

MonitorPreviewService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMonitorPreviewService method instead.

func NewMonitorPreviewService

func NewMonitorPreviewService(opts ...option.RequestOption) (r *MonitorPreviewService)

NewMonitorPreviewService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*MonitorPreviewService) New

Preview pools using the specified monitor with provided monitor details. The returned preview_id can be used in the preview endpoint to retrieve the results.

type MonitorReferenceGetParams

type MonitorReferenceGetParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type MonitorReferenceGetResponse

type MonitorReferenceGetResponse struct {
	ReferenceType MonitorReferenceGetResponseReferenceType `json:"reference_type"`
	ResourceID    string                                   `json:"resource_id"`
	ResourceName  string                                   `json:"resource_name"`
	ResourceType  string                                   `json:"resource_type"`
	JSON          monitorReferenceGetResponseJSON          `json:"-"`
}

func (*MonitorReferenceGetResponse) UnmarshalJSON

func (r *MonitorReferenceGetResponse) UnmarshalJSON(data []byte) (err error)

type MonitorReferenceGetResponseEnvelope

type MonitorReferenceGetResponseEnvelope struct {
	Errors   []MonitorReferenceGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []MonitorReferenceGetResponseEnvelopeMessages `json:"messages,required"`
	// List of resources that reference a given monitor.
	Result []MonitorReferenceGetResponse `json:"result,required,nullable"`
	// Whether the API call was successful
	Success    MonitorReferenceGetResponseEnvelopeSuccess    `json:"success,required"`
	ResultInfo MonitorReferenceGetResponseEnvelopeResultInfo `json:"result_info"`
	JSON       monitorReferenceGetResponseEnvelopeJSON       `json:"-"`
}

func (*MonitorReferenceGetResponseEnvelope) UnmarshalJSON

func (r *MonitorReferenceGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type MonitorReferenceGetResponseEnvelopeErrors

type MonitorReferenceGetResponseEnvelopeErrors struct {
	Code    int64                                         `json:"code,required"`
	Message string                                        `json:"message,required"`
	JSON    monitorReferenceGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*MonitorReferenceGetResponseEnvelopeErrors) UnmarshalJSON

func (r *MonitorReferenceGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type MonitorReferenceGetResponseEnvelopeMessages

type MonitorReferenceGetResponseEnvelopeMessages struct {
	Code    int64                                           `json:"code,required"`
	Message string                                          `json:"message,required"`
	JSON    monitorReferenceGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*MonitorReferenceGetResponseEnvelopeMessages) UnmarshalJSON

func (r *MonitorReferenceGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type MonitorReferenceGetResponseEnvelopeResultInfo

type MonitorReferenceGetResponseEnvelopeResultInfo struct {
	// Total number of results for the requested service
	Count float64 `json:"count"`
	// Current page within paginated list of results
	Page float64 `json:"page"`
	// Number of results per page of results
	PerPage float64 `json:"per_page"`
	// Total results available without any search parameters
	TotalCount float64                                           `json:"total_count"`
	JSON       monitorReferenceGetResponseEnvelopeResultInfoJSON `json:"-"`
}

func (*MonitorReferenceGetResponseEnvelopeResultInfo) UnmarshalJSON

func (r *MonitorReferenceGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)

type MonitorReferenceGetResponseEnvelopeSuccess

type MonitorReferenceGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	MonitorReferenceGetResponseEnvelopeSuccessTrue MonitorReferenceGetResponseEnvelopeSuccess = true
)

type MonitorReferenceGetResponseReferenceType

type MonitorReferenceGetResponseReferenceType string
const (
	MonitorReferenceGetResponseReferenceTypeStar     MonitorReferenceGetResponseReferenceType = "*"
	MonitorReferenceGetResponseReferenceTypeReferral MonitorReferenceGetResponseReferenceType = "referral"
	MonitorReferenceGetResponseReferenceTypeReferrer MonitorReferenceGetResponseReferenceType = "referrer"
)

type MonitorReferenceService

type MonitorReferenceService struct {
	Options []option.RequestOption
}

MonitorReferenceService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMonitorReferenceService method instead.

func NewMonitorReferenceService

func NewMonitorReferenceService(opts ...option.RequestOption) (r *MonitorReferenceService)

NewMonitorReferenceService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*MonitorReferenceService) Get

Get the list of resources that reference the provided monitor.

type MonitorService

type MonitorService struct {
	Options    []option.RequestOption
	Previews   *MonitorPreviewService
	References *MonitorReferenceService
}

MonitorService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMonitorService method instead.

func NewMonitorService

func NewMonitorService(opts ...option.RequestOption) (r *MonitorService)

NewMonitorService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*MonitorService) Delete

func (r *MonitorService) Delete(ctx context.Context, monitorID string, body MonitorDeleteParams, opts ...option.RequestOption) (res *MonitorDeleteResponse, err error)

Delete a configured monitor.

func (*MonitorService) Edit

func (r *MonitorService) Edit(ctx context.Context, monitorID string, params MonitorEditParams, opts ...option.RequestOption) (res *user.LoadBalancingMonitor, err error)

Apply changes to an existing monitor, overwriting the supplied properties.

func (*MonitorService) Get

func (r *MonitorService) Get(ctx context.Context, monitorID string, query MonitorGetParams, opts ...option.RequestOption) (res *user.LoadBalancingMonitor, err error)

List a single configured monitor for an account.

func (*MonitorService) List

List configured monitors for an account.

func (*MonitorService) New

Create a configured monitor.

func (*MonitorService) Update

func (r *MonitorService) Update(ctx context.Context, monitorID string, params MonitorUpdateParams, opts ...option.RequestOption) (res *user.LoadBalancingMonitor, err error)

Modify a configured monitor.

type MonitorUpdateParams

type MonitorUpdateParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// The expected HTTP response code or code range of the health check. This
	// parameter is only valid for HTTP and HTTPS monitors.
	ExpectedCodes param.Field[string] `json:"expected_codes,required"`
	// Do not validate the certificate when monitor use HTTPS. This parameter is
	// currently only valid for HTTP and HTTPS monitors.
	AllowInsecure param.Field[bool] `json:"allow_insecure"`
	// To be marked unhealthy the monitored origin must fail this healthcheck N
	// consecutive times.
	ConsecutiveDown param.Field[int64] `json:"consecutive_down"`
	// To be marked healthy the monitored origin must pass this healthcheck N
	// consecutive times.
	ConsecutiveUp param.Field[int64] `json:"consecutive_up"`
	// Object description.
	Description param.Field[string] `json:"description"`
	// A case-insensitive sub-string to look for in the response body. If this string
	// is not found, the origin will be marked as unhealthy. This parameter is only
	// valid for HTTP and HTTPS monitors.
	ExpectedBody param.Field[string] `json:"expected_body"`
	// Follow redirects if returned by the origin. This parameter is only valid for
	// HTTP and HTTPS monitors.
	FollowRedirects param.Field[bool] `json:"follow_redirects"`
	// The HTTP request headers to send in the health check. It is recommended you set
	// a Host header by default. The User-Agent header cannot be overridden. This
	// parameter is only valid for HTTP and HTTPS monitors.
	Header param.Field[interface{}] `json:"header"`
	// The interval between each health check. Shorter intervals may improve failover
	// time, but will increase load on the origins as we check from multiple locations.
	Interval param.Field[int64] `json:"interval"`
	// The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
	// based checks and 'connection_established' for TCP based health checks.
	Method param.Field[string] `json:"method"`
	// The endpoint path you want to conduct a health check against. This parameter is
	// only valid for HTTP and HTTPS monitors.
	Path param.Field[string] `json:"path"`
	// The port number to connect to for the health check. Required for TCP, UDP, and
	// SMTP checks. HTTP and HTTPS checks should only define the port when using a
	// non-standard port (HTTP: default 80, HTTPS: default 443).
	Port param.Field[int64] `json:"port"`
	// Assign this monitor to emulate the specified zone while probing. This parameter
	// is only valid for HTTP and HTTPS monitors.
	ProbeZone param.Field[string] `json:"probe_zone"`
	// The number of retries to attempt in case of a timeout before marking the origin
	// as unhealthy. Retries are attempted immediately.
	Retries param.Field[int64] `json:"retries"`
	// The timeout (in seconds) before marking the health check as failed.
	Timeout param.Field[int64] `json:"timeout"`
	// The protocol to use for the health check. Currently supported protocols are
	// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
	Type param.Field[MonitorUpdateParamsType] `json:"type"`
}

func (MonitorUpdateParams) MarshalJSON

func (r MonitorUpdateParams) MarshalJSON() (data []byte, err error)

type MonitorUpdateParamsType

type MonitorUpdateParamsType string

The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.

const (
	MonitorUpdateParamsTypeHTTP     MonitorUpdateParamsType = "http"
	MonitorUpdateParamsTypeHTTPS    MonitorUpdateParamsType = "https"
	MonitorUpdateParamsTypeTcp      MonitorUpdateParamsType = "tcp"
	MonitorUpdateParamsTypeUdpIcmp  MonitorUpdateParamsType = "udp_icmp"
	MonitorUpdateParamsTypeIcmpPing MonitorUpdateParamsType = "icmp_ping"
	MonitorUpdateParamsTypeSmtp     MonitorUpdateParamsType = "smtp"
)

type MonitorUpdateResponseEnvelope

type MonitorUpdateResponseEnvelope struct {
	Errors   []MonitorUpdateResponseEnvelopeErrors   `json:"errors,required"`
	Messages []MonitorUpdateResponseEnvelopeMessages `json:"messages,required"`
	Result   user.LoadBalancingMonitor               `json:"result,required"`
	// Whether the API call was successful
	Success MonitorUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    monitorUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*MonitorUpdateResponseEnvelope) UnmarshalJSON

func (r *MonitorUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type MonitorUpdateResponseEnvelopeErrors

type MonitorUpdateResponseEnvelopeErrors struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    monitorUpdateResponseEnvelopeErrorsJSON `json:"-"`
}

func (*MonitorUpdateResponseEnvelopeErrors) UnmarshalJSON

func (r *MonitorUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type MonitorUpdateResponseEnvelopeMessages

type MonitorUpdateResponseEnvelopeMessages struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    monitorUpdateResponseEnvelopeMessagesJSON `json:"-"`
}

func (*MonitorUpdateResponseEnvelopeMessages) UnmarshalJSON

func (r *MonitorUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type MonitorUpdateResponseEnvelopeSuccess

type MonitorUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	MonitorUpdateResponseEnvelopeSuccessTrue MonitorUpdateResponseEnvelopeSuccess = true
)

type PoolDeleteParams

type PoolDeleteParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type PoolDeleteResponse

type PoolDeleteResponse struct {
	ID   string                 `json:"id"`
	JSON poolDeleteResponseJSON `json:"-"`
}

func (*PoolDeleteResponse) UnmarshalJSON

func (r *PoolDeleteResponse) UnmarshalJSON(data []byte) (err error)

type PoolDeleteResponseEnvelope

type PoolDeleteResponseEnvelope struct {
	Errors   []PoolDeleteResponseEnvelopeErrors   `json:"errors,required"`
	Messages []PoolDeleteResponseEnvelopeMessages `json:"messages,required"`
	Result   PoolDeleteResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success PoolDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    poolDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*PoolDeleteResponseEnvelope) UnmarshalJSON

func (r *PoolDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type PoolDeleteResponseEnvelopeErrors

type PoolDeleteResponseEnvelopeErrors struct {
	Code    int64                                `json:"code,required"`
	Message string                               `json:"message,required"`
	JSON    poolDeleteResponseEnvelopeErrorsJSON `json:"-"`
}

func (*PoolDeleteResponseEnvelopeErrors) UnmarshalJSON

func (r *PoolDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type PoolDeleteResponseEnvelopeMessages

type PoolDeleteResponseEnvelopeMessages struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    poolDeleteResponseEnvelopeMessagesJSON `json:"-"`
}

func (*PoolDeleteResponseEnvelopeMessages) UnmarshalJSON

func (r *PoolDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type PoolDeleteResponseEnvelopeSuccess

type PoolDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PoolDeleteResponseEnvelopeSuccessTrue PoolDeleteResponseEnvelopeSuccess = true
)

type PoolEditParams

type PoolEditParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// A list of regions from which to run health checks. Null means every Cloudflare
	// data center.
	CheckRegions param.Field[[]PoolEditParamsCheckRegion] `json:"check_regions"`
	// A human-readable description of the pool.
	Description param.Field[string] `json:"description"`
	// Whether to enable (the default) or disable this pool. Disabled pools will not
	// receive traffic and are excluded from health checks. Disabling a pool will cause
	// any load balancers using it to failover to the next pool (if any).
	Enabled param.Field[bool] `json:"enabled"`
	// The latitude of the data center containing the origins used in this pool in
	// decimal degrees. If this is set, longitude must also be set.
	Latitude param.Field[float64] `json:"latitude"`
	// Configures load shedding policies and percentages for the pool.
	LoadShedding param.Field[PoolEditParamsLoadShedding] `json:"load_shedding"`
	// The longitude of the data center containing the origins used in this pool in
	// decimal degrees. If this is set, latitude must also be set.
	Longitude param.Field[float64] `json:"longitude"`
	// The minimum number of origins that must be healthy for this pool to serve
	// traffic. If the number of healthy origins falls below this number, the pool will
	// be marked unhealthy and will failover to the next available pool.
	MinimumOrigins param.Field[int64] `json:"minimum_origins"`
	// The ID of the Monitor to use for checking the health of origins within this
	// pool.
	Monitor param.Field[interface{}] `json:"monitor"`
	// A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
	// underscores are allowed.
	Name param.Field[string] `json:"name"`
	// This field is now deprecated. It has been moved to Cloudflare's Centralized
	// Notification service
	// https://developers.cloudflare.com/fundamentals/notifications/. The email address
	// to send health status notifications to. This can be an individual mailbox or a
	// mailing list. Multiple emails can be supplied as a comma delimited list.
	NotificationEmail param.Field[string] `json:"notification_email"`
	// Filter pool and origin health notifications by resource type or health status.
	// Use null to reset.
	NotificationFilter param.Field[PoolEditParamsNotificationFilter] `json:"notification_filter"`
	// Configures origin steering for the pool. Controls how origins are selected for
	// new sessions and traffic without session affinity.
	OriginSteering param.Field[PoolEditParamsOriginSteering] `json:"origin_steering"`
	// The list of origins within this pool. Traffic directed at this pool is balanced
	// across all currently healthy origins, provided the pool itself is healthy.
	Origins param.Field[[]PoolEditParamsOrigin] `json:"origins"`
}

func (PoolEditParams) MarshalJSON

func (r PoolEditParams) MarshalJSON() (data []byte, err error)

type PoolEditParamsCheckRegion

type PoolEditParamsCheckRegion string

WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe, EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America, OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS: Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (ENTERPRISE customers only).

const (
	PoolEditParamsCheckRegionWnam       PoolEditParamsCheckRegion = "WNAM"
	PoolEditParamsCheckRegionEnam       PoolEditParamsCheckRegion = "ENAM"
	PoolEditParamsCheckRegionWeu        PoolEditParamsCheckRegion = "WEU"
	PoolEditParamsCheckRegionEeu        PoolEditParamsCheckRegion = "EEU"
	PoolEditParamsCheckRegionNsam       PoolEditParamsCheckRegion = "NSAM"
	PoolEditParamsCheckRegionSsam       PoolEditParamsCheckRegion = "SSAM"
	PoolEditParamsCheckRegionOc         PoolEditParamsCheckRegion = "OC"
	PoolEditParamsCheckRegionMe         PoolEditParamsCheckRegion = "ME"
	PoolEditParamsCheckRegionNaf        PoolEditParamsCheckRegion = "NAF"
	PoolEditParamsCheckRegionSaf        PoolEditParamsCheckRegion = "SAF"
	PoolEditParamsCheckRegionSas        PoolEditParamsCheckRegion = "SAS"
	PoolEditParamsCheckRegionSeas       PoolEditParamsCheckRegion = "SEAS"
	PoolEditParamsCheckRegionNeas       PoolEditParamsCheckRegion = "NEAS"
	PoolEditParamsCheckRegionAllRegions PoolEditParamsCheckRegion = "ALL_REGIONS"
)

type PoolEditParamsLoadShedding

type PoolEditParamsLoadShedding struct {
	// The percent of traffic to shed from the pool, according to the default policy.
	// Applies to new sessions and traffic without session affinity.
	DefaultPercent param.Field[float64] `json:"default_percent"`
	// The default policy to use when load shedding. A random policy randomly sheds a
	// given percent of requests. A hash policy computes a hash over the
	// CF-Connecting-IP address and sheds all requests originating from a percent of
	// IPs.
	DefaultPolicy param.Field[PoolEditParamsLoadSheddingDefaultPolicy] `json:"default_policy"`
	// The percent of existing sessions to shed from the pool, according to the session
	// policy.
	SessionPercent param.Field[float64] `json:"session_percent"`
	// Only the hash policy is supported for existing sessions (to avoid exponential
	// decay).
	SessionPolicy param.Field[PoolEditParamsLoadSheddingSessionPolicy] `json:"session_policy"`
}

Configures load shedding policies and percentages for the pool.

func (PoolEditParamsLoadShedding) MarshalJSON

func (r PoolEditParamsLoadShedding) MarshalJSON() (data []byte, err error)

type PoolEditParamsLoadSheddingDefaultPolicy

type PoolEditParamsLoadSheddingDefaultPolicy string

The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.

const (
	PoolEditParamsLoadSheddingDefaultPolicyRandom PoolEditParamsLoadSheddingDefaultPolicy = "random"
	PoolEditParamsLoadSheddingDefaultPolicyHash   PoolEditParamsLoadSheddingDefaultPolicy = "hash"
)

type PoolEditParamsLoadSheddingSessionPolicy

type PoolEditParamsLoadSheddingSessionPolicy string

Only the hash policy is supported for existing sessions (to avoid exponential decay).

const (
	PoolEditParamsLoadSheddingSessionPolicyHash PoolEditParamsLoadSheddingSessionPolicy = "hash"
)

type PoolEditParamsNotificationFilter

type PoolEditParamsNotificationFilter struct {
	// Filter options for a particular resource type (pool or origin). Use null to
	// reset.
	Origin param.Field[PoolEditParamsNotificationFilterOrigin] `json:"origin"`
	// Filter options for a particular resource type (pool or origin). Use null to
	// reset.
	Pool param.Field[PoolEditParamsNotificationFilterPool] `json:"pool"`
}

Filter pool and origin health notifications by resource type or health status. Use null to reset.

func (PoolEditParamsNotificationFilter) MarshalJSON

func (r PoolEditParamsNotificationFilter) MarshalJSON() (data []byte, err error)

type PoolEditParamsNotificationFilterOrigin

type PoolEditParamsNotificationFilterOrigin struct {
	// If set true, disable notifications for this type of resource (pool or origin).
	Disable param.Field[bool] `json:"disable"`
	// If present, send notifications only for this health status (e.g. false for only
	// DOWN events). Use null to reset (all events).
	Healthy param.Field[bool] `json:"healthy"`
}

Filter options for a particular resource type (pool or origin). Use null to reset.

func (PoolEditParamsNotificationFilterOrigin) MarshalJSON

func (r PoolEditParamsNotificationFilterOrigin) MarshalJSON() (data []byte, err error)

type PoolEditParamsNotificationFilterPool

type PoolEditParamsNotificationFilterPool struct {
	// If set true, disable notifications for this type of resource (pool or origin).
	Disable param.Field[bool] `json:"disable"`
	// If present, send notifications only for this health status (e.g. false for only
	// DOWN events). Use null to reset (all events).
	Healthy param.Field[bool] `json:"healthy"`
}

Filter options for a particular resource type (pool or origin). Use null to reset.

func (PoolEditParamsNotificationFilterPool) MarshalJSON

func (r PoolEditParamsNotificationFilterPool) MarshalJSON() (data []byte, err error)

type PoolEditParamsOrigin

type PoolEditParamsOrigin struct {
	// The IP address (IPv4 or IPv6) of the origin, or its publicly addressable
	// hostname. Hostnames entered here should resolve directly to the origin, and not
	// be a hostname proxied by Cloudflare. To set an internal/reserved address,
	// virtual_network_id must also be set.
	Address param.Field[string] `json:"address"`
	// Whether to enable (the default) this origin within the pool. Disabled origins
	// will not receive traffic and are excluded from health checks. The origin will
	// only be disabled for the current pool.
	Enabled param.Field[bool] `json:"enabled"`
	// The request header is used to pass additional information with an HTTP request.
	// Currently supported header is 'Host'.
	Header param.Field[PoolEditParamsOriginsHeader] `json:"header"`
	// A human-identifiable name for the origin.
	Name param.Field[string] `json:"name"`
	// The virtual network subnet ID the origin belongs in. Virtual network must also
	// belong to the account.
	VirtualNetworkID param.Field[string] `json:"virtual_network_id"`
	// The weight of this origin relative to other origins in the pool. Based on the
	// configured weight the total traffic is distributed among origins within the
	// pool.
	//
	//   - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the
	//     origin's outstanding requests.
	//   - `origin_steering.policy="least_connections"`: Use weight to scale the origin's
	//     open connections.
	Weight param.Field[float64] `json:"weight"`
}

func (PoolEditParamsOrigin) MarshalJSON

func (r PoolEditParamsOrigin) MarshalJSON() (data []byte, err error)

type PoolEditParamsOriginSteering

type PoolEditParamsOriginSteering struct {
	// The type of origin steering policy to use.
	//
	//   - `"random"`: Select an origin randomly.
	//   - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
	//     address.
	//   - `"least_outstanding_requests"`: Select an origin by taking into consideration
	//     origin weights, as well as each origin's number of outstanding requests.
	//     Origins with more pending requests are weighted proportionately less relative
	//     to others.
	//   - `"least_connections"`: Select an origin by taking into consideration origin
	//     weights, as well as each origin's number of open connections. Origins with
	//     more open connections are weighted proportionately less relative to others.
	//     Supported for HTTP/1 and HTTP/2 connections.
	Policy param.Field[PoolEditParamsOriginSteeringPolicy] `json:"policy"`
}

Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity.

func (PoolEditParamsOriginSteering) MarshalJSON

func (r PoolEditParamsOriginSteering) MarshalJSON() (data []byte, err error)

type PoolEditParamsOriginSteeringPolicy

type PoolEditParamsOriginSteeringPolicy string

The type of origin steering policy to use.

  • `"random"`: Select an origin randomly.
  • `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP address.
  • `"least_outstanding_requests"`: Select an origin by taking into consideration origin weights, as well as each origin's number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others.
  • `"least_connections"`: Select an origin by taking into consideration origin weights, as well as each origin's number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.
const (
	PoolEditParamsOriginSteeringPolicyRandom                   PoolEditParamsOriginSteeringPolicy = "random"
	PoolEditParamsOriginSteeringPolicyHash                     PoolEditParamsOriginSteeringPolicy = "hash"
	PoolEditParamsOriginSteeringPolicyLeastOutstandingRequests PoolEditParamsOriginSteeringPolicy = "least_outstanding_requests"
	PoolEditParamsOriginSteeringPolicyLeastConnections         PoolEditParamsOriginSteeringPolicy = "least_connections"
)

type PoolEditParamsOriginsHeader

type PoolEditParamsOriginsHeader struct {
	// The 'Host' header allows to override the hostname set in the HTTP request.
	// Current support is 1 'Host' header override per origin.
	Host param.Field[[]string] `json:"Host"`
}

The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'.

func (PoolEditParamsOriginsHeader) MarshalJSON

func (r PoolEditParamsOriginsHeader) MarshalJSON() (data []byte, err error)

type PoolEditResponseEnvelope

type PoolEditResponseEnvelope struct {
	Errors   []PoolEditResponseEnvelopeErrors   `json:"errors,required"`
	Messages []PoolEditResponseEnvelopeMessages `json:"messages,required"`
	Result   user.LoadBalancingPool             `json:"result,required"`
	// Whether the API call was successful
	Success PoolEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    poolEditResponseEnvelopeJSON    `json:"-"`
}

func (*PoolEditResponseEnvelope) UnmarshalJSON

func (r *PoolEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type PoolEditResponseEnvelopeErrors

type PoolEditResponseEnvelopeErrors struct {
	Code    int64                              `json:"code,required"`
	Message string                             `json:"message,required"`
	JSON    poolEditResponseEnvelopeErrorsJSON `json:"-"`
}

func (*PoolEditResponseEnvelopeErrors) UnmarshalJSON

func (r *PoolEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type PoolEditResponseEnvelopeMessages

type PoolEditResponseEnvelopeMessages struct {
	Code    int64                                `json:"code,required"`
	Message string                               `json:"message,required"`
	JSON    poolEditResponseEnvelopeMessagesJSON `json:"-"`
}

func (*PoolEditResponseEnvelopeMessages) UnmarshalJSON

func (r *PoolEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type PoolEditResponseEnvelopeSuccess

type PoolEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PoolEditResponseEnvelopeSuccessTrue PoolEditResponseEnvelopeSuccess = true
)

type PoolGetParams

type PoolGetParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type PoolGetResponseEnvelope

type PoolGetResponseEnvelope struct {
	Errors   []PoolGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []PoolGetResponseEnvelopeMessages `json:"messages,required"`
	Result   user.LoadBalancingPool            `json:"result,required"`
	// Whether the API call was successful
	Success PoolGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    poolGetResponseEnvelopeJSON    `json:"-"`
}

func (*PoolGetResponseEnvelope) UnmarshalJSON

func (r *PoolGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type PoolGetResponseEnvelopeErrors

type PoolGetResponseEnvelopeErrors struct {
	Code    int64                             `json:"code,required"`
	Message string                            `json:"message,required"`
	JSON    poolGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*PoolGetResponseEnvelopeErrors) UnmarshalJSON

func (r *PoolGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type PoolGetResponseEnvelopeMessages

type PoolGetResponseEnvelopeMessages struct {
	Code    int64                               `json:"code,required"`
	Message string                              `json:"message,required"`
	JSON    poolGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*PoolGetResponseEnvelopeMessages) UnmarshalJSON

func (r *PoolGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type PoolGetResponseEnvelopeSuccess

type PoolGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PoolGetResponseEnvelopeSuccessTrue PoolGetResponseEnvelopeSuccess = true
)

type PoolHealthGetParams

type PoolHealthGetParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type PoolHealthGetResponse

type PoolHealthGetResponse interface {
	ImplementsLoadBalancersPoolHealthGetResponse()
}

A list of regions from which to run health checks. Null means every Cloudflare data center.

Union satisfied by load_balancers.PoolHealthGetResponseUnknown or shared.UnionString.

type PoolHealthGetResponseEnvelope

type PoolHealthGetResponseEnvelope struct {
	Errors   []PoolHealthGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []PoolHealthGetResponseEnvelopeMessages `json:"messages,required"`
	// A list of regions from which to run health checks. Null means every Cloudflare
	// data center.
	Result PoolHealthGetResponse `json:"result,required"`
	// Whether the API call was successful
	Success PoolHealthGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    poolHealthGetResponseEnvelopeJSON    `json:"-"`
}

func (*PoolHealthGetResponseEnvelope) UnmarshalJSON

func (r *PoolHealthGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type PoolHealthGetResponseEnvelopeErrors

type PoolHealthGetResponseEnvelopeErrors struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    poolHealthGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*PoolHealthGetResponseEnvelopeErrors) UnmarshalJSON

func (r *PoolHealthGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type PoolHealthGetResponseEnvelopeMessages

type PoolHealthGetResponseEnvelopeMessages struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    poolHealthGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*PoolHealthGetResponseEnvelopeMessages) UnmarshalJSON

func (r *PoolHealthGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type PoolHealthGetResponseEnvelopeSuccess

type PoolHealthGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PoolHealthGetResponseEnvelopeSuccessTrue PoolHealthGetResponseEnvelopeSuccess = true
)

type PoolHealthNewParams

type PoolHealthNewParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// The expected HTTP response code or code range of the health check. This
	// parameter is only valid for HTTP and HTTPS monitors.
	ExpectedCodes param.Field[string] `json:"expected_codes,required"`
	// Do not validate the certificate when monitor use HTTPS. This parameter is
	// currently only valid for HTTP and HTTPS monitors.
	AllowInsecure param.Field[bool] `json:"allow_insecure"`
	// To be marked unhealthy the monitored origin must fail this healthcheck N
	// consecutive times.
	ConsecutiveDown param.Field[int64] `json:"consecutive_down"`
	// To be marked healthy the monitored origin must pass this healthcheck N
	// consecutive times.
	ConsecutiveUp param.Field[int64] `json:"consecutive_up"`
	// Object description.
	Description param.Field[string] `json:"description"`
	// A case-insensitive sub-string to look for in the response body. If this string
	// is not found, the origin will be marked as unhealthy. This parameter is only
	// valid for HTTP and HTTPS monitors.
	ExpectedBody param.Field[string] `json:"expected_body"`
	// Follow redirects if returned by the origin. This parameter is only valid for
	// HTTP and HTTPS monitors.
	FollowRedirects param.Field[bool] `json:"follow_redirects"`
	// The HTTP request headers to send in the health check. It is recommended you set
	// a Host header by default. The User-Agent header cannot be overridden. This
	// parameter is only valid for HTTP and HTTPS monitors.
	Header param.Field[interface{}] `json:"header"`
	// The interval between each health check. Shorter intervals may improve failover
	// time, but will increase load on the origins as we check from multiple locations.
	Interval param.Field[int64] `json:"interval"`
	// The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
	// based checks and 'connection_established' for TCP based health checks.
	Method param.Field[string] `json:"method"`
	// The endpoint path you want to conduct a health check against. This parameter is
	// only valid for HTTP and HTTPS monitors.
	Path param.Field[string] `json:"path"`
	// The port number to connect to for the health check. Required for TCP, UDP, and
	// SMTP checks. HTTP and HTTPS checks should only define the port when using a
	// non-standard port (HTTP: default 80, HTTPS: default 443).
	Port param.Field[int64] `json:"port"`
	// Assign this monitor to emulate the specified zone while probing. This parameter
	// is only valid for HTTP and HTTPS monitors.
	ProbeZone param.Field[string] `json:"probe_zone"`
	// The number of retries to attempt in case of a timeout before marking the origin
	// as unhealthy. Retries are attempted immediately.
	Retries param.Field[int64] `json:"retries"`
	// The timeout (in seconds) before marking the health check as failed.
	Timeout param.Field[int64] `json:"timeout"`
	// The protocol to use for the health check. Currently supported protocols are
	// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
	Type param.Field[PoolHealthNewParamsType] `json:"type"`
}

func (PoolHealthNewParams) MarshalJSON

func (r PoolHealthNewParams) MarshalJSON() (data []byte, err error)

type PoolHealthNewParamsType

type PoolHealthNewParamsType string

The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.

const (
	PoolHealthNewParamsTypeHTTP     PoolHealthNewParamsType = "http"
	PoolHealthNewParamsTypeHTTPS    PoolHealthNewParamsType = "https"
	PoolHealthNewParamsTypeTcp      PoolHealthNewParamsType = "tcp"
	PoolHealthNewParamsTypeUdpIcmp  PoolHealthNewParamsType = "udp_icmp"
	PoolHealthNewParamsTypeIcmpPing PoolHealthNewParamsType = "icmp_ping"
	PoolHealthNewParamsTypeSmtp     PoolHealthNewParamsType = "smtp"
)

type PoolHealthNewResponse

type PoolHealthNewResponse struct {
	// Monitored pool IDs mapped to their respective names.
	Pools     map[string]string         `json:"pools"`
	PreviewID string                    `json:"preview_id"`
	JSON      poolHealthNewResponseJSON `json:"-"`
}

func (*PoolHealthNewResponse) UnmarshalJSON

func (r *PoolHealthNewResponse) UnmarshalJSON(data []byte) (err error)

type PoolHealthNewResponseEnvelope

type PoolHealthNewResponseEnvelope struct {
	Errors   []PoolHealthNewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []PoolHealthNewResponseEnvelopeMessages `json:"messages,required"`
	Result   PoolHealthNewResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success PoolHealthNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    poolHealthNewResponseEnvelopeJSON    `json:"-"`
}

func (*PoolHealthNewResponseEnvelope) UnmarshalJSON

func (r *PoolHealthNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type PoolHealthNewResponseEnvelopeErrors

type PoolHealthNewResponseEnvelopeErrors struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    poolHealthNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*PoolHealthNewResponseEnvelopeErrors) UnmarshalJSON

func (r *PoolHealthNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type PoolHealthNewResponseEnvelopeMessages

type PoolHealthNewResponseEnvelopeMessages struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    poolHealthNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*PoolHealthNewResponseEnvelopeMessages) UnmarshalJSON

func (r *PoolHealthNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type PoolHealthNewResponseEnvelopeSuccess

type PoolHealthNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PoolHealthNewResponseEnvelopeSuccessTrue PoolHealthNewResponseEnvelopeSuccess = true
)

type PoolHealthService

type PoolHealthService struct {
	Options []option.RequestOption
}

PoolHealthService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPoolHealthService method instead.

func NewPoolHealthService

func NewPoolHealthService(opts ...option.RequestOption) (r *PoolHealthService)

NewPoolHealthService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PoolHealthService) Get

Fetch the latest pool health status for a single pool.

func (*PoolHealthService) New

Preview pool health using provided monitor details. The returned preview_id can be used in the preview endpoint to retrieve the results.

type PoolListParams

type PoolListParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// The ID of the Monitor to use for checking the health of origins within this
	// pool.
	Monitor param.Field[interface{}] `query:"monitor"`
}

func (PoolListParams) URLQuery

func (r PoolListParams) URLQuery() (v url.Values)

URLQuery serializes PoolListParams's query parameters as `url.Values`.

type PoolListResponseEnvelope

type PoolListResponseEnvelope struct {
	Errors   []PoolListResponseEnvelopeErrors   `json:"errors,required"`
	Messages []PoolListResponseEnvelopeMessages `json:"messages,required"`
	Result   []user.LoadBalancingPool           `json:"result,required,nullable"`
	// Whether the API call was successful
	Success    PoolListResponseEnvelopeSuccess    `json:"success,required"`
	ResultInfo PoolListResponseEnvelopeResultInfo `json:"result_info"`
	JSON       poolListResponseEnvelopeJSON       `json:"-"`
}

func (*PoolListResponseEnvelope) UnmarshalJSON

func (r *PoolListResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type PoolListResponseEnvelopeErrors

type PoolListResponseEnvelopeErrors struct {
	Code    int64                              `json:"code,required"`
	Message string                             `json:"message,required"`
	JSON    poolListResponseEnvelopeErrorsJSON `json:"-"`
}

func (*PoolListResponseEnvelopeErrors) UnmarshalJSON

func (r *PoolListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type PoolListResponseEnvelopeMessages

type PoolListResponseEnvelopeMessages struct {
	Code    int64                                `json:"code,required"`
	Message string                               `json:"message,required"`
	JSON    poolListResponseEnvelopeMessagesJSON `json:"-"`
}

func (*PoolListResponseEnvelopeMessages) UnmarshalJSON

func (r *PoolListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type PoolListResponseEnvelopeResultInfo

type PoolListResponseEnvelopeResultInfo struct {
	// Total number of results for the requested service
	Count float64 `json:"count"`
	// Current page within paginated list of results
	Page float64 `json:"page"`
	// Number of results per page of results
	PerPage float64 `json:"per_page"`
	// Total results available without any search parameters
	TotalCount float64                                `json:"total_count"`
	JSON       poolListResponseEnvelopeResultInfoJSON `json:"-"`
}

func (*PoolListResponseEnvelopeResultInfo) UnmarshalJSON

func (r *PoolListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)

type PoolListResponseEnvelopeSuccess

type PoolListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PoolListResponseEnvelopeSuccessTrue PoolListResponseEnvelopeSuccess = true
)

type PoolNewParams

type PoolNewParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
	// underscores are allowed.
	Name param.Field[string] `json:"name,required"`
	// The list of origins within this pool. Traffic directed at this pool is balanced
	// across all currently healthy origins, provided the pool itself is healthy.
	Origins param.Field[[]PoolNewParamsOrigin] `json:"origins,required"`
	// A human-readable description of the pool.
	Description param.Field[string] `json:"description"`
	// Whether to enable (the default) or disable this pool. Disabled pools will not
	// receive traffic and are excluded from health checks. Disabling a pool will cause
	// any load balancers using it to failover to the next pool (if any).
	Enabled param.Field[bool] `json:"enabled"`
	// The latitude of the data center containing the origins used in this pool in
	// decimal degrees. If this is set, longitude must also be set.
	Latitude param.Field[float64] `json:"latitude"`
	// Configures load shedding policies and percentages for the pool.
	LoadShedding param.Field[PoolNewParamsLoadShedding] `json:"load_shedding"`
	// The longitude of the data center containing the origins used in this pool in
	// decimal degrees. If this is set, latitude must also be set.
	Longitude param.Field[float64] `json:"longitude"`
	// The minimum number of origins that must be healthy for this pool to serve
	// traffic. If the number of healthy origins falls below this number, the pool will
	// be marked unhealthy and will failover to the next available pool.
	MinimumOrigins param.Field[int64] `json:"minimum_origins"`
	// The ID of the Monitor to use for checking the health of origins within this
	// pool.
	Monitor param.Field[interface{}] `json:"monitor"`
	// This field is now deprecated. It has been moved to Cloudflare's Centralized
	// Notification service
	// https://developers.cloudflare.com/fundamentals/notifications/. The email address
	// to send health status notifications to. This can be an individual mailbox or a
	// mailing list. Multiple emails can be supplied as a comma delimited list.
	NotificationEmail param.Field[string] `json:"notification_email"`
	// Filter pool and origin health notifications by resource type or health status.
	// Use null to reset.
	NotificationFilter param.Field[PoolNewParamsNotificationFilter] `json:"notification_filter"`
	// Configures origin steering for the pool. Controls how origins are selected for
	// new sessions and traffic without session affinity.
	OriginSteering param.Field[PoolNewParamsOriginSteering] `json:"origin_steering"`
}

func (PoolNewParams) MarshalJSON

func (r PoolNewParams) MarshalJSON() (data []byte, err error)

type PoolNewParamsLoadShedding

type PoolNewParamsLoadShedding struct {
	// The percent of traffic to shed from the pool, according to the default policy.
	// Applies to new sessions and traffic without session affinity.
	DefaultPercent param.Field[float64] `json:"default_percent"`
	// The default policy to use when load shedding. A random policy randomly sheds a
	// given percent of requests. A hash policy computes a hash over the
	// CF-Connecting-IP address and sheds all requests originating from a percent of
	// IPs.
	DefaultPolicy param.Field[PoolNewParamsLoadSheddingDefaultPolicy] `json:"default_policy"`
	// The percent of existing sessions to shed from the pool, according to the session
	// policy.
	SessionPercent param.Field[float64] `json:"session_percent"`
	// Only the hash policy is supported for existing sessions (to avoid exponential
	// decay).
	SessionPolicy param.Field[PoolNewParamsLoadSheddingSessionPolicy] `json:"session_policy"`
}

Configures load shedding policies and percentages for the pool.

func (PoolNewParamsLoadShedding) MarshalJSON

func (r PoolNewParamsLoadShedding) MarshalJSON() (data []byte, err error)

type PoolNewParamsLoadSheddingDefaultPolicy

type PoolNewParamsLoadSheddingDefaultPolicy string

The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.

const (
	PoolNewParamsLoadSheddingDefaultPolicyRandom PoolNewParamsLoadSheddingDefaultPolicy = "random"
	PoolNewParamsLoadSheddingDefaultPolicyHash   PoolNewParamsLoadSheddingDefaultPolicy = "hash"
)

type PoolNewParamsLoadSheddingSessionPolicy

type PoolNewParamsLoadSheddingSessionPolicy string

Only the hash policy is supported for existing sessions (to avoid exponential decay).

const (
	PoolNewParamsLoadSheddingSessionPolicyHash PoolNewParamsLoadSheddingSessionPolicy = "hash"
)

type PoolNewParamsNotificationFilter

type PoolNewParamsNotificationFilter struct {
	// Filter options for a particular resource type (pool or origin). Use null to
	// reset.
	Origin param.Field[PoolNewParamsNotificationFilterOrigin] `json:"origin"`
	// Filter options for a particular resource type (pool or origin). Use null to
	// reset.
	Pool param.Field[PoolNewParamsNotificationFilterPool] `json:"pool"`
}

Filter pool and origin health notifications by resource type or health status. Use null to reset.

func (PoolNewParamsNotificationFilter) MarshalJSON

func (r PoolNewParamsNotificationFilter) MarshalJSON() (data []byte, err error)

type PoolNewParamsNotificationFilterOrigin

type PoolNewParamsNotificationFilterOrigin struct {
	// If set true, disable notifications for this type of resource (pool or origin).
	Disable param.Field[bool] `json:"disable"`
	// If present, send notifications only for this health status (e.g. false for only
	// DOWN events). Use null to reset (all events).
	Healthy param.Field[bool] `json:"healthy"`
}

Filter options for a particular resource type (pool or origin). Use null to reset.

func (PoolNewParamsNotificationFilterOrigin) MarshalJSON

func (r PoolNewParamsNotificationFilterOrigin) MarshalJSON() (data []byte, err error)

type PoolNewParamsNotificationFilterPool

type PoolNewParamsNotificationFilterPool struct {
	// If set true, disable notifications for this type of resource (pool or origin).
	Disable param.Field[bool] `json:"disable"`
	// If present, send notifications only for this health status (e.g. false for only
	// DOWN events). Use null to reset (all events).
	Healthy param.Field[bool] `json:"healthy"`
}

Filter options for a particular resource type (pool or origin). Use null to reset.

func (PoolNewParamsNotificationFilterPool) MarshalJSON

func (r PoolNewParamsNotificationFilterPool) MarshalJSON() (data []byte, err error)

type PoolNewParamsOrigin

type PoolNewParamsOrigin struct {
	// The IP address (IPv4 or IPv6) of the origin, or its publicly addressable
	// hostname. Hostnames entered here should resolve directly to the origin, and not
	// be a hostname proxied by Cloudflare. To set an internal/reserved address,
	// virtual_network_id must also be set.
	Address param.Field[string] `json:"address"`
	// Whether to enable (the default) this origin within the pool. Disabled origins
	// will not receive traffic and are excluded from health checks. The origin will
	// only be disabled for the current pool.
	Enabled param.Field[bool] `json:"enabled"`
	// The request header is used to pass additional information with an HTTP request.
	// Currently supported header is 'Host'.
	Header param.Field[PoolNewParamsOriginsHeader] `json:"header"`
	// A human-identifiable name for the origin.
	Name param.Field[string] `json:"name"`
	// The virtual network subnet ID the origin belongs in. Virtual network must also
	// belong to the account.
	VirtualNetworkID param.Field[string] `json:"virtual_network_id"`
	// The weight of this origin relative to other origins in the pool. Based on the
	// configured weight the total traffic is distributed among origins within the
	// pool.
	//
	//   - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the
	//     origin's outstanding requests.
	//   - `origin_steering.policy="least_connections"`: Use weight to scale the origin's
	//     open connections.
	Weight param.Field[float64] `json:"weight"`
}

func (PoolNewParamsOrigin) MarshalJSON

func (r PoolNewParamsOrigin) MarshalJSON() (data []byte, err error)

type PoolNewParamsOriginSteering

type PoolNewParamsOriginSteering struct {
	// The type of origin steering policy to use.
	//
	//   - `"random"`: Select an origin randomly.
	//   - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
	//     address.
	//   - `"least_outstanding_requests"`: Select an origin by taking into consideration
	//     origin weights, as well as each origin's number of outstanding requests.
	//     Origins with more pending requests are weighted proportionately less relative
	//     to others.
	//   - `"least_connections"`: Select an origin by taking into consideration origin
	//     weights, as well as each origin's number of open connections. Origins with
	//     more open connections are weighted proportionately less relative to others.
	//     Supported for HTTP/1 and HTTP/2 connections.
	Policy param.Field[PoolNewParamsOriginSteeringPolicy] `json:"policy"`
}

Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity.

func (PoolNewParamsOriginSteering) MarshalJSON

func (r PoolNewParamsOriginSteering) MarshalJSON() (data []byte, err error)

type PoolNewParamsOriginSteeringPolicy

type PoolNewParamsOriginSteeringPolicy string

The type of origin steering policy to use.

  • `"random"`: Select an origin randomly.
  • `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP address.
  • `"least_outstanding_requests"`: Select an origin by taking into consideration origin weights, as well as each origin's number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others.
  • `"least_connections"`: Select an origin by taking into consideration origin weights, as well as each origin's number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.
const (
	PoolNewParamsOriginSteeringPolicyRandom                   PoolNewParamsOriginSteeringPolicy = "random"
	PoolNewParamsOriginSteeringPolicyHash                     PoolNewParamsOriginSteeringPolicy = "hash"
	PoolNewParamsOriginSteeringPolicyLeastOutstandingRequests PoolNewParamsOriginSteeringPolicy = "least_outstanding_requests"
	PoolNewParamsOriginSteeringPolicyLeastConnections         PoolNewParamsOriginSteeringPolicy = "least_connections"
)

type PoolNewParamsOriginsHeader

type PoolNewParamsOriginsHeader struct {
	// The 'Host' header allows to override the hostname set in the HTTP request.
	// Current support is 1 'Host' header override per origin.
	Host param.Field[[]string] `json:"Host"`
}

The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'.

func (PoolNewParamsOriginsHeader) MarshalJSON

func (r PoolNewParamsOriginsHeader) MarshalJSON() (data []byte, err error)

type PoolNewResponseEnvelope

type PoolNewResponseEnvelope struct {
	Errors   []PoolNewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []PoolNewResponseEnvelopeMessages `json:"messages,required"`
	Result   user.LoadBalancingPool            `json:"result,required"`
	// Whether the API call was successful
	Success PoolNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    poolNewResponseEnvelopeJSON    `json:"-"`
}

func (*PoolNewResponseEnvelope) UnmarshalJSON

func (r *PoolNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type PoolNewResponseEnvelopeErrors

type PoolNewResponseEnvelopeErrors struct {
	Code    int64                             `json:"code,required"`
	Message string                            `json:"message,required"`
	JSON    poolNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*PoolNewResponseEnvelopeErrors) UnmarshalJSON

func (r *PoolNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type PoolNewResponseEnvelopeMessages

type PoolNewResponseEnvelopeMessages struct {
	Code    int64                               `json:"code,required"`
	Message string                              `json:"message,required"`
	JSON    poolNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*PoolNewResponseEnvelopeMessages) UnmarshalJSON

func (r *PoolNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type PoolNewResponseEnvelopeSuccess

type PoolNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PoolNewResponseEnvelopeSuccessTrue PoolNewResponseEnvelopeSuccess = true
)

type PoolReferenceGetParams

type PoolReferenceGetParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type PoolReferenceGetResponse

type PoolReferenceGetResponse struct {
	ReferenceType PoolReferenceGetResponseReferenceType `json:"reference_type"`
	ResourceID    string                                `json:"resource_id"`
	ResourceName  string                                `json:"resource_name"`
	ResourceType  string                                `json:"resource_type"`
	JSON          poolReferenceGetResponseJSON          `json:"-"`
}

func (*PoolReferenceGetResponse) UnmarshalJSON

func (r *PoolReferenceGetResponse) UnmarshalJSON(data []byte) (err error)

type PoolReferenceGetResponseEnvelope

type PoolReferenceGetResponseEnvelope struct {
	Errors   []PoolReferenceGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []PoolReferenceGetResponseEnvelopeMessages `json:"messages,required"`
	// List of resources that reference a given pool.
	Result []PoolReferenceGetResponse `json:"result,required,nullable"`
	// Whether the API call was successful
	Success    PoolReferenceGetResponseEnvelopeSuccess    `json:"success,required"`
	ResultInfo PoolReferenceGetResponseEnvelopeResultInfo `json:"result_info"`
	JSON       poolReferenceGetResponseEnvelopeJSON       `json:"-"`
}

func (*PoolReferenceGetResponseEnvelope) UnmarshalJSON

func (r *PoolReferenceGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type PoolReferenceGetResponseEnvelopeErrors

type PoolReferenceGetResponseEnvelopeErrors struct {
	Code    int64                                      `json:"code,required"`
	Message string                                     `json:"message,required"`
	JSON    poolReferenceGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*PoolReferenceGetResponseEnvelopeErrors) UnmarshalJSON

func (r *PoolReferenceGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type PoolReferenceGetResponseEnvelopeMessages

type PoolReferenceGetResponseEnvelopeMessages struct {
	Code    int64                                        `json:"code,required"`
	Message string                                       `json:"message,required"`
	JSON    poolReferenceGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*PoolReferenceGetResponseEnvelopeMessages) UnmarshalJSON

func (r *PoolReferenceGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type PoolReferenceGetResponseEnvelopeResultInfo

type PoolReferenceGetResponseEnvelopeResultInfo struct {
	// Total number of results for the requested service
	Count float64 `json:"count"`
	// Current page within paginated list of results
	Page float64 `json:"page"`
	// Number of results per page of results
	PerPage float64 `json:"per_page"`
	// Total results available without any search parameters
	TotalCount float64                                        `json:"total_count"`
	JSON       poolReferenceGetResponseEnvelopeResultInfoJSON `json:"-"`
}

func (*PoolReferenceGetResponseEnvelopeResultInfo) UnmarshalJSON

func (r *PoolReferenceGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)

type PoolReferenceGetResponseEnvelopeSuccess

type PoolReferenceGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PoolReferenceGetResponseEnvelopeSuccessTrue PoolReferenceGetResponseEnvelopeSuccess = true
)

type PoolReferenceGetResponseReferenceType

type PoolReferenceGetResponseReferenceType string
const (
	PoolReferenceGetResponseReferenceTypeStar     PoolReferenceGetResponseReferenceType = "*"
	PoolReferenceGetResponseReferenceTypeReferral PoolReferenceGetResponseReferenceType = "referral"
	PoolReferenceGetResponseReferenceTypeReferrer PoolReferenceGetResponseReferenceType = "referrer"
)

type PoolReferenceService

type PoolReferenceService struct {
	Options []option.RequestOption
}

PoolReferenceService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPoolReferenceService method instead.

func NewPoolReferenceService

func NewPoolReferenceService(opts ...option.RequestOption) (r *PoolReferenceService)

NewPoolReferenceService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PoolReferenceService) Get

Get the list of resources that reference the provided pool.

type PoolService

type PoolService struct {
	Options    []option.RequestOption
	Health     *PoolHealthService
	References *PoolReferenceService
}

PoolService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPoolService method instead.

func NewPoolService

func NewPoolService(opts ...option.RequestOption) (r *PoolService)

NewPoolService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PoolService) Delete

func (r *PoolService) Delete(ctx context.Context, poolID string, body PoolDeleteParams, opts ...option.RequestOption) (res *PoolDeleteResponse, err error)

Delete a configured pool.

func (*PoolService) Edit

func (r *PoolService) Edit(ctx context.Context, poolID string, params PoolEditParams, opts ...option.RequestOption) (res *user.LoadBalancingPool, err error)

Apply changes to an existing pool, overwriting the supplied properties.

func (*PoolService) Get

func (r *PoolService) Get(ctx context.Context, poolID string, query PoolGetParams, opts ...option.RequestOption) (res *user.LoadBalancingPool, err error)

Fetch a single configured pool.

func (*PoolService) List

func (r *PoolService) List(ctx context.Context, params PoolListParams, opts ...option.RequestOption) (res *[]user.LoadBalancingPool, err error)

List configured pools.

func (*PoolService) New

func (r *PoolService) New(ctx context.Context, params PoolNewParams, opts ...option.RequestOption) (res *user.LoadBalancingPool, err error)

Create a new pool.

func (*PoolService) Update

func (r *PoolService) Update(ctx context.Context, poolID string, params PoolUpdateParams, opts ...option.RequestOption) (res *user.LoadBalancingPool, err error)

Modify a configured pool.

type PoolUpdateParams

type PoolUpdateParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
	// underscores are allowed.
	Name param.Field[string] `json:"name,required"`
	// The list of origins within this pool. Traffic directed at this pool is balanced
	// across all currently healthy origins, provided the pool itself is healthy.
	Origins param.Field[[]PoolUpdateParamsOrigin] `json:"origins,required"`
	// A list of regions from which to run health checks. Null means every Cloudflare
	// data center.
	CheckRegions param.Field[[]PoolUpdateParamsCheckRegion] `json:"check_regions"`
	// A human-readable description of the pool.
	Description param.Field[string] `json:"description"`
	// Whether to enable (the default) or disable this pool. Disabled pools will not
	// receive traffic and are excluded from health checks. Disabling a pool will cause
	// any load balancers using it to failover to the next pool (if any).
	Enabled param.Field[bool] `json:"enabled"`
	// The latitude of the data center containing the origins used in this pool in
	// decimal degrees. If this is set, longitude must also be set.
	Latitude param.Field[float64] `json:"latitude"`
	// Configures load shedding policies and percentages for the pool.
	LoadShedding param.Field[PoolUpdateParamsLoadShedding] `json:"load_shedding"`
	// The longitude of the data center containing the origins used in this pool in
	// decimal degrees. If this is set, latitude must also be set.
	Longitude param.Field[float64] `json:"longitude"`
	// The minimum number of origins that must be healthy for this pool to serve
	// traffic. If the number of healthy origins falls below this number, the pool will
	// be marked unhealthy and will failover to the next available pool.
	MinimumOrigins param.Field[int64] `json:"minimum_origins"`
	// The ID of the Monitor to use for checking the health of origins within this
	// pool.
	Monitor param.Field[interface{}] `json:"monitor"`
	// This field is now deprecated. It has been moved to Cloudflare's Centralized
	// Notification service
	// https://developers.cloudflare.com/fundamentals/notifications/. The email address
	// to send health status notifications to. This can be an individual mailbox or a
	// mailing list. Multiple emails can be supplied as a comma delimited list.
	NotificationEmail param.Field[string] `json:"notification_email"`
	// Filter pool and origin health notifications by resource type or health status.
	// Use null to reset.
	NotificationFilter param.Field[PoolUpdateParamsNotificationFilter] `json:"notification_filter"`
	// Configures origin steering for the pool. Controls how origins are selected for
	// new sessions and traffic without session affinity.
	OriginSteering param.Field[PoolUpdateParamsOriginSteering] `json:"origin_steering"`
}

func (PoolUpdateParams) MarshalJSON

func (r PoolUpdateParams) MarshalJSON() (data []byte, err error)

type PoolUpdateParamsCheckRegion

type PoolUpdateParamsCheckRegion string

WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe, EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America, OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS: Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (ENTERPRISE customers only).

const (
	PoolUpdateParamsCheckRegionWnam       PoolUpdateParamsCheckRegion = "WNAM"
	PoolUpdateParamsCheckRegionEnam       PoolUpdateParamsCheckRegion = "ENAM"
	PoolUpdateParamsCheckRegionWeu        PoolUpdateParamsCheckRegion = "WEU"
	PoolUpdateParamsCheckRegionEeu        PoolUpdateParamsCheckRegion = "EEU"
	PoolUpdateParamsCheckRegionNsam       PoolUpdateParamsCheckRegion = "NSAM"
	PoolUpdateParamsCheckRegionSsam       PoolUpdateParamsCheckRegion = "SSAM"
	PoolUpdateParamsCheckRegionOc         PoolUpdateParamsCheckRegion = "OC"
	PoolUpdateParamsCheckRegionMe         PoolUpdateParamsCheckRegion = "ME"
	PoolUpdateParamsCheckRegionNaf        PoolUpdateParamsCheckRegion = "NAF"
	PoolUpdateParamsCheckRegionSaf        PoolUpdateParamsCheckRegion = "SAF"
	PoolUpdateParamsCheckRegionSas        PoolUpdateParamsCheckRegion = "SAS"
	PoolUpdateParamsCheckRegionSeas       PoolUpdateParamsCheckRegion = "SEAS"
	PoolUpdateParamsCheckRegionNeas       PoolUpdateParamsCheckRegion = "NEAS"
	PoolUpdateParamsCheckRegionAllRegions PoolUpdateParamsCheckRegion = "ALL_REGIONS"
)

type PoolUpdateParamsLoadShedding

type PoolUpdateParamsLoadShedding struct {
	// The percent of traffic to shed from the pool, according to the default policy.
	// Applies to new sessions and traffic without session affinity.
	DefaultPercent param.Field[float64] `json:"default_percent"`
	// The default policy to use when load shedding. A random policy randomly sheds a
	// given percent of requests. A hash policy computes a hash over the
	// CF-Connecting-IP address and sheds all requests originating from a percent of
	// IPs.
	DefaultPolicy param.Field[PoolUpdateParamsLoadSheddingDefaultPolicy] `json:"default_policy"`
	// The percent of existing sessions to shed from the pool, according to the session
	// policy.
	SessionPercent param.Field[float64] `json:"session_percent"`
	// Only the hash policy is supported for existing sessions (to avoid exponential
	// decay).
	SessionPolicy param.Field[PoolUpdateParamsLoadSheddingSessionPolicy] `json:"session_policy"`
}

Configures load shedding policies and percentages for the pool.

func (PoolUpdateParamsLoadShedding) MarshalJSON

func (r PoolUpdateParamsLoadShedding) MarshalJSON() (data []byte, err error)

type PoolUpdateParamsLoadSheddingDefaultPolicy

type PoolUpdateParamsLoadSheddingDefaultPolicy string

The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.

const (
	PoolUpdateParamsLoadSheddingDefaultPolicyRandom PoolUpdateParamsLoadSheddingDefaultPolicy = "random"
	PoolUpdateParamsLoadSheddingDefaultPolicyHash   PoolUpdateParamsLoadSheddingDefaultPolicy = "hash"
)

type PoolUpdateParamsLoadSheddingSessionPolicy

type PoolUpdateParamsLoadSheddingSessionPolicy string

Only the hash policy is supported for existing sessions (to avoid exponential decay).

const (
	PoolUpdateParamsLoadSheddingSessionPolicyHash PoolUpdateParamsLoadSheddingSessionPolicy = "hash"
)

type PoolUpdateParamsNotificationFilter

type PoolUpdateParamsNotificationFilter struct {
	// Filter options for a particular resource type (pool or origin). Use null to
	// reset.
	Origin param.Field[PoolUpdateParamsNotificationFilterOrigin] `json:"origin"`
	// Filter options for a particular resource type (pool or origin). Use null to
	// reset.
	Pool param.Field[PoolUpdateParamsNotificationFilterPool] `json:"pool"`
}

Filter pool and origin health notifications by resource type or health status. Use null to reset.

func (PoolUpdateParamsNotificationFilter) MarshalJSON

func (r PoolUpdateParamsNotificationFilter) MarshalJSON() (data []byte, err error)

type PoolUpdateParamsNotificationFilterOrigin

type PoolUpdateParamsNotificationFilterOrigin struct {
	// If set true, disable notifications for this type of resource (pool or origin).
	Disable param.Field[bool] `json:"disable"`
	// If present, send notifications only for this health status (e.g. false for only
	// DOWN events). Use null to reset (all events).
	Healthy param.Field[bool] `json:"healthy"`
}

Filter options for a particular resource type (pool or origin). Use null to reset.

func (PoolUpdateParamsNotificationFilterOrigin) MarshalJSON

func (r PoolUpdateParamsNotificationFilterOrigin) MarshalJSON() (data []byte, err error)

type PoolUpdateParamsNotificationFilterPool

type PoolUpdateParamsNotificationFilterPool struct {
	// If set true, disable notifications for this type of resource (pool or origin).
	Disable param.Field[bool] `json:"disable"`
	// If present, send notifications only for this health status (e.g. false for only
	// DOWN events). Use null to reset (all events).
	Healthy param.Field[bool] `json:"healthy"`
}

Filter options for a particular resource type (pool or origin). Use null to reset.

func (PoolUpdateParamsNotificationFilterPool) MarshalJSON

func (r PoolUpdateParamsNotificationFilterPool) MarshalJSON() (data []byte, err error)

type PoolUpdateParamsOrigin

type PoolUpdateParamsOrigin struct {
	// The IP address (IPv4 or IPv6) of the origin, or its publicly addressable
	// hostname. Hostnames entered here should resolve directly to the origin, and not
	// be a hostname proxied by Cloudflare. To set an internal/reserved address,
	// virtual_network_id must also be set.
	Address param.Field[string] `json:"address"`
	// Whether to enable (the default) this origin within the pool. Disabled origins
	// will not receive traffic and are excluded from health checks. The origin will
	// only be disabled for the current pool.
	Enabled param.Field[bool] `json:"enabled"`
	// The request header is used to pass additional information with an HTTP request.
	// Currently supported header is 'Host'.
	Header param.Field[PoolUpdateParamsOriginsHeader] `json:"header"`
	// A human-identifiable name for the origin.
	Name param.Field[string] `json:"name"`
	// The virtual network subnet ID the origin belongs in. Virtual network must also
	// belong to the account.
	VirtualNetworkID param.Field[string] `json:"virtual_network_id"`
	// The weight of this origin relative to other origins in the pool. Based on the
	// configured weight the total traffic is distributed among origins within the
	// pool.
	//
	//   - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the
	//     origin's outstanding requests.
	//   - `origin_steering.policy="least_connections"`: Use weight to scale the origin's
	//     open connections.
	Weight param.Field[float64] `json:"weight"`
}

func (PoolUpdateParamsOrigin) MarshalJSON

func (r PoolUpdateParamsOrigin) MarshalJSON() (data []byte, err error)

type PoolUpdateParamsOriginSteering

type PoolUpdateParamsOriginSteering struct {
	// The type of origin steering policy to use.
	//
	//   - `"random"`: Select an origin randomly.
	//   - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
	//     address.
	//   - `"least_outstanding_requests"`: Select an origin by taking into consideration
	//     origin weights, as well as each origin's number of outstanding requests.
	//     Origins with more pending requests are weighted proportionately less relative
	//     to others.
	//   - `"least_connections"`: Select an origin by taking into consideration origin
	//     weights, as well as each origin's number of open connections. Origins with
	//     more open connections are weighted proportionately less relative to others.
	//     Supported for HTTP/1 and HTTP/2 connections.
	Policy param.Field[PoolUpdateParamsOriginSteeringPolicy] `json:"policy"`
}

Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity.

func (PoolUpdateParamsOriginSteering) MarshalJSON

func (r PoolUpdateParamsOriginSteering) MarshalJSON() (data []byte, err error)

type PoolUpdateParamsOriginSteeringPolicy

type PoolUpdateParamsOriginSteeringPolicy string

The type of origin steering policy to use.

  • `"random"`: Select an origin randomly.
  • `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP address.
  • `"least_outstanding_requests"`: Select an origin by taking into consideration origin weights, as well as each origin's number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others.
  • `"least_connections"`: Select an origin by taking into consideration origin weights, as well as each origin's number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.
const (
	PoolUpdateParamsOriginSteeringPolicyRandom                   PoolUpdateParamsOriginSteeringPolicy = "random"
	PoolUpdateParamsOriginSteeringPolicyHash                     PoolUpdateParamsOriginSteeringPolicy = "hash"
	PoolUpdateParamsOriginSteeringPolicyLeastOutstandingRequests PoolUpdateParamsOriginSteeringPolicy = "least_outstanding_requests"
	PoolUpdateParamsOriginSteeringPolicyLeastConnections         PoolUpdateParamsOriginSteeringPolicy = "least_connections"
)

type PoolUpdateParamsOriginsHeader

type PoolUpdateParamsOriginsHeader struct {
	// The 'Host' header allows to override the hostname set in the HTTP request.
	// Current support is 1 'Host' header override per origin.
	Host param.Field[[]string] `json:"Host"`
}

The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'.

func (PoolUpdateParamsOriginsHeader) MarshalJSON

func (r PoolUpdateParamsOriginsHeader) MarshalJSON() (data []byte, err error)

type PoolUpdateResponseEnvelope

type PoolUpdateResponseEnvelope struct {
	Errors   []PoolUpdateResponseEnvelopeErrors   `json:"errors,required"`
	Messages []PoolUpdateResponseEnvelopeMessages `json:"messages,required"`
	Result   user.LoadBalancingPool               `json:"result,required"`
	// Whether the API call was successful
	Success PoolUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    poolUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*PoolUpdateResponseEnvelope) UnmarshalJSON

func (r *PoolUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type PoolUpdateResponseEnvelopeErrors

type PoolUpdateResponseEnvelopeErrors struct {
	Code    int64                                `json:"code,required"`
	Message string                               `json:"message,required"`
	JSON    poolUpdateResponseEnvelopeErrorsJSON `json:"-"`
}

func (*PoolUpdateResponseEnvelopeErrors) UnmarshalJSON

func (r *PoolUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type PoolUpdateResponseEnvelopeMessages

type PoolUpdateResponseEnvelopeMessages struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    poolUpdateResponseEnvelopeMessagesJSON `json:"-"`
}

func (*PoolUpdateResponseEnvelopeMessages) UnmarshalJSON

func (r *PoolUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type PoolUpdateResponseEnvelopeSuccess

type PoolUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PoolUpdateResponseEnvelopeSuccessTrue PoolUpdateResponseEnvelopeSuccess = true
)

type PreviewGetParams

type PreviewGetParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type PreviewGetResponseEnvelope

type PreviewGetResponseEnvelope struct {
	Errors   []PreviewGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []PreviewGetResponseEnvelopeMessages `json:"messages,required"`
	// Resulting health data from a preview operation.
	Result user.LoadBalancingPreviewResult `json:"result,required"`
	// Whether the API call was successful
	Success PreviewGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    previewGetResponseEnvelopeJSON    `json:"-"`
}

func (*PreviewGetResponseEnvelope) UnmarshalJSON

func (r *PreviewGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type PreviewGetResponseEnvelopeErrors

type PreviewGetResponseEnvelopeErrors struct {
	Code    int64                                `json:"code,required"`
	Message string                               `json:"message,required"`
	JSON    previewGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*PreviewGetResponseEnvelopeErrors) UnmarshalJSON

func (r *PreviewGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type PreviewGetResponseEnvelopeMessages

type PreviewGetResponseEnvelopeMessages struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    previewGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*PreviewGetResponseEnvelopeMessages) UnmarshalJSON

func (r *PreviewGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type PreviewGetResponseEnvelopeSuccess

type PreviewGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PreviewGetResponseEnvelopeSuccessTrue PreviewGetResponseEnvelopeSuccess = true
)

type PreviewService

type PreviewService struct {
	Options []option.RequestOption
}

PreviewService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPreviewService method instead.

func NewPreviewService

func NewPreviewService(opts ...option.RequestOption) (r *PreviewService)

NewPreviewService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PreviewService) Get

func (r *PreviewService) Get(ctx context.Context, previewID interface{}, query PreviewGetParams, opts ...option.RequestOption) (res *user.LoadBalancingPreviewResult, err error)

Get the result of a previous preview operation using the provided preview_id.

type RegionGetParams

type RegionGetParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type RegionGetParamsRegionID

type RegionGetParamsRegionID string

A list of Cloudflare regions. WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe, EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America, OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS: Southern Asia, SEAS: South East Asia, NEAS: North East Asia).

const (
	RegionGetParamsRegionIDWnam RegionGetParamsRegionID = "WNAM"
	RegionGetParamsRegionIDEnam RegionGetParamsRegionID = "ENAM"
	RegionGetParamsRegionIDWeu  RegionGetParamsRegionID = "WEU"
	RegionGetParamsRegionIDEeu  RegionGetParamsRegionID = "EEU"
	RegionGetParamsRegionIDNsam RegionGetParamsRegionID = "NSAM"
	RegionGetParamsRegionIDSsam RegionGetParamsRegionID = "SSAM"
	RegionGetParamsRegionIDOc   RegionGetParamsRegionID = "OC"
	RegionGetParamsRegionIDMe   RegionGetParamsRegionID = "ME"
	RegionGetParamsRegionIDNaf  RegionGetParamsRegionID = "NAF"
	RegionGetParamsRegionIDSaf  RegionGetParamsRegionID = "SAF"
	RegionGetParamsRegionIDSas  RegionGetParamsRegionID = "SAS"
	RegionGetParamsRegionIDSeas RegionGetParamsRegionID = "SEAS"
	RegionGetParamsRegionIDNeas RegionGetParamsRegionID = "NEAS"
)

type RegionGetResponse

type RegionGetResponse interface {
	ImplementsLoadBalancersRegionGetResponse()
}

A list of countries and subdivisions mapped to a region.

Union satisfied by load_balancers.RegionGetResponseUnknown or shared.UnionString.

type RegionGetResponseEnvelope

type RegionGetResponseEnvelope struct {
	Errors   []RegionGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []RegionGetResponseEnvelopeMessages `json:"messages,required"`
	// A list of countries and subdivisions mapped to a region.
	Result RegionGetResponse `json:"result,required"`
	// Whether the API call was successful
	Success RegionGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    regionGetResponseEnvelopeJSON    `json:"-"`
}

func (*RegionGetResponseEnvelope) UnmarshalJSON

func (r *RegionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type RegionGetResponseEnvelopeErrors

type RegionGetResponseEnvelopeErrors struct {
	Code    int64                               `json:"code,required"`
	Message string                              `json:"message,required"`
	JSON    regionGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*RegionGetResponseEnvelopeErrors) UnmarshalJSON

func (r *RegionGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type RegionGetResponseEnvelopeMessages

type RegionGetResponseEnvelopeMessages struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    regionGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*RegionGetResponseEnvelopeMessages) UnmarshalJSON

func (r *RegionGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type RegionGetResponseEnvelopeSuccess

type RegionGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	RegionGetResponseEnvelopeSuccessTrue RegionGetResponseEnvelopeSuccess = true
)

type RegionListParams

type RegionListParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// Two-letter alpha-2 country code followed in ISO 3166-1.
	CountryCodeA2 param.Field[string] `query:"country_code_a2"`
	// Two-letter subdivision code followed in ISO 3166-2.
	SubdivisionCode param.Field[string] `query:"subdivision_code"`
	// Two-letter subdivision code followed in ISO 3166-2.
	SubdivisionCodeA2 param.Field[string] `query:"subdivision_code_a2"`
}

func (RegionListParams) URLQuery

func (r RegionListParams) URLQuery() (v url.Values)

URLQuery serializes RegionListParams's query parameters as `url.Values`.

type RegionListResponse

type RegionListResponse interface {
	ImplementsLoadBalancersRegionListResponse()
}

Union satisfied by load_balancers.RegionListResponseUnknown or shared.UnionString.

type RegionListResponseEnvelope

type RegionListResponseEnvelope struct {
	Errors   []RegionListResponseEnvelopeErrors   `json:"errors,required"`
	Messages []RegionListResponseEnvelopeMessages `json:"messages,required"`
	Result   RegionListResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success RegionListResponseEnvelopeSuccess `json:"success,required"`
	JSON    regionListResponseEnvelopeJSON    `json:"-"`
}

func (*RegionListResponseEnvelope) UnmarshalJSON

func (r *RegionListResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type RegionListResponseEnvelopeErrors

type RegionListResponseEnvelopeErrors struct {
	Code    int64                                `json:"code,required"`
	Message string                               `json:"message,required"`
	JSON    regionListResponseEnvelopeErrorsJSON `json:"-"`
}

func (*RegionListResponseEnvelopeErrors) UnmarshalJSON

func (r *RegionListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type RegionListResponseEnvelopeMessages

type RegionListResponseEnvelopeMessages struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    regionListResponseEnvelopeMessagesJSON `json:"-"`
}

func (*RegionListResponseEnvelopeMessages) UnmarshalJSON

func (r *RegionListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type RegionListResponseEnvelopeSuccess

type RegionListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	RegionListResponseEnvelopeSuccessTrue RegionListResponseEnvelopeSuccess = true
)

type RegionService

type RegionService struct {
	Options []option.RequestOption
}

RegionService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRegionService method instead.

func NewRegionService

func NewRegionService(opts ...option.RequestOption) (r *RegionService)

NewRegionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*RegionService) Get

Get a single region mapping.

func (*RegionService) List

func (r *RegionService) List(ctx context.Context, params RegionListParams, opts ...option.RequestOption) (res *RegionListResponse, err error)

List all region mappings.

type SearchGetParams

type SearchGetParams struct {
	// Identifier
	AccountID    param.Field[string]                      `path:"account_id,required"`
	Page         param.Field[interface{}]                 `query:"page"`
	PerPage      param.Field[interface{}]                 `query:"per_page"`
	SearchParams param.Field[SearchGetParamsSearchParams] `query:"search_params"`
}

func (SearchGetParams) URLQuery

func (r SearchGetParams) URLQuery() (v url.Values)

URLQuery serializes SearchGetParams's query parameters as `url.Values`.

type SearchGetParamsSearchParams

type SearchGetParamsSearchParams struct {
	// Search query term.
	Query param.Field[string] `query:"query"`
	// The type of references to include ("\*" for all).
	References param.Field[SearchGetParamsSearchParamsReferences] `query:"references"`
}

func (SearchGetParamsSearchParams) URLQuery

func (r SearchGetParamsSearchParams) URLQuery() (v url.Values)

URLQuery serializes SearchGetParamsSearchParams's query parameters as `url.Values`.

type SearchGetParamsSearchParamsReferences

type SearchGetParamsSearchParamsReferences string

The type of references to include ("\*" for all).

const (
	SearchGetParamsSearchParamsReferencesEmpty    SearchGetParamsSearchParamsReferences = ""
	SearchGetParamsSearchParamsReferencesStar     SearchGetParamsSearchParamsReferences = "*"
	SearchGetParamsSearchParamsReferencesReferral SearchGetParamsSearchParamsReferences = "referral"
	SearchGetParamsSearchParamsReferencesReferrer SearchGetParamsSearchParamsReferences = "referrer"
)

type SearchGetResponse

type SearchGetResponse = interface{}

type SearchGetResponseEnvelope

type SearchGetResponseEnvelope struct {
	Errors   []SearchGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []SearchGetResponseEnvelopeMessages `json:"messages,required"`
	Result   []SearchGetResponse                 `json:"result,required,nullable"`
	// Whether the API call was successful
	Success    SearchGetResponseEnvelopeSuccess    `json:"success,required"`
	ResultInfo SearchGetResponseEnvelopeResultInfo `json:"result_info"`
	JSON       searchGetResponseEnvelopeJSON       `json:"-"`
}

func (*SearchGetResponseEnvelope) UnmarshalJSON

func (r *SearchGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type SearchGetResponseEnvelopeErrors

type SearchGetResponseEnvelopeErrors struct {
	Code    int64                               `json:"code,required"`
	Message string                              `json:"message,required"`
	JSON    searchGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*SearchGetResponseEnvelopeErrors) UnmarshalJSON

func (r *SearchGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type SearchGetResponseEnvelopeMessages

type SearchGetResponseEnvelopeMessages struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    searchGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*SearchGetResponseEnvelopeMessages) UnmarshalJSON

func (r *SearchGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type SearchGetResponseEnvelopeResultInfo

type SearchGetResponseEnvelopeResultInfo struct {
	// Total number of results for the requested service
	Count float64 `json:"count"`
	// Current page within paginated list of results
	Page float64 `json:"page"`
	// Number of results per page of results
	PerPage float64 `json:"per_page"`
	// Total results available without any search parameters
	TotalCount float64                                 `json:"total_count"`
	JSON       searchGetResponseEnvelopeResultInfoJSON `json:"-"`
}

func (*SearchGetResponseEnvelopeResultInfo) UnmarshalJSON

func (r *SearchGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)

type SearchGetResponseEnvelopeSuccess

type SearchGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	SearchGetResponseEnvelopeSuccessTrue SearchGetResponseEnvelopeSuccess = true
)

type SearchService

type SearchService struct {
	Options []option.RequestOption
}

SearchService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSearchService method instead.

func NewSearchService

func NewSearchService(opts ...option.RequestOption) (r *SearchService)

NewSearchService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*SearchService) Get

func (r *SearchService) Get(ctx context.Context, params SearchGetParams, opts ...option.RequestOption) (res *[]SearchGetResponse, err error)

Search for Load Balancing resources.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL