Documentation ¶
Index ¶
- Constants
- type ASN
- type ASNParam
- type AdaptiveRouting
- type AdaptiveRoutingParam
- type AuditLog
- type AuditLogAction
- type AuditLogActor
- type AuditLogActorType
- type AuditLogOwner
- type AuditLogResource
- type CertificateCA
- type CertificateRequestType
- type CheckRegion
- type CloudflareTunnel
- type CloudflareTunnelConnection
- type CloudflareTunnelStatus
- type CloudflareTunnelTunType
- type DefaultPools
- type DefaultPoolsParam
- type Error
- type ErrorData
- type FilterOptions
- type FilterOptionsParam
- type Header
- type HeaderParam
- type Host
- type HostParam
- type LoadBalancer
- type LoadBalancerDeleteResponse
- type LoadBalancerDeleteResponseEnvelope
- type LoadBalancerDeleteResponseEnvelopeSuccess
- type LoadBalancerEditParams
- type LoadBalancerEditResponseEnvelope
- type LoadBalancerEditResponseEnvelopeSuccess
- type LoadBalancerGetResponseEnvelope
- type LoadBalancerGetResponseEnvelopeSuccess
- type LoadBalancerNewParams
- type LoadBalancerNewResponseEnvelope
- type LoadBalancerNewResponseEnvelopeSuccess
- type LoadBalancerService
- func (r *LoadBalancerService) Delete(ctx context.Context, zoneID string, loadBalancerID string, ...) (res *LoadBalancerDeleteResponse, err error)
- func (r *LoadBalancerService) Edit(ctx context.Context, zoneID string, loadBalancerID string, ...) (res *LoadBalancer, err error)
- func (r *LoadBalancerService) Get(ctx context.Context, zoneID string, loadBalancerID string, ...) (res *LoadBalancer, err error)
- func (r *LoadBalancerService) List(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *pagination.SinglePage[LoadBalancer], err error)
- func (r *LoadBalancerService) ListAutoPaging(ctx context.Context, zoneID string, opts ...option.RequestOption) *pagination.SinglePageAutoPager[LoadBalancer]
- func (r *LoadBalancerService) New(ctx context.Context, zoneID string, body LoadBalancerNewParams, ...) (res *LoadBalancer, err error)
- func (r *LoadBalancerService) Update(ctx context.Context, zoneID string, loadBalancerID string, ...) (res *LoadBalancer, err error)
- type LoadBalancerUpdateParams
- type LoadBalancerUpdateResponseEnvelope
- type LoadBalancerUpdateResponseEnvelopeSuccess
- type LoadShedding
- type LoadSheddingDefaultPolicy
- type LoadSheddingParam
- type LoadSheddingSessionPolicy
- type LocationStrategy
- type LocationStrategyMode
- type LocationStrategyParam
- type LocationStrategyPreferECS
- type MemberParam
- type MemberRoleParam
- type MemberRolesPermissionsParam
- type MemberStatus
- type MemberUserParam
- type Monitor
- type MonitorDeleteResponse
- type MonitorDeleteResponseEnvelope
- type MonitorDeleteResponseEnvelopeSuccess
- type MonitorEditParams
- type MonitorEditParamsType
- type MonitorEditResponseEnvelope
- type MonitorEditResponseEnvelopeSuccess
- type MonitorGetResponseEnvelope
- type MonitorGetResponseEnvelopeSuccess
- type MonitorNewParams
- type MonitorNewParamsType
- type MonitorNewResponseEnvelope
- type MonitorNewResponseEnvelopeSuccess
- type MonitorPreviewNewParams
- type MonitorPreviewNewParamsType
- type MonitorPreviewNewResponse
- type MonitorPreviewNewResponseEnvelope
- type MonitorPreviewNewResponseEnvelopeSuccess
- type MonitorPreviewService
- type MonitorReferenceGetResponse
- type MonitorReferenceGetResponseEnvelope
- type MonitorReferenceGetResponseEnvelopeResultInfo
- type MonitorReferenceGetResponseEnvelopeSuccess
- type MonitorReferenceGetResponseReferenceType
- type MonitorReferenceService
- type MonitorService
- func (r *MonitorService) Delete(ctx context.Context, accountID string, monitorID string, ...) (res *MonitorDeleteResponse, err error)
- func (r *MonitorService) Edit(ctx context.Context, accountID string, monitorID string, ...) (res *Monitor, err error)
- func (r *MonitorService) Get(ctx context.Context, accountID string, monitorID string, ...) (res *Monitor, err error)
- func (r *MonitorService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *pagination.SinglePage[Monitor], err error)
- func (r *MonitorService) ListAutoPaging(ctx context.Context, accountID string, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Monitor]
- func (r *MonitorService) New(ctx context.Context, accountID string, body MonitorNewParams, ...) (res *Monitor, err error)
- func (r *MonitorService) Update(ctx context.Context, accountID string, monitorID string, ...) (res *Monitor, err error)
- type MonitorType
- type MonitorUpdateParams
- type MonitorUpdateParamsType
- type MonitorUpdateResponseEnvelope
- type MonitorUpdateResponseEnvelopeSuccess
- type NotificationFilter
- type NotificationFilterParam
- type Origin
- type OriginParam
- type OriginSteering
- type OriginSteeringParam
- type OriginSteeringPolicy
- type Permission
- type PermissionGrant
- type PermissionGrantParam
- type Pool
- type PoolDeleteResponse
- type PoolDeleteResponseEnvelope
- type PoolDeleteResponseEnvelopeSuccess
- type PoolEditParams
- type PoolEditResponseEnvelope
- type PoolEditResponseEnvelopeSuccess
- type PoolGetResponseEnvelope
- type PoolGetResponseEnvelopeSuccess
- type PoolHealthGetResponseEnvelope
- type PoolHealthGetResponseEnvelopeSuccess
- type PoolHealthGetResponseUnion
- type PoolHealthNewParams
- type PoolHealthNewParamsType
- type PoolHealthNewResponse
- type PoolHealthNewResponseEnvelope
- type PoolHealthNewResponseEnvelopeSuccess
- type PoolHealthService
- type PoolListParams
- type PoolNewParams
- type PoolNewResponseEnvelope
- type PoolNewResponseEnvelopeSuccess
- type PoolReferenceGetResponse
- type PoolReferenceGetResponseEnvelope
- type PoolReferenceGetResponseEnvelopeResultInfo
- type PoolReferenceGetResponseEnvelopeSuccess
- type PoolReferenceGetResponseReferenceType
- type PoolReferenceService
- type PoolService
- func (r *PoolService) Delete(ctx context.Context, accountID string, poolID string, ...) (res *PoolDeleteResponse, err error)
- func (r *PoolService) Edit(ctx context.Context, accountID string, poolID string, body PoolEditParams, ...) (res *Pool, err error)
- func (r *PoolService) Get(ctx context.Context, accountID string, poolID string, ...) (res *Pool, err error)
- func (r *PoolService) List(ctx context.Context, accountID string, query PoolListParams, ...) (res *pagination.SinglePage[Pool], err error)
- func (r *PoolService) ListAutoPaging(ctx context.Context, accountID string, query PoolListParams, ...) *pagination.SinglePageAutoPager[Pool]
- func (r *PoolService) New(ctx context.Context, accountID string, body PoolNewParams, ...) (res *Pool, err error)
- func (r *PoolService) Update(ctx context.Context, accountID string, poolID string, body PoolUpdateParams, ...) (res *Pool, err error)
- type PoolUpdateParams
- type PoolUpdateResponseEnvelope
- type PoolUpdateResponseEnvelopeSuccess
- type PreviewGetResponse
- type PreviewGetResponseEnvelope
- type PreviewGetResponseEnvelopeSuccess
- type PreviewGetResponseItem
- type PreviewGetResponseItemOrigin
- type PreviewService
- type RandomSteering
- type RandomSteeringParam
- type RegionGetParamsRegionID
- type RegionGetResponseEnvelope
- type RegionGetResponseEnvelopeSuccess
- type RegionGetResponseUnion
- type RegionListParams
- type RegionListResponseEnvelope
- type RegionListResponseEnvelopeSuccess
- type RegionListResponseUnion
- type RegionService
- type ResponseInfo
- type Role
- type Rules
- type RulesFixedResponse
- type RulesFixedResponseParam
- type RulesOverrides
- type RulesOverridesParam
- type RulesParam
- type SearchGetParams
- type SearchGetParamsSearchParams
- type SearchGetParamsSearchParamsReferences
- type SearchGetResponse
- type SearchGetResponseEnvelope
- type SearchGetResponseEnvelopeResultInfo
- type SearchGetResponseEnvelopeSuccess
- type SearchService
- type SessionAffinity
- type SessionAffinityAttributes
- type SessionAffinityAttributesParam
- type SessionAffinityAttributesSamesite
- type SessionAffinityAttributesSecure
- type SessionAffinityAttributesZeroDowntimeFailover
- type SortDirection
- type SteeringPolicy
Constants ¶
const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin
This is an alias to an internal value.
const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare
This is an alias to an internal value.
const AuditLogActorTypeUser = shared.AuditLogActorTypeUser
This is an alias to an internal value.
const CertificateCADigicert = shared.CertificateCADigicert
This is an alias to an internal value.
const CertificateCAGoogle = shared.CertificateCAGoogle
This is an alias to an internal value.
const CertificateCALetsEncrypt = shared.CertificateCALetsEncrypt
This is an alias to an internal value.
const CertificateRequestTypeKeylessCertificate = shared.CertificateRequestTypeKeylessCertificate
This is an alias to an internal value.
const CertificateRequestTypeOriginECC = shared.CertificateRequestTypeOriginECC
This is an alias to an internal value.
const CertificateRequestTypeOriginRSA = shared.CertificateRequestTypeOriginRSA
This is an alias to an internal value.
const CloudflareTunnelStatusDegraded = shared.CloudflareTunnelStatusDegraded
This is an alias to an internal value.
const CloudflareTunnelStatusDown = shared.CloudflareTunnelStatusDown
This is an alias to an internal value.
const CloudflareTunnelStatusHealthy = shared.CloudflareTunnelStatusHealthy
This is an alias to an internal value.
const CloudflareTunnelStatusInactive = shared.CloudflareTunnelStatusInactive
This is an alias to an internal value.
const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI
This is an alias to an internal value.
const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel
This is an alias to an internal value.
const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE
This is an alias to an internal value.
const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec
This is an alias to an internal value.
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector
This is an alias to an internal value.
const MemberStatusAccepted = shared.MemberStatusAccepted
This is an alias to an internal value.
const MemberStatusPending = shared.MemberStatusPending
This is an alias to an internal value.
const SortDirectionAsc = shared.SortDirectionAsc
This is an alias to an internal value.
const SortDirectionDesc = shared.SortDirectionDesc
This is an alias to an internal value.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdaptiveRouting ¶
type AdaptiveRouting 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 adaptiveRoutingJSON `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 (*AdaptiveRouting) UnmarshalJSON ¶
func (r *AdaptiveRouting) UnmarshalJSON(data []byte) (err error)
type AdaptiveRoutingParam ¶
type AdaptiveRoutingParam 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 (AdaptiveRoutingParam) MarshalJSON ¶
func (r AdaptiveRoutingParam) MarshalJSON() (data []byte, err error)
type AuditLogAction ¶
type AuditLogAction = shared.AuditLogAction
This is an alias to an internal type.
type AuditLogActor ¶
type AuditLogActor = shared.AuditLogActor
This is an alias to an internal type.
type AuditLogActorType ¶
type AuditLogActorType = shared.AuditLogActorType
The type of actor, whether a User, Cloudflare Admin, or an Automated System.
This is an alias to an internal type.
type AuditLogOwner ¶
type AuditLogOwner = shared.AuditLogOwner
This is an alias to an internal type.
type AuditLogResource ¶
type AuditLogResource = shared.AuditLogResource
This is an alias to an internal type.
type CertificateCA ¶
type CertificateCA = shared.CertificateCA
The Certificate Authority that will issue the certificate
This is an alias to an internal type.
type CertificateRequestType ¶
type CertificateRequestType = shared.CertificateRequestType
Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).
This is an alias to an internal type.
type CheckRegion ¶
type CheckRegion 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 ( CheckRegionWnam CheckRegion = "WNAM" CheckRegionEnam CheckRegion = "ENAM" CheckRegionWeu CheckRegion = "WEU" CheckRegionEeu CheckRegion = "EEU" CheckRegionNsam CheckRegion = "NSAM" CheckRegionSsam CheckRegion = "SSAM" CheckRegionOc CheckRegion = "OC" CheckRegionMe CheckRegion = "ME" CheckRegionNaf CheckRegion = "NAF" CheckRegionSaf CheckRegion = "SAF" CheckRegionSas CheckRegion = "SAS" CheckRegionSeas CheckRegion = "SEAS" CheckRegionNeas CheckRegion = "NEAS" CheckRegionAllRegions CheckRegion = "ALL_REGIONS" )
func (CheckRegion) IsKnown ¶
func (r CheckRegion) IsKnown() bool
type CloudflareTunnel ¶
type CloudflareTunnel = shared.CloudflareTunnel
A Cloudflare Tunnel that connects your origin to Cloudflare's edge.
This is an alias to an internal type.
type CloudflareTunnelConnection ¶
type CloudflareTunnelConnection = shared.CloudflareTunnelConnection
This is an alias to an internal type.
type CloudflareTunnelStatus ¶
type CloudflareTunnelStatus = shared.CloudflareTunnelStatus
The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).
This is an alias to an internal type.
type CloudflareTunnelTunType ¶
type CloudflareTunnelTunType = shared.CloudflareTunnelTunType
The type of tunnel.
This is an alias to an internal type.
type DefaultPools ¶
type DefaultPools = string
type DefaultPoolsParam ¶
type DefaultPoolsParam = string
type FilterOptions ¶
type FilterOptions struct { // If set true, disable notifications for this type of resource (pool or origin). Disable 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 bool `json:"healthy,nullable"` JSON filterOptionsJSON `json:"-"` }
Filter options for a particular resource type (pool or origin). Use null to reset.
func (*FilterOptions) UnmarshalJSON ¶
func (r *FilterOptions) UnmarshalJSON(data []byte) (err error)
type FilterOptionsParam ¶
type FilterOptionsParam 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 (FilterOptionsParam) MarshalJSON ¶
func (r FilterOptionsParam) MarshalJSON() (data []byte, err error)
type Header ¶
type Header struct { // The 'Host' header allows to override the hostname set in the HTTP request. // Current support is 1 'Host' header override per origin. Host []Host `json:"Host"` JSON headerJSON `json:"-"` }
The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'.
func (*Header) UnmarshalJSON ¶
type HeaderParam ¶
type HeaderParam 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[[]HostParam] `json:"Host"` }
The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'.
func (HeaderParam) MarshalJSON ¶
func (r HeaderParam) MarshalJSON() (data []byte, err 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 AdaptiveRouting `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 []DefaultPools `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 LocationStrategy `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 RandomSteering `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 []Rules `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 SessionAffinity `json:"session_affinity"` // Configures attributes for session affinity. SessionAffinityAttributes SessionAffinityAttributes `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 SteeringPolicy `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 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 []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `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 LoadBalancerDeleteResponseEnvelopeSuccess ¶
type LoadBalancerDeleteResponseEnvelopeSuccess bool
Whether the API call was successful
const (
LoadBalancerDeleteResponseEnvelopeSuccessTrue LoadBalancerDeleteResponseEnvelopeSuccess = true
)
func (LoadBalancerDeleteResponseEnvelopeSuccess) IsKnown ¶
func (r LoadBalancerDeleteResponseEnvelopeSuccess) IsKnown() bool
type LoadBalancerEditParams ¶
type LoadBalancerEditParams 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[AdaptiveRoutingParam] `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[[]DefaultPoolsParam] `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[LocationStrategyParam] `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[RandomSteeringParam] `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[[]RulesParam] `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[SessionAffinity] `json:"session_affinity"` // Configures attributes for session affinity. SessionAffinityAttributes param.Field[SessionAffinityAttributesParam] `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[SteeringPolicy] `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 LoadBalancerEditResponseEnvelope ¶
type LoadBalancerEditResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `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 LoadBalancerEditResponseEnvelopeSuccess ¶
type LoadBalancerEditResponseEnvelopeSuccess bool
Whether the API call was successful
const (
LoadBalancerEditResponseEnvelopeSuccessTrue LoadBalancerEditResponseEnvelopeSuccess = true
)
func (LoadBalancerEditResponseEnvelopeSuccess) IsKnown ¶
func (r LoadBalancerEditResponseEnvelopeSuccess) IsKnown() bool
type LoadBalancerGetResponseEnvelope ¶
type LoadBalancerGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `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 LoadBalancerGetResponseEnvelopeSuccess ¶
type LoadBalancerGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
LoadBalancerGetResponseEnvelopeSuccessTrue LoadBalancerGetResponseEnvelopeSuccess = true
)
func (LoadBalancerGetResponseEnvelopeSuccess) IsKnown ¶
func (r LoadBalancerGetResponseEnvelopeSuccess) IsKnown() bool
type LoadBalancerNewParams ¶
type LoadBalancerNewParams struct { // 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[[]DefaultPoolsParam] `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[AdaptiveRoutingParam] `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[LocationStrategyParam] `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[RandomSteeringParam] `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[[]RulesParam] `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[SessionAffinity] `json:"session_affinity"` // Configures attributes for session affinity. SessionAffinityAttributes param.Field[SessionAffinityAttributesParam] `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[SteeringPolicy] `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 LoadBalancerNewResponseEnvelope ¶
type LoadBalancerNewResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `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 LoadBalancerNewResponseEnvelopeSuccess ¶
type LoadBalancerNewResponseEnvelopeSuccess bool
Whether the API call was successful
const (
LoadBalancerNewResponseEnvelopeSuccessTrue LoadBalancerNewResponseEnvelopeSuccess = true
)
func (LoadBalancerNewResponseEnvelopeSuccess) IsKnown ¶
func (r LoadBalancerNewResponseEnvelopeSuccess) IsKnown() bool
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 testcloudflare 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 ¶
func (r *LoadBalancerService) Delete(ctx context.Context, zoneID string, loadBalancerID string, opts ...option.RequestOption) (res *LoadBalancerDeleteResponse, err error)
Delete a configured load balancer.
func (*LoadBalancerService) Edit ¶
func (r *LoadBalancerService) Edit(ctx context.Context, zoneID string, loadBalancerID string, body 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, zoneID string, loadBalancerID string, opts ...option.RequestOption) (res *LoadBalancer, err error)
Fetch a single configured load balancer.
func (*LoadBalancerService) List ¶
func (r *LoadBalancerService) List(ctx context.Context, zoneID string, opts ...option.RequestOption) (res *pagination.SinglePage[LoadBalancer], err error)
List configured load balancers.
func (*LoadBalancerService) ListAutoPaging ¶
func (r *LoadBalancerService) ListAutoPaging(ctx context.Context, zoneID string, opts ...option.RequestOption) *pagination.SinglePageAutoPager[LoadBalancer]
List configured load balancers.
func (*LoadBalancerService) New ¶
func (r *LoadBalancerService) New(ctx context.Context, zoneID string, body LoadBalancerNewParams, opts ...option.RequestOption) (res *LoadBalancer, err error)
Create a new load balancer.
func (*LoadBalancerService) Update ¶
func (r *LoadBalancerService) Update(ctx context.Context, zoneID string, loadBalancerID string, body LoadBalancerUpdateParams, opts ...option.RequestOption) (res *LoadBalancer, err error)
Update a configured load balancer.
type LoadBalancerUpdateParams ¶
type LoadBalancerUpdateParams struct { // 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[[]DefaultPoolsParam] `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[AdaptiveRoutingParam] `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[LocationStrategyParam] `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[RandomSteeringParam] `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[[]RulesParam] `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[SessionAffinity] `json:"session_affinity"` // Configures attributes for session affinity. SessionAffinityAttributes param.Field[SessionAffinityAttributesParam] `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[SteeringPolicy] `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 LoadBalancerUpdateResponseEnvelope ¶
type LoadBalancerUpdateResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `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 LoadBalancerUpdateResponseEnvelopeSuccess ¶
type LoadBalancerUpdateResponseEnvelopeSuccess bool
Whether the API call was successful
const (
LoadBalancerUpdateResponseEnvelopeSuccessTrue LoadBalancerUpdateResponseEnvelopeSuccess = true
)
func (LoadBalancerUpdateResponseEnvelopeSuccess) IsKnown ¶
func (r LoadBalancerUpdateResponseEnvelopeSuccess) IsKnown() bool
type LoadShedding ¶
type LoadShedding 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 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 LoadSheddingDefaultPolicy `json:"default_policy"` // The percent of existing sessions to shed from the pool, according to the session // policy. SessionPercent float64 `json:"session_percent"` // Only the hash policy is supported for existing sessions (to avoid exponential // decay). SessionPolicy LoadSheddingSessionPolicy `json:"session_policy"` JSON loadSheddingJSON `json:"-"` }
Configures load shedding policies and percentages for the pool.
func (*LoadShedding) UnmarshalJSON ¶
func (r *LoadShedding) UnmarshalJSON(data []byte) (err error)
type LoadSheddingDefaultPolicy ¶
type LoadSheddingDefaultPolicy 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 ( LoadSheddingDefaultPolicyRandom LoadSheddingDefaultPolicy = "random" LoadSheddingDefaultPolicyHash LoadSheddingDefaultPolicy = "hash" )
func (LoadSheddingDefaultPolicy) IsKnown ¶
func (r LoadSheddingDefaultPolicy) IsKnown() bool
type LoadSheddingParam ¶
type LoadSheddingParam 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[LoadSheddingDefaultPolicy] `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[LoadSheddingSessionPolicy] `json:"session_policy"` }
Configures load shedding policies and percentages for the pool.
func (LoadSheddingParam) MarshalJSON ¶
func (r LoadSheddingParam) MarshalJSON() (data []byte, err error)
type LoadSheddingSessionPolicy ¶
type LoadSheddingSessionPolicy string
Only the hash policy is supported for existing sessions (to avoid exponential decay).
const (
LoadSheddingSessionPolicyHash LoadSheddingSessionPolicy = "hash"
)
func (LoadSheddingSessionPolicy) IsKnown ¶
func (r LoadSheddingSessionPolicy) IsKnown() bool
type LocationStrategy ¶
type LocationStrategy 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 LocationStrategyMode `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 LocationStrategyPreferECS `json:"prefer_ecs"` JSON locationStrategyJSON `json:"-"` }
Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected.
func (*LocationStrategy) UnmarshalJSON ¶
func (r *LocationStrategy) UnmarshalJSON(data []byte) (err error)
type LocationStrategyMode ¶
type LocationStrategyMode 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 ( LocationStrategyModePop LocationStrategyMode = "pop" LocationStrategyModeResolverIP LocationStrategyMode = "resolver_ip" )
func (LocationStrategyMode) IsKnown ¶
func (r LocationStrategyMode) IsKnown() bool
type LocationStrategyParam ¶
type LocationStrategyParam 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[LocationStrategyMode] `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[LocationStrategyPreferECS] `json:"prefer_ecs"` }
Controls location-based steering for non-proxied requests. See `steering_policy` to learn how steering is affected.
func (LocationStrategyParam) MarshalJSON ¶
func (r LocationStrategyParam) MarshalJSON() (data []byte, err error)
type LocationStrategyPreferECS ¶
type LocationStrategyPreferECS 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 ( LocationStrategyPreferECSAlways LocationStrategyPreferECS = "always" LocationStrategyPreferECSNever LocationStrategyPreferECS = "never" LocationStrategyPreferECSProximity LocationStrategyPreferECS = "proximity" LocationStrategyPreferECSGeo LocationStrategyPreferECS = "geo" )
func (LocationStrategyPreferECS) IsKnown ¶
func (r LocationStrategyPreferECS) IsKnown() bool
type MemberRoleParam ¶
type MemberRoleParam = shared.MemberRoleParam
This is an alias to an internal type.
type MemberRolesPermissionsParam ¶
type MemberRolesPermissionsParam = shared.MemberRolesPermissionsParam
This is an alias to an internal type.
type MemberStatus ¶
type MemberStatus = shared.MemberStatus
A member's status in the account.
This is an alias to an internal type.
type MemberUserParam ¶
type MemberUserParam = shared.MemberUserParam
Details of the user associated to the membership.
This is an alias to an internal type.
type Monitor ¶
type Monitor struct { ID string `json:"id"` // Do not validate the certificate when monitor use HTTPS. This parameter is // currently only valid for HTTP and HTTPS monitors. AllowInsecure bool `json:"allow_insecure"` // To be marked unhealthy the monitored origin must fail this healthcheck N // consecutive times. ConsecutiveDown int64 `json:"consecutive_down"` // To be marked healthy the monitored origin must pass this healthcheck N // consecutive times. ConsecutiveUp int64 `json:"consecutive_up"` CreatedOn time.Time `json:"created_on" format:"date-time"` // Object description. Description 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 string `json:"expected_body"` // The expected HTTP response code or code range of the health check. This // parameter is only valid for HTTP and HTTPS monitors. ExpectedCodes string `json:"expected_codes"` // Follow redirects if returned by the origin. This parameter is only valid for // HTTP and HTTPS monitors. FollowRedirects 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 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 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 string `json:"method"` ModifiedOn time.Time `json:"modified_on" format:"date-time"` // The endpoint path you want to conduct a health check against. This parameter is // only valid for HTTP and HTTPS monitors. Path 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 int64 `json:"port"` // Assign this monitor to emulate the specified zone while probing. This parameter // is only valid for HTTP and HTTPS monitors. ProbeZone 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 int64 `json:"retries"` // The timeout (in seconds) before marking the health check as failed. Timeout 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 MonitorType `json:"type"` JSON monitorJSON `json:"-"` }
func (*Monitor) UnmarshalJSON ¶
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 []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `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 MonitorDeleteResponseEnvelopeSuccess ¶
type MonitorDeleteResponseEnvelopeSuccess bool
Whether the API call was successful
const (
MonitorDeleteResponseEnvelopeSuccessTrue MonitorDeleteResponseEnvelopeSuccess = true
)
func (MonitorDeleteResponseEnvelopeSuccess) IsKnown ¶
func (r MonitorDeleteResponseEnvelopeSuccess) IsKnown() bool
type MonitorEditParams ¶
type MonitorEditParams struct { // 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" )
func (MonitorEditParamsType) IsKnown ¶
func (r MonitorEditParamsType) IsKnown() bool
type MonitorEditResponseEnvelope ¶
type MonitorEditResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result Monitor `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 MonitorEditResponseEnvelopeSuccess ¶
type MonitorEditResponseEnvelopeSuccess bool
Whether the API call was successful
const (
MonitorEditResponseEnvelopeSuccessTrue MonitorEditResponseEnvelopeSuccess = true
)
func (MonitorEditResponseEnvelopeSuccess) IsKnown ¶
func (r MonitorEditResponseEnvelopeSuccess) IsKnown() bool
type MonitorGetResponseEnvelope ¶
type MonitorGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result Monitor `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 MonitorGetResponseEnvelopeSuccess ¶
type MonitorGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
MonitorGetResponseEnvelopeSuccessTrue MonitorGetResponseEnvelopeSuccess = true
)
func (MonitorGetResponseEnvelopeSuccess) IsKnown ¶
func (r MonitorGetResponseEnvelopeSuccess) IsKnown() bool
type MonitorNewParams ¶
type MonitorNewParams struct { // 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" )
func (MonitorNewParamsType) IsKnown ¶
func (r MonitorNewParamsType) IsKnown() bool
type MonitorNewResponseEnvelope ¶
type MonitorNewResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result Monitor `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 MonitorNewResponseEnvelopeSuccess ¶
type MonitorNewResponseEnvelopeSuccess bool
Whether the API call was successful
const (
MonitorNewResponseEnvelopeSuccessTrue MonitorNewResponseEnvelopeSuccess = true
)
func (MonitorNewResponseEnvelopeSuccess) IsKnown ¶
func (r MonitorNewResponseEnvelopeSuccess) IsKnown() bool
type MonitorPreviewNewParams ¶
type MonitorPreviewNewParams struct { // 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" )
func (MonitorPreviewNewParamsType) IsKnown ¶
func (r MonitorPreviewNewParamsType) IsKnown() bool
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 []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `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 MonitorPreviewNewResponseEnvelopeSuccess ¶
type MonitorPreviewNewResponseEnvelopeSuccess bool
Whether the API call was successful
const (
MonitorPreviewNewResponseEnvelopeSuccessTrue MonitorPreviewNewResponseEnvelopeSuccess = true
)
func (MonitorPreviewNewResponseEnvelopeSuccess) IsKnown ¶
func (r MonitorPreviewNewResponseEnvelopeSuccess) IsKnown() bool
type MonitorPreviewService ¶
type MonitorPreviewService struct {
Options []option.RequestOption
}
MonitorPreviewService contains methods and other services that help with interacting with the testcloudflare 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 ¶
func (r *MonitorPreviewService) New(ctx context.Context, accountID string, monitorID string, body MonitorPreviewNewParams, opts ...option.RequestOption) (res *MonitorPreviewNewResponse, err error)
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 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 []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `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 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
)
func (MonitorReferenceGetResponseEnvelopeSuccess) IsKnown ¶
func (r MonitorReferenceGetResponseEnvelopeSuccess) IsKnown() bool
type MonitorReferenceGetResponseReferenceType ¶
type MonitorReferenceGetResponseReferenceType string
const ( MonitorReferenceGetResponseReferenceTypeStar MonitorReferenceGetResponseReferenceType = "*" MonitorReferenceGetResponseReferenceTypeReferral MonitorReferenceGetResponseReferenceType = "referral" MonitorReferenceGetResponseReferenceTypeReferrer MonitorReferenceGetResponseReferenceType = "referrer" )
func (MonitorReferenceGetResponseReferenceType) IsKnown ¶
func (r MonitorReferenceGetResponseReferenceType) IsKnown() bool
type MonitorReferenceService ¶
type MonitorReferenceService struct {
Options []option.RequestOption
}
MonitorReferenceService contains methods and other services that help with interacting with the testcloudflare 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 ¶
func (r *MonitorReferenceService) Get(ctx context.Context, accountID string, monitorID string, opts ...option.RequestOption) (res *[]MonitorReferenceGetResponse, err error)
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 testcloudflare 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, accountID string, monitorID string, opts ...option.RequestOption) (res *MonitorDeleteResponse, err error)
Delete a configured monitor.
func (*MonitorService) Edit ¶
func (r *MonitorService) Edit(ctx context.Context, accountID string, monitorID string, body MonitorEditParams, opts ...option.RequestOption) (res *Monitor, err error)
Apply changes to an existing monitor, overwriting the supplied properties.
func (*MonitorService) Get ¶
func (r *MonitorService) Get(ctx context.Context, accountID string, monitorID string, opts ...option.RequestOption) (res *Monitor, err error)
List a single configured monitor for an account.
func (*MonitorService) List ¶
func (r *MonitorService) List(ctx context.Context, accountID string, opts ...option.RequestOption) (res *pagination.SinglePage[Monitor], err error)
List configured monitors for an account.
func (*MonitorService) ListAutoPaging ¶
func (r *MonitorService) ListAutoPaging(ctx context.Context, accountID string, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Monitor]
List configured monitors for an account.
func (*MonitorService) New ¶
func (r *MonitorService) New(ctx context.Context, accountID string, body MonitorNewParams, opts ...option.RequestOption) (res *Monitor, err error)
Create a configured monitor.
func (*MonitorService) Update ¶
func (r *MonitorService) Update(ctx context.Context, accountID string, monitorID string, body MonitorUpdateParams, opts ...option.RequestOption) (res *Monitor, err error)
Modify a configured monitor.
type MonitorType ¶
type MonitorType string
The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
const ( MonitorTypeHTTP MonitorType = "http" MonitorTypeHTTPS MonitorType = "https" MonitorTypeTCP MonitorType = "tcp" MonitorTypeUdpIcmp MonitorType = "udp_icmp" MonitorTypeIcmpPing MonitorType = "icmp_ping" MonitorTypeSmtp MonitorType = "smtp" )
func (MonitorType) IsKnown ¶
func (r MonitorType) IsKnown() bool
type MonitorUpdateParams ¶
type MonitorUpdateParams struct { // 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" )
func (MonitorUpdateParamsType) IsKnown ¶
func (r MonitorUpdateParamsType) IsKnown() bool
type MonitorUpdateResponseEnvelope ¶
type MonitorUpdateResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result Monitor `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 MonitorUpdateResponseEnvelopeSuccess ¶
type MonitorUpdateResponseEnvelopeSuccess bool
Whether the API call was successful
const (
MonitorUpdateResponseEnvelopeSuccessTrue MonitorUpdateResponseEnvelopeSuccess = true
)
func (MonitorUpdateResponseEnvelopeSuccess) IsKnown ¶
func (r MonitorUpdateResponseEnvelopeSuccess) IsKnown() bool
type NotificationFilter ¶
type NotificationFilter struct { // Filter options for a particular resource type (pool or origin). Use null to // reset. Origin FilterOptions `json:"origin,nullable"` // Filter options for a particular resource type (pool or origin). Use null to // reset. Pool FilterOptions `json:"pool,nullable"` JSON notificationFilterJSON `json:"-"` }
Filter pool and origin health notifications by resource type or health status. Use null to reset.
func (*NotificationFilter) UnmarshalJSON ¶
func (r *NotificationFilter) UnmarshalJSON(data []byte) (err error)
type NotificationFilterParam ¶
type NotificationFilterParam struct { // Filter options for a particular resource type (pool or origin). Use null to // reset. Origin param.Field[FilterOptionsParam] `json:"origin"` // Filter options for a particular resource type (pool or origin). Use null to // reset. Pool param.Field[FilterOptionsParam] `json:"pool"` }
Filter pool and origin health notifications by resource type or health status. Use null to reset.
func (NotificationFilterParam) MarshalJSON ¶
func (r NotificationFilterParam) MarshalJSON() (data []byte, err error)
type Origin ¶
type Origin 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 string `json:"address"` // This field shows up only if the origin is disabled. This field is set with the // time the origin was disabled. DisabledAt time.Time `json:"disabled_at" format:"date-time"` // 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 bool `json:"enabled"` // The request header is used to pass additional information with an HTTP request. // Currently supported header is 'Host'. Header Header `json:"header"` // A human-identifiable name for the origin. Name string `json:"name"` // The virtual network subnet ID the origin belongs in. Virtual network must also // belong to the account. VirtualNetworkID 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 float64 `json:"weight"` JSON originJSON `json:"-"` }
func (*Origin) UnmarshalJSON ¶
type OriginParam ¶
type OriginParam 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[HeaderParam] `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 (OriginParam) MarshalJSON ¶
func (r OriginParam) MarshalJSON() (data []byte, err error)
type OriginSteering ¶
type OriginSteering 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 OriginSteeringPolicy `json:"policy"` JSON originSteeringJSON `json:"-"` }
Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity.
func (*OriginSteering) UnmarshalJSON ¶
func (r *OriginSteering) UnmarshalJSON(data []byte) (err error)
type OriginSteeringParam ¶
type OriginSteeringParam 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[OriginSteeringPolicy] `json:"policy"` }
Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity.
func (OriginSteeringParam) MarshalJSON ¶
func (r OriginSteeringParam) MarshalJSON() (data []byte, err error)
type OriginSteeringPolicy ¶
type OriginSteeringPolicy 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 ( OriginSteeringPolicyRandom OriginSteeringPolicy = "random" OriginSteeringPolicyHash OriginSteeringPolicy = "hash" OriginSteeringPolicyLeastOutstandingRequests OriginSteeringPolicy = "least_outstanding_requests" OriginSteeringPolicyLeastConnections OriginSteeringPolicy = "least_connections" )
func (OriginSteeringPolicy) IsKnown ¶
func (r OriginSteeringPolicy) IsKnown() bool
type PermissionGrant ¶
type PermissionGrant = shared.PermissionGrant
This is an alias to an internal type.
type PermissionGrantParam ¶
type PermissionGrantParam = shared.PermissionGrantParam
This is an alias to an internal type.
type Pool ¶
type Pool struct { ID string `json:"id"` // A list of regions from which to run health checks. Null means every Cloudflare // data center. CheckRegions []CheckRegion `json:"check_regions,nullable"` CreatedOn time.Time `json:"created_on" format:"date-time"` // A human-readable description of the pool. Description string `json:"description"` // This field shows up only if the pool is disabled. This field is set with the // time the pool was disabled at. DisabledAt time.Time `json:"disabled_at" format:"date-time"` // 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 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 float64 `json:"latitude"` // Configures load shedding policies and percentages for the pool. LoadShedding LoadShedding `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 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 int64 `json:"minimum_origins"` ModifiedOn time.Time `json:"modified_on" format:"date-time"` // The ID of the Monitor to use for checking the health of origins within this // pool. Monitor interface{} `json:"monitor"` // A short name (tag) for the pool. Only alphanumeric characters, hyphens, and // underscores are allowed. Name 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 string `json:"notification_email"` // Filter pool and origin health notifications by resource type or health status. // Use null to reset. NotificationFilter NotificationFilter `json:"notification_filter,nullable"` // Configures origin steering for the pool. Controls how origins are selected for // new sessions and traffic without session affinity. OriginSteering OriginSteering `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 []Origin `json:"origins"` JSON poolJSON `json:"-"` }
func (*Pool) UnmarshalJSON ¶
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 []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `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 PoolDeleteResponseEnvelopeSuccess ¶
type PoolDeleteResponseEnvelopeSuccess bool
Whether the API call was successful
const (
PoolDeleteResponseEnvelopeSuccessTrue PoolDeleteResponseEnvelopeSuccess = true
)
func (PoolDeleteResponseEnvelopeSuccess) IsKnown ¶
func (r PoolDeleteResponseEnvelopeSuccess) IsKnown() bool
type PoolEditParams ¶
type PoolEditParams struct { // A list of regions from which to run health checks. Null means every Cloudflare // data center. CheckRegions param.Field[[]CheckRegion] `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[LoadSheddingParam] `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[NotificationFilterParam] `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[OriginSteeringParam] `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[[]OriginParam] `json:"origins"` }
func (PoolEditParams) MarshalJSON ¶
func (r PoolEditParams) MarshalJSON() (data []byte, err error)
type PoolEditResponseEnvelope ¶
type PoolEditResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result Pool `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 PoolEditResponseEnvelopeSuccess ¶
type PoolEditResponseEnvelopeSuccess bool
Whether the API call was successful
const (
PoolEditResponseEnvelopeSuccessTrue PoolEditResponseEnvelopeSuccess = true
)
func (PoolEditResponseEnvelopeSuccess) IsKnown ¶
func (r PoolEditResponseEnvelopeSuccess) IsKnown() bool
type PoolGetResponseEnvelope ¶
type PoolGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result Pool `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 PoolGetResponseEnvelopeSuccess ¶
type PoolGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
PoolGetResponseEnvelopeSuccessTrue PoolGetResponseEnvelopeSuccess = true
)
func (PoolGetResponseEnvelopeSuccess) IsKnown ¶
func (r PoolGetResponseEnvelopeSuccess) IsKnown() bool
type PoolHealthGetResponseEnvelope ¶
type PoolHealthGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` // A list of regions from which to run health checks. Null means every Cloudflare // data center. Result PoolHealthGetResponseUnion `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 PoolHealthGetResponseEnvelopeSuccess ¶
type PoolHealthGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
PoolHealthGetResponseEnvelopeSuccessTrue PoolHealthGetResponseEnvelopeSuccess = true
)
func (PoolHealthGetResponseEnvelopeSuccess) IsKnown ¶
func (r PoolHealthGetResponseEnvelopeSuccess) IsKnown() bool
type PoolHealthGetResponseUnion ¶
type PoolHealthGetResponseUnion interface {
ImplementsLoadBalancersPoolHealthGetResponseUnion()
}
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 PoolHealthNewParams ¶
type PoolHealthNewParams struct { // 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" )
func (PoolHealthNewParamsType) IsKnown ¶
func (r PoolHealthNewParamsType) IsKnown() bool
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 []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `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 PoolHealthNewResponseEnvelopeSuccess ¶
type PoolHealthNewResponseEnvelopeSuccess bool
Whether the API call was successful
const (
PoolHealthNewResponseEnvelopeSuccessTrue PoolHealthNewResponseEnvelopeSuccess = true
)
func (PoolHealthNewResponseEnvelopeSuccess) IsKnown ¶
func (r PoolHealthNewResponseEnvelopeSuccess) IsKnown() bool
type PoolHealthService ¶
type PoolHealthService struct {
Options []option.RequestOption
}
PoolHealthService contains methods and other services that help with interacting with the testcloudflare 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 ¶
func (r *PoolHealthService) Get(ctx context.Context, accountID string, poolID string, opts ...option.RequestOption) (res *PoolHealthGetResponseUnion, err error)
Fetch the latest pool health status for a single pool.
func (*PoolHealthService) New ¶
func (r *PoolHealthService) New(ctx context.Context, accountID string, poolID string, body PoolHealthNewParams, opts ...option.RequestOption) (res *PoolHealthNewResponse, err error)
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 { // 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 PoolNewParams ¶
type PoolNewParams struct { // 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[[]OriginParam] `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[LoadSheddingParam] `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[NotificationFilterParam] `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[OriginSteeringParam] `json:"origin_steering"` }
func (PoolNewParams) MarshalJSON ¶
func (r PoolNewParams) MarshalJSON() (data []byte, err error)
type PoolNewResponseEnvelope ¶
type PoolNewResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result Pool `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 PoolNewResponseEnvelopeSuccess ¶
type PoolNewResponseEnvelopeSuccess bool
Whether the API call was successful
const (
PoolNewResponseEnvelopeSuccessTrue PoolNewResponseEnvelopeSuccess = true
)
func (PoolNewResponseEnvelopeSuccess) IsKnown ¶
func (r PoolNewResponseEnvelopeSuccess) IsKnown() bool
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 []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `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 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
)
func (PoolReferenceGetResponseEnvelopeSuccess) IsKnown ¶
func (r PoolReferenceGetResponseEnvelopeSuccess) IsKnown() bool
type PoolReferenceGetResponseReferenceType ¶
type PoolReferenceGetResponseReferenceType string
const ( PoolReferenceGetResponseReferenceTypeStar PoolReferenceGetResponseReferenceType = "*" PoolReferenceGetResponseReferenceTypeReferral PoolReferenceGetResponseReferenceType = "referral" PoolReferenceGetResponseReferenceTypeReferrer PoolReferenceGetResponseReferenceType = "referrer" )
func (PoolReferenceGetResponseReferenceType) IsKnown ¶
func (r PoolReferenceGetResponseReferenceType) IsKnown() bool
type PoolReferenceService ¶
type PoolReferenceService struct {
Options []option.RequestOption
}
PoolReferenceService contains methods and other services that help with interacting with the testcloudflare 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 ¶
func (r *PoolReferenceService) Get(ctx context.Context, accountID string, poolID string, opts ...option.RequestOption) (res *[]PoolReferenceGetResponse, err error)
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 testcloudflare 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, accountID string, poolID string, opts ...option.RequestOption) (res *PoolDeleteResponse, err error)
Delete a configured pool.
func (*PoolService) Edit ¶
func (r *PoolService) Edit(ctx context.Context, accountID string, poolID string, body PoolEditParams, opts ...option.RequestOption) (res *Pool, err error)
Apply changes to an existing pool, overwriting the supplied properties.
func (*PoolService) Get ¶
func (r *PoolService) Get(ctx context.Context, accountID string, poolID string, opts ...option.RequestOption) (res *Pool, err error)
Fetch a single configured pool.
func (*PoolService) List ¶
func (r *PoolService) List(ctx context.Context, accountID string, query PoolListParams, opts ...option.RequestOption) (res *pagination.SinglePage[Pool], err error)
List configured pools.
func (*PoolService) ListAutoPaging ¶
func (r *PoolService) ListAutoPaging(ctx context.Context, accountID string, query PoolListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Pool]
List configured pools.
func (*PoolService) New ¶
func (r *PoolService) New(ctx context.Context, accountID string, body PoolNewParams, opts ...option.RequestOption) (res *Pool, err error)
Create a new pool.
func (*PoolService) Update ¶
func (r *PoolService) Update(ctx context.Context, accountID string, poolID string, body PoolUpdateParams, opts ...option.RequestOption) (res *Pool, err error)
Modify a configured pool.
type PoolUpdateParams ¶
type PoolUpdateParams struct { // 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[[]OriginParam] `json:"origins,required"` // A list of regions from which to run health checks. Null means every Cloudflare // data center. CheckRegions param.Field[[]CheckRegion] `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[LoadSheddingParam] `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[NotificationFilterParam] `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[OriginSteeringParam] `json:"origin_steering"` }
func (PoolUpdateParams) MarshalJSON ¶
func (r PoolUpdateParams) MarshalJSON() (data []byte, err error)
type PoolUpdateResponseEnvelope ¶
type PoolUpdateResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result Pool `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 PoolUpdateResponseEnvelopeSuccess ¶
type PoolUpdateResponseEnvelopeSuccess bool
Whether the API call was successful
const (
PoolUpdateResponseEnvelopeSuccessTrue PoolUpdateResponseEnvelopeSuccess = true
)
func (PoolUpdateResponseEnvelopeSuccess) IsKnown ¶
func (r PoolUpdateResponseEnvelopeSuccess) IsKnown() bool
type PreviewGetResponse ¶
type PreviewGetResponse map[string]PreviewGetResponseItem
type PreviewGetResponseEnvelope ¶
type PreviewGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` // Resulting health data from a preview operation. Result PreviewGetResponse `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 PreviewGetResponseEnvelopeSuccess ¶
type PreviewGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
PreviewGetResponseEnvelopeSuccessTrue PreviewGetResponseEnvelopeSuccess = true
)
func (PreviewGetResponseEnvelopeSuccess) IsKnown ¶
func (r PreviewGetResponseEnvelopeSuccess) IsKnown() bool
type PreviewGetResponseItem ¶
type PreviewGetResponseItem struct { Healthy bool `json:"healthy"` Origins []map[string]PreviewGetResponseItemOrigin `json:"origins"` JSON previewGetResponseItemJSON `json:"-"` }
func (*PreviewGetResponseItem) UnmarshalJSON ¶
func (r *PreviewGetResponseItem) UnmarshalJSON(data []byte) (err error)
type PreviewGetResponseItemOrigin ¶
type PreviewGetResponseItemOrigin struct { FailureReason string `json:"failure_reason"` Healthy bool `json:"healthy"` ResponseCode float64 `json:"response_code"` RTT string `json:"rtt"` JSON previewGetResponseItemOriginJSON `json:"-"` }
The origin ipv4/ipv6 address or domain name mapped to it's health data.
func (*PreviewGetResponseItemOrigin) UnmarshalJSON ¶
func (r *PreviewGetResponseItemOrigin) UnmarshalJSON(data []byte) (err error)
type PreviewService ¶
type PreviewService struct {
Options []option.RequestOption
}
PreviewService contains methods and other services that help with interacting with the testcloudflare 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, accountID string, previewID string, opts ...option.RequestOption) (res *PreviewGetResponse, err error)
Get the result of a previous preview operation using the provided preview_id.
type RandomSteering ¶
type RandomSteering 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 randomSteeringJSON `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 (*RandomSteering) UnmarshalJSON ¶
func (r *RandomSteering) UnmarshalJSON(data []byte) (err error)
type RandomSteeringParam ¶
type RandomSteeringParam 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 (RandomSteeringParam) MarshalJSON ¶
func (r RandomSteeringParam) MarshalJSON() (data []byte, err error)
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" )
func (RegionGetParamsRegionID) IsKnown ¶
func (r RegionGetParamsRegionID) IsKnown() bool
type RegionGetResponseEnvelope ¶
type RegionGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` // A list of countries and subdivisions mapped to a region. Result RegionGetResponseUnion `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 RegionGetResponseEnvelopeSuccess ¶
type RegionGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
RegionGetResponseEnvelopeSuccessTrue RegionGetResponseEnvelopeSuccess = true
)
func (RegionGetResponseEnvelopeSuccess) IsKnown ¶
func (r RegionGetResponseEnvelopeSuccess) IsKnown() bool
type RegionGetResponseUnion ¶
type RegionGetResponseUnion interface {
ImplementsLoadBalancersRegionGetResponseUnion()
}
A list of countries and subdivisions mapped to a region.
Union satisfied by load_balancers.RegionGetResponseUnknown or shared.UnionString.
type RegionListParams ¶
type RegionListParams struct { // 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 RegionListResponseEnvelope ¶
type RegionListResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result RegionListResponseUnion `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 RegionListResponseEnvelopeSuccess ¶
type RegionListResponseEnvelopeSuccess bool
Whether the API call was successful
const (
RegionListResponseEnvelopeSuccessTrue RegionListResponseEnvelopeSuccess = true
)
func (RegionListResponseEnvelopeSuccess) IsKnown ¶
func (r RegionListResponseEnvelopeSuccess) IsKnown() bool
type RegionListResponseUnion ¶
type RegionListResponseUnion interface {
ImplementsLoadBalancersRegionListResponseUnion()
}
Union satisfied by load_balancers.RegionListResponseUnknown or shared.UnionString.
type RegionService ¶
type RegionService struct {
Options []option.RequestOption
}
RegionService contains methods and other services that help with interacting with the testcloudflare 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 ¶
func (r *RegionService) Get(ctx context.Context, accountID string, regionID RegionGetParamsRegionID, opts ...option.RequestOption) (res *RegionGetResponseUnion, err error)
Get a single region mapping.
func (*RegionService) List ¶
func (r *RegionService) List(ctx context.Context, accountID string, query RegionListParams, opts ...option.RequestOption) (res *RegionListResponseUnion, err error)
List all region mappings.
type Rules ¶
type Rules 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 RulesFixedResponse `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 RulesOverrides `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 rulesJSON `json:"-"` }
A rule object containing conditions and overrides for this load balancer to evaluate.
func (*Rules) UnmarshalJSON ¶
type RulesFixedResponse ¶
type RulesFixedResponse 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 rulesFixedResponseJSON `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 (*RulesFixedResponse) UnmarshalJSON ¶
func (r *RulesFixedResponse) UnmarshalJSON(data []byte) (err error)
type RulesFixedResponseParam ¶
type RulesFixedResponseParam 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 (RulesFixedResponseParam) MarshalJSON ¶
func (r RulesFixedResponseParam) MarshalJSON() (data []byte, err error)
type RulesOverrides ¶
type RulesOverrides 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 AdaptiveRouting `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 []DefaultPools `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 LocationStrategy `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 RandomSteering `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 SessionAffinity `json:"session_affinity"` // Configures attributes for session affinity. SessionAffinityAttributes SessionAffinityAttributes `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 SteeringPolicy `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 rulesOverridesJSON `json:"-"` }
A collection of overrides to apply to the load balancer when this rule's condition is true. All fields are optional.
func (*RulesOverrides) UnmarshalJSON ¶
func (r *RulesOverrides) UnmarshalJSON(data []byte) (err error)
type RulesOverridesParam ¶
type RulesOverridesParam 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[AdaptiveRoutingParam] `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[[]DefaultPoolsParam] `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[LocationStrategyParam] `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[RandomSteeringParam] `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[SessionAffinity] `json:"session_affinity"` // Configures attributes for session affinity. SessionAffinityAttributes param.Field[SessionAffinityAttributesParam] `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[SteeringPolicy] `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 (RulesOverridesParam) MarshalJSON ¶
func (r RulesOverridesParam) MarshalJSON() (data []byte, err error)
type RulesParam ¶
type RulesParam 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[RulesFixedResponseParam] `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[RulesOverridesParam] `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 (RulesParam) MarshalJSON ¶
func (r RulesParam) MarshalJSON() (data []byte, err error)
type SearchGetParams ¶
type SearchGetParams struct { 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" )
func (SearchGetParamsSearchParamsReferences) IsKnown ¶
func (r SearchGetParamsSearchParamsReferences) IsKnown() bool
type SearchGetResponse ¶
type SearchGetResponse = interface{}
type SearchGetResponseEnvelope ¶
type SearchGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `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 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
)
func (SearchGetResponseEnvelopeSuccess) IsKnown ¶
func (r SearchGetResponseEnvelopeSuccess) IsKnown() bool
type SearchService ¶
type SearchService struct {
Options []option.RequestOption
}
SearchService contains methods and other services that help with interacting with the testcloudflare 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, accountID string, query SearchGetParams, opts ...option.RequestOption) (res *[]SearchGetResponse, err error)
Search for Load Balancing resources.
type SessionAffinity ¶
type SessionAffinity 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 ( SessionAffinityNone SessionAffinity = "none" SessionAffinityCookie SessionAffinity = "cookie" SessionAffinityIPCookie SessionAffinity = "ip_cookie" SessionAffinityHeader SessionAffinity = "header" SessionAffinityEmpty SessionAffinity = "\"\"" )
func (SessionAffinity) IsKnown ¶
func (r SessionAffinity) IsKnown() bool
type SessionAffinityAttributes ¶
type SessionAffinityAttributes 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 SessionAffinityAttributesSamesite `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 SessionAffinityAttributesSecure `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 SessionAffinityAttributesZeroDowntimeFailover `json:"zero_downtime_failover"` JSON sessionAffinityAttributesJSON `json:"-"` }
Configures attributes for session affinity.
func (*SessionAffinityAttributes) UnmarshalJSON ¶
func (r *SessionAffinityAttributes) UnmarshalJSON(data []byte) (err error)
type SessionAffinityAttributesParam ¶
type SessionAffinityAttributesParam 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[SessionAffinityAttributesSamesite] `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[SessionAffinityAttributesSecure] `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[SessionAffinityAttributesZeroDowntimeFailover] `json:"zero_downtime_failover"` }
Configures attributes for session affinity.
func (SessionAffinityAttributesParam) MarshalJSON ¶
func (r SessionAffinityAttributesParam) MarshalJSON() (data []byte, err error)
type SessionAffinityAttributesSamesite ¶
type SessionAffinityAttributesSamesite 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 ( SessionAffinityAttributesSamesiteAuto SessionAffinityAttributesSamesite = "Auto" SessionAffinityAttributesSamesiteLax SessionAffinityAttributesSamesite = "Lax" SessionAffinityAttributesSamesiteNone SessionAffinityAttributesSamesite = "None" SessionAffinityAttributesSamesiteStrict SessionAffinityAttributesSamesite = "Strict" )
func (SessionAffinityAttributesSamesite) IsKnown ¶
func (r SessionAffinityAttributesSamesite) IsKnown() bool
type SessionAffinityAttributesSecure ¶
type SessionAffinityAttributesSecure 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 ( SessionAffinityAttributesSecureAuto SessionAffinityAttributesSecure = "Auto" SessionAffinityAttributesSecureAlways SessionAffinityAttributesSecure = "Always" SessionAffinityAttributesSecureNever SessionAffinityAttributesSecure = "Never" )
func (SessionAffinityAttributesSecure) IsKnown ¶
func (r SessionAffinityAttributesSecure) IsKnown() bool
type SessionAffinityAttributesZeroDowntimeFailover ¶
type SessionAffinityAttributesZeroDowntimeFailover 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 ( SessionAffinityAttributesZeroDowntimeFailoverNone SessionAffinityAttributesZeroDowntimeFailover = "none" SessionAffinityAttributesZeroDowntimeFailoverTemporary SessionAffinityAttributesZeroDowntimeFailover = "temporary" SessionAffinityAttributesZeroDowntimeFailoverSticky SessionAffinityAttributesZeroDowntimeFailover = "sticky" )
func (SessionAffinityAttributesZeroDowntimeFailover) IsKnown ¶
func (r SessionAffinityAttributesZeroDowntimeFailover) IsKnown() bool
type SortDirection ¶
type SortDirection = shared.SortDirection
Direction to order DNS records in.
This is an alias to an internal type.
type SteeringPolicy ¶
type SteeringPolicy 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 ( SteeringPolicyOff SteeringPolicy = "off" SteeringPolicyGeo SteeringPolicy = "geo" SteeringPolicyRandom SteeringPolicy = "random" SteeringPolicyDynamicLatency SteeringPolicy = "dynamic_latency" SteeringPolicyProximity SteeringPolicy = "proximity" SteeringPolicyLeastOutstandingRequests SteeringPolicy = "least_outstanding_requests" SteeringPolicyLeastConnections SteeringPolicy = "least_connections" SteeringPolicyEmpty SteeringPolicy = "\"\"" )
func (SteeringPolicy) IsKnown ¶
func (r SteeringPolicy) IsKnown() bool