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 ErrorDataSource
- type FilterOptions
- type FilterOptionsParam
- type Header
- type HeaderParam
- type Host
- type HostParam
- type LoadBalancer
- type LoadBalancerDeleteParams
- type LoadBalancerDeleteResponse
- type LoadBalancerDeleteResponseEnvelope
- type LoadBalancerDeleteResponseEnvelopeSuccess
- type LoadBalancerEditParams
- type LoadBalancerEditResponseEnvelope
- type LoadBalancerEditResponseEnvelopeSuccess
- type LoadBalancerGetParams
- type LoadBalancerGetResponseEnvelope
- type LoadBalancerGetResponseEnvelopeSuccess
- type LoadBalancerListParams
- type LoadBalancerNewParams
- type LoadBalancerNewResponseEnvelope
- type LoadBalancerNewResponseEnvelopeSuccess
- type LoadBalancerService
- func (r *LoadBalancerService) Delete(ctx context.Context, loadBalancerID string, body LoadBalancerDeleteParams, ...) (res *LoadBalancerDeleteResponse, err error)
- func (r *LoadBalancerService) Edit(ctx context.Context, loadBalancerID string, params LoadBalancerEditParams, ...) (res *LoadBalancer, err error)
- func (r *LoadBalancerService) Get(ctx context.Context, loadBalancerID string, query LoadBalancerGetParams, ...) (res *LoadBalancer, err error)
- func (r *LoadBalancerService) List(ctx context.Context, query LoadBalancerListParams, ...) (res *pagination.SinglePage[LoadBalancer], err error)
- func (r *LoadBalancerService) ListAutoPaging(ctx context.Context, query LoadBalancerListParams, ...) *pagination.SinglePageAutoPager[LoadBalancer]
- func (r *LoadBalancerService) New(ctx context.Context, params LoadBalancerNewParams, ...) (res *LoadBalancer, err error)
- func (r *LoadBalancerService) Update(ctx context.Context, loadBalancerID string, params LoadBalancerUpdateParams, ...) (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 Member
- type MemberPoliciesAccess
- type MemberPoliciesPermissionGroup
- type MemberPoliciesPermissionGroupsMeta
- type MemberPoliciesResourceGroup
- type MemberPoliciesResourceGroupsMeta
- type MemberPoliciesResourceGroupsScope
- type MemberPoliciesResourceGroupsScopeObject
- type MemberPolicy
- type MemberStatus
- type MemberUser
- type Monitor
- type MonitorDeleteParams
- type MonitorDeleteResponse
- type MonitorDeleteResponseEnvelope
- type MonitorDeleteResponseEnvelopeSuccess
- type MonitorEditParams
- type MonitorEditParamsType
- type MonitorEditResponseEnvelope
- type MonitorEditResponseEnvelopeSuccess
- type MonitorGetParams
- type MonitorGetResponseEnvelope
- type MonitorGetResponseEnvelopeSuccess
- type MonitorListParams
- type MonitorNewParams
- type MonitorNewParamsType
- type MonitorNewResponseEnvelope
- type MonitorNewResponseEnvelopeSuccess
- type MonitorPreviewNewParams
- type MonitorPreviewNewParamsType
- type MonitorPreviewNewResponse
- type MonitorPreviewNewResponseEnvelope
- type MonitorPreviewNewResponseEnvelopeSuccess
- type MonitorPreviewService
- type MonitorReferenceGetParams
- type MonitorReferenceGetResponse
- type MonitorReferenceGetResponseReferenceType
- type MonitorReferenceService
- func (r *MonitorReferenceService) Get(ctx context.Context, monitorID string, query MonitorReferenceGetParams, ...) (res *pagination.SinglePage[MonitorReferenceGetResponse], err error)
- func (r *MonitorReferenceService) GetAutoPaging(ctx context.Context, monitorID string, query MonitorReferenceGetParams, ...) *pagination.SinglePageAutoPager[MonitorReferenceGetResponse]
- type MonitorService
- func (r *MonitorService) Delete(ctx context.Context, monitorID string, body MonitorDeleteParams, ...) (res *MonitorDeleteResponse, err error)
- func (r *MonitorService) Edit(ctx context.Context, monitorID string, params MonitorEditParams, ...) (res *Monitor, err error)
- func (r *MonitorService) Get(ctx context.Context, monitorID string, query MonitorGetParams, ...) (res *Monitor, err error)
- func (r *MonitorService) List(ctx context.Context, query MonitorListParams, opts ...option.RequestOption) (res *pagination.SinglePage[Monitor], err error)
- func (r *MonitorService) ListAutoPaging(ctx context.Context, query MonitorListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Monitor]
- func (r *MonitorService) New(ctx context.Context, params MonitorNewParams, opts ...option.RequestOption) (res *Monitor, err error)
- func (r *MonitorService) Update(ctx context.Context, monitorID string, params MonitorUpdateParams, ...) (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 PoolBulkEditParams
- type PoolBulkEditParamsNotificationEmail
- type PoolDeleteParams
- type PoolDeleteResponse
- type PoolDeleteResponseEnvelope
- type PoolDeleteResponseEnvelopeSuccess
- type PoolEditParams
- type PoolEditResponseEnvelope
- type PoolEditResponseEnvelopeSuccess
- type PoolGetParams
- type PoolGetResponseEnvelope
- type PoolGetResponseEnvelopeSuccess
- type PoolHealthGetParams
- type PoolHealthGetResponse
- type PoolHealthGetResponseEnvelope
- type PoolHealthGetResponseEnvelopeSuccess
- type PoolHealthGetResponsePOPHealth
- type PoolHealthGetResponsePOPHealthOrigin
- type PoolHealthGetResponsePOPHealthOriginsIP
- type PoolHealthNewParams
- type PoolHealthNewParamsType
- type PoolHealthNewResponse
- type PoolHealthNewResponseEnvelope
- type PoolHealthNewResponseEnvelopeSuccess
- type PoolHealthService
- type PoolListParams
- type PoolNewParams
- type PoolNewResponseEnvelope
- type PoolNewResponseEnvelopeSuccess
- type PoolReferenceGetParams
- type PoolReferenceGetResponse
- type PoolReferenceGetResponseReferenceType
- type PoolReferenceService
- func (r *PoolReferenceService) Get(ctx context.Context, poolID string, query PoolReferenceGetParams, ...) (res *pagination.SinglePage[PoolReferenceGetResponse], err error)
- func (r *PoolReferenceService) GetAutoPaging(ctx context.Context, poolID string, query PoolReferenceGetParams, ...) *pagination.SinglePageAutoPager[PoolReferenceGetResponse]
- type PoolService
- func (r *PoolService) BulkEdit(ctx context.Context, params PoolBulkEditParams, opts ...option.RequestOption) (res *pagination.SinglePage[Pool], err error)
- func (r *PoolService) BulkEditAutoPaging(ctx context.Context, params PoolBulkEditParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Pool]
- func (r *PoolService) Delete(ctx context.Context, poolID string, body PoolDeleteParams, ...) (res *PoolDeleteResponse, err error)
- func (r *PoolService) Edit(ctx context.Context, poolID string, params PoolEditParams, ...) (res *Pool, err error)
- func (r *PoolService) Get(ctx context.Context, poolID string, query PoolGetParams, ...) (res *Pool, err error)
- func (r *PoolService) List(ctx context.Context, params PoolListParams, opts ...option.RequestOption) (res *pagination.SinglePage[Pool], err error)
- func (r *PoolService) ListAutoPaging(ctx context.Context, params PoolListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Pool]
- func (r *PoolService) New(ctx context.Context, params PoolNewParams, opts ...option.RequestOption) (res *Pool, err error)
- func (r *PoolService) Update(ctx context.Context, poolID string, params PoolUpdateParams, ...) (res *Pool, err error)
- type PoolUpdateParams
- type PoolUpdateResponseEnvelope
- type PoolUpdateResponseEnvelopeSuccess
- type PreviewGetParams
- type PreviewGetResponse
- type PreviewGetResponseEnvelope
- type PreviewGetResponseEnvelopeSuccess
- type PreviewGetResponseItem
- type PreviewGetResponseItemOrigin
- type PreviewService
- type RandomSteering
- type RandomSteeringParam
- type RatePlan
- type RatePlanID
- type RatePlanParam
- type RegionGetParams
- type RegionGetParamsRegionID
- type RegionGetResponseEnvelope
- type RegionGetResponseEnvelopeSuccess
- type RegionListParams
- type RegionListResponseEnvelope
- type RegionListResponseEnvelopeSuccess
- type RegionService
- type ResponseInfo
- type Role
- type RoleParam
- type RolePermissions
- type RolePermissionsParam
- type Rules
- type RulesFixedResponse
- type RulesFixedResponseParam
- type RulesOverrides
- type RulesOverridesParam
- type RulesParam
- type SearchListParams
- type SearchListParamsSearchParams
- type SearchListParamsSearchParamsReferences
- type SearchListResponse
- type SearchListResponseResource
- type SearchListResponseResourcesReferenceType
- type SearchListResponseResourcesResourceType
- type SearchService
- func (r *SearchService) List(ctx context.Context, params SearchListParams, opts ...option.RequestOption) (res *pagination.V4PagePagination[SearchListResponse], err error)
- func (r *SearchService) ListAutoPaging(ctx context.Context, params SearchListParams, opts ...option.RequestOption) *pagination.V4PagePaginationAutoPager[SearchListResponse]
- type SessionAffinity
- type SessionAffinityAttributes
- type SessionAffinityAttributesParam
- type SessionAffinityAttributesSamesite
- type SessionAffinityAttributesSecure
- type SessionAffinityAttributesZeroDowntimeFailover
- type SortDirection
- type SteeringPolicy
- type Subscription
- type SubscriptionFrequency
- type SubscriptionParam
- type SubscriptionState
- type Token
- type TokenCondition
- type TokenConditionCIDRList
- type TokenConditionCIDRListParam
- type TokenConditionParam
- type TokenConditionRequestIP
- type TokenConditionRequestIPParam
- type TokenParam
- type TokenPolicy
- type TokenPolicyEffect
- type TokenPolicyParam
- type TokenPolicyPermissionGroup
- type TokenPolicyPermissionGroupParam
- type TokenPolicyPermissionGroupsMeta
- type TokenPolicyPermissionGroupsMetaParam
- type TokenStatus
- type TokenValue
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 CertificateCASSLCom = shared.CertificateCASSLCom
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 CloudflareTunnelTunTypeMagic = shared.CloudflareTunnelTunTypeMagic
This is an alias to an internal value.
const CloudflareTunnelTunTypeWARP = shared.CloudflareTunnelTunTypeWARP
This is an alias to an internal value.
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector
This is an alias to an internal value.
const MemberPoliciesAccessAllow = shared.MemberPoliciesAccessAllow
This is an alias to an internal value.
const MemberPoliciesAccessDeny = shared.MemberPoliciesAccessDeny
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 RatePlanIDBusiness = shared.RatePlanIDBusiness
This is an alias to an internal value.
const RatePlanIDEnterprise = shared.RatePlanIDEnterprise
This is an alias to an internal value.
const RatePlanIDFree = shared.RatePlanIDFree
This is an alias to an internal value.
const RatePlanIDLite = shared.RatePlanIDLite
This is an alias to an internal value.
const RatePlanIDPartnersBusiness = shared.RatePlanIDPartnersBusiness
This is an alias to an internal value.
const RatePlanIDPartnersEnterprise = shared.RatePlanIDPartnersEnterprise
This is an alias to an internal value.
const RatePlanIDPartnersFree = shared.RatePlanIDPartnersFree
This is an alias to an internal value.
const RatePlanIDPartnersPro = shared.RatePlanIDPartnersPro
This is an alias to an internal value.
const RatePlanIDPro = shared.RatePlanIDPro
This is an alias to an internal value.
const RatePlanIDProPlus = shared.RatePlanIDProPlus
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.
const SubscriptionFrequencyMonthly = shared.SubscriptionFrequencyMonthly
This is an alias to an internal value.
const SubscriptionFrequencyQuarterly = shared.SubscriptionFrequencyQuarterly
This is an alias to an internal value.
const SubscriptionFrequencyWeekly = shared.SubscriptionFrequencyWeekly
This is an alias to an internal value.
const SubscriptionFrequencyYearly = shared.SubscriptionFrequencyYearly
This is an alias to an internal value.
const SubscriptionStateAwaitingPayment = shared.SubscriptionStateAwaitingPayment
This is an alias to an internal value.
const SubscriptionStateCancelled = shared.SubscriptionStateCancelled
This is an alias to an internal value.
const SubscriptionStateExpired = shared.SubscriptionStateExpired
This is an alias to an internal value.
const SubscriptionStateFailed = shared.SubscriptionStateFailed
This is an alias to an internal value.
const SubscriptionStatePaid = shared.SubscriptionStatePaid
This is an alias to an internal value.
const SubscriptionStateProvisioned = shared.SubscriptionStateProvisioned
This is an alias to an internal value.
const SubscriptionStateTrial = shared.SubscriptionStateTrial
This is an alias to an internal value.
const TokenPolicyEffectAllow = shared.TokenPolicyEffectAllow
This is an alias to an internal value.
const TokenPolicyEffectDeny = shared.TokenPolicyEffectDeny
This is an alias to an internal value.
const TokenStatusActive = shared.TokenStatusActive
This is an alias to an internal value.
const TokenStatusDisabled = shared.TokenStatusDisabled
This is an alias to an internal value.
const TokenStatusExpired = shared.TokenStatusExpired
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 ErrorDataSource ¶ added in v4.2.0
type ErrorDataSource = shared.ErrorDataSource
This is an alias to an internal type.
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 map[string][]string `json:"country_pools"`
CreatedOn string `json:"created_on"`
// 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 string `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 string `json:"modified_on"`
// 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"`
// List of networks where Load Balancer or Pool is enabled.
Networks []string `json:"networks"`
// (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 map[string][]string `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 map[string][]string `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"`. 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"`
ZoneName string `json:"zone_name"`
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 {
ZoneID param.Field[string] `path:"zone_id,required"`
// Controls features that modify the routing of requests to pools and origins in
// response to dynamic conditions, such as during the interval between active
// health monitoring requests. For example, zero-downtime failover occurs
// immediately when an origin becomes unavailable due to HTTP 521, 522, or 523
// response codes. If there is another healthy origin in the same pool, the request
// is retried once against this alternate origin.
AdaptiveRouting param.Field[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[map[string][]string] `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[string] `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[map[string][]string] `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[map[string][]string] `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"`. 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 LoadBalancerGetParams ¶
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 LoadBalancerListParams ¶
type LoadBalancerNewParams ¶
type LoadBalancerNewParams struct {
ZoneID param.Field[string] `path:"zone_id,required"`
// A list of pool IDs ordered by their failover priority. Pools defined here are
// used by default, or when region_pools are not configured for a given region.
DefaultPools param.Field[[]DefaultPoolsParam] `json:"default_pools,required"`
// The pool ID to use when all other pools are detected as unhealthy.
FallbackPool param.Field[string] `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[map[string][]string] `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"`
// List of networks where Load Balancer or Pool is enabled.
Networks param.Field[[]string] `json:"networks"`
// (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[map[string][]string] `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[map[string][]string] `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"`. 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 cloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewLoadBalancerService method instead.
func NewLoadBalancerService ¶
func NewLoadBalancerService(opts ...option.RequestOption) (r *LoadBalancerService)
NewLoadBalancerService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*LoadBalancerService) Delete ¶
func (r *LoadBalancerService) Delete(ctx context.Context, loadBalancerID string, body LoadBalancerDeleteParams, opts ...option.RequestOption) (res *LoadBalancerDeleteResponse, err error)
Delete a configured load balancer.
func (*LoadBalancerService) Edit ¶
func (r *LoadBalancerService) Edit(ctx context.Context, loadBalancerID string, params LoadBalancerEditParams, opts ...option.RequestOption) (res *LoadBalancer, err error)
Apply changes to an existing load balancer, overwriting the supplied properties.
func (*LoadBalancerService) Get ¶
func (r *LoadBalancerService) Get(ctx context.Context, loadBalancerID string, query LoadBalancerGetParams, opts ...option.RequestOption) (res *LoadBalancer, err error)
Fetch a single configured load balancer.
func (*LoadBalancerService) List ¶
func (r *LoadBalancerService) List(ctx context.Context, query LoadBalancerListParams, opts ...option.RequestOption) (res *pagination.SinglePage[LoadBalancer], err error)
List configured load balancers.
func (*LoadBalancerService) ListAutoPaging ¶
func (r *LoadBalancerService) ListAutoPaging(ctx context.Context, query LoadBalancerListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[LoadBalancer]
List configured load balancers.
func (*LoadBalancerService) New ¶
func (r *LoadBalancerService) New(ctx context.Context, params LoadBalancerNewParams, opts ...option.RequestOption) (res *LoadBalancer, err error)
Create a new load balancer.
func (*LoadBalancerService) Update ¶
func (r *LoadBalancerService) Update(ctx context.Context, loadBalancerID string, params LoadBalancerUpdateParams, opts ...option.RequestOption) (res *LoadBalancer, err error)
Update a configured load balancer.
type LoadBalancerUpdateParams ¶
type LoadBalancerUpdateParams struct {
ZoneID param.Field[string] `path:"zone_id,required"`
// A list of pool IDs ordered by their failover priority. Pools defined here are
// used by default, or when region_pools are not configured for a given region.
DefaultPools param.Field[[]DefaultPoolsParam] `json:"default_pools,required"`
// The pool ID to use when all other pools are detected as unhealthy.
FallbackPool param.Field[string] `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[map[string][]string] `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"`
// List of networks where Load Balancer or Pool is enabled.
Networks param.Field[[]string] `json:"networks"`
// (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[map[string][]string] `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[map[string][]string] `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"`. 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 MemberPoliciesAccess ¶
type MemberPoliciesAccess = shared.MemberPoliciesAccess
Allow or deny operations against the resources.
This is an alias to an internal type.
type MemberPoliciesPermissionGroup ¶
type MemberPoliciesPermissionGroup = shared.MemberPoliciesPermissionGroup
A named group of permissions that map to a group of operations against resources.
This is an alias to an internal type.
type MemberPoliciesPermissionGroupsMeta ¶
type MemberPoliciesPermissionGroupsMeta = shared.MemberPoliciesPermissionGroupsMeta
Attributes associated to the permission group.
This is an alias to an internal type.
type MemberPoliciesResourceGroup ¶
type MemberPoliciesResourceGroup = shared.MemberPoliciesResourceGroup
A group of scoped resources.
This is an alias to an internal type.
type MemberPoliciesResourceGroupsMeta ¶
type MemberPoliciesResourceGroupsMeta = shared.MemberPoliciesResourceGroupsMeta
Attributes associated to the resource group.
This is an alias to an internal type.
type MemberPoliciesResourceGroupsScope ¶
type MemberPoliciesResourceGroupsScope = shared.MemberPoliciesResourceGroupsScope
A scope is a combination of scope objects which provides additional context.
This is an alias to an internal type.
type MemberPoliciesResourceGroupsScopeObject ¶
type MemberPoliciesResourceGroupsScopeObject = shared.MemberPoliciesResourceGroupsScopeObject
A scope object represents any resource that can have actions applied against invite.
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 MemberUser ¶
type MemberUser = shared.MemberUser
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 string `json:"created_on"`
// 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 map[string][]string `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 string `json:"modified_on"`
// 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 MonitorDeleteParams ¶
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 {
// Identifier
AccountID param.Field[string] `path:"account_id,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"`
// 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"`
// 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[map[string][]string] `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 MonitorGetParams ¶
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 MonitorListParams ¶
type MonitorNewParams ¶
type MonitorNewParams struct {
// Identifier
AccountID param.Field[string] `path:"account_id,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"`
// 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"`
// 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[map[string][]string] `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 {
// Identifier
AccountID param.Field[string] `path:"account_id,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"`
// 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"`
// 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[map[string][]string] `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 cloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMonitorPreviewService method instead.
func NewMonitorPreviewService ¶
func NewMonitorPreviewService(opts ...option.RequestOption) (r *MonitorPreviewService)
NewMonitorPreviewService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*MonitorPreviewService) New ¶
func (r *MonitorPreviewService) New(ctx context.Context, monitorID string, params 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 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 cloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMonitorReferenceService method instead.
func NewMonitorReferenceService ¶
func NewMonitorReferenceService(opts ...option.RequestOption) (r *MonitorReferenceService)
NewMonitorReferenceService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*MonitorReferenceService) Get ¶
func (r *MonitorReferenceService) Get(ctx context.Context, monitorID string, query MonitorReferenceGetParams, opts ...option.RequestOption) (res *pagination.SinglePage[MonitorReferenceGetResponse], err error)
Get the list of resources that reference the provided monitor.
func (*MonitorReferenceService) GetAutoPaging ¶ added in v4.1.0
func (r *MonitorReferenceService) GetAutoPaging(ctx context.Context, monitorID string, query MonitorReferenceGetParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[MonitorReferenceGetResponse]
Get the list of resources that reference the provided monitor.
type MonitorService ¶
type MonitorService struct {
Options []option.RequestOption
Previews *MonitorPreviewService
References *MonitorReferenceService
}
MonitorService contains methods and other services that help with interacting with the cloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMonitorService method instead.
func NewMonitorService ¶
func NewMonitorService(opts ...option.RequestOption) (r *MonitorService)
NewMonitorService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*MonitorService) Delete ¶
func (r *MonitorService) Delete(ctx context.Context, monitorID string, body MonitorDeleteParams, opts ...option.RequestOption) (res *MonitorDeleteResponse, err error)
Delete a configured monitor.
func (*MonitorService) Edit ¶
func (r *MonitorService) Edit(ctx context.Context, monitorID string, params MonitorEditParams, opts ...option.RequestOption) (res *Monitor, err error)
Apply changes to an existing monitor, overwriting the supplied properties.
func (*MonitorService) Get ¶
func (r *MonitorService) Get(ctx context.Context, monitorID string, query MonitorGetParams, opts ...option.RequestOption) (res *Monitor, err error)
List a single configured monitor for an account.
func (*MonitorService) List ¶
func (r *MonitorService) List(ctx context.Context, query MonitorListParams, 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, query MonitorListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Monitor]
List configured monitors for an account.
func (*MonitorService) New ¶
func (r *MonitorService) New(ctx context.Context, params MonitorNewParams, opts ...option.RequestOption) (res *Monitor, err error)
Create a configured monitor.
func (*MonitorService) Update ¶
func (r *MonitorService) Update(ctx context.Context, monitorID string, params 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 {
// Identifier
AccountID param.Field[string] `path:"account_id,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"`
// 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"`
// 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[map[string][]string] `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 string `json:"created_on"`
// 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 string `json:"modified_on"`
// The ID of the Monitor to use for checking the health of origins within this
// pool.
Monitor string `json:"monitor"`
// A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
// underscores are allowed.
Name string `json:"name"`
// List of networks where Load Balancer or Pool is enabled.
Networks []string `json:"networks"`
// 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 PoolBulkEditParams ¶
type PoolBulkEditParams struct {
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
// The email address to send health status notifications to. This field is now
// deprecated in favor of Cloudflare Notifications for Load Balancing, so only
// resetting this field with an empty string `""` is accepted.
NotificationEmail param.Field[PoolBulkEditParamsNotificationEmail] `json:"notification_email"`
}
func (PoolBulkEditParams) MarshalJSON ¶
func (r PoolBulkEditParams) MarshalJSON() (data []byte, err error)
type PoolBulkEditParamsNotificationEmail ¶
type PoolBulkEditParamsNotificationEmail string
The email address to send health status notifications to. This field is now deprecated in favor of Cloudflare Notifications for Load Balancing, so only resetting this field with an empty string `""` is accepted.
const (
PoolBulkEditParamsNotificationEmailEmpty PoolBulkEditParamsNotificationEmail = ""
)
func (PoolBulkEditParamsNotificationEmail) IsKnown ¶
func (r PoolBulkEditParamsNotificationEmail) IsKnown() bool
type PoolDeleteParams ¶
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 {
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
// A list of regions from which to run health checks. Null means every Cloudflare
// data center.
CheckRegions param.Field[[]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[string] `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 PoolGetParams ¶
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 PoolHealthGetParams ¶
type PoolHealthGetResponse ¶
type PoolHealthGetResponse struct {
// Pool ID
PoolID string `json:"pool_id"`
// List of regions and associated health status.
POPHealth PoolHealthGetResponsePOPHealth `json:"pop_health"`
JSON poolHealthGetResponseJSON `json:"-"`
}
A list of regions from which to run health checks. Null means every Cloudflare data center.
func (*PoolHealthGetResponse) UnmarshalJSON ¶
func (r *PoolHealthGetResponse) UnmarshalJSON(data []byte) (err error)
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 PoolHealthGetResponse `json:"result,required"`
// Whether the API call was successful
Success PoolHealthGetResponseEnvelopeSuccess `json:"success,required"`
JSON poolHealthGetResponseEnvelopeJSON `json:"-"`
}
func (*PoolHealthGetResponseEnvelope) UnmarshalJSON ¶
func (r *PoolHealthGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type PoolHealthGetResponseEnvelopeSuccess ¶
type PoolHealthGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
PoolHealthGetResponseEnvelopeSuccessTrue PoolHealthGetResponseEnvelopeSuccess = true
)
func (PoolHealthGetResponseEnvelopeSuccess) IsKnown ¶
func (r PoolHealthGetResponseEnvelopeSuccess) IsKnown() bool
type PoolHealthGetResponsePOPHealth ¶
type PoolHealthGetResponsePOPHealth struct {
// Whether health check in region is healthy.
Healthy bool `json:"healthy"`
Origins []PoolHealthGetResponsePOPHealthOrigin `json:"origins"`
JSON poolHealthGetResponsePOPHealthJSON `json:"-"`
}
List of regions and associated health status.
func (*PoolHealthGetResponsePOPHealth) UnmarshalJSON ¶
func (r *PoolHealthGetResponsePOPHealth) UnmarshalJSON(data []byte) (err error)
type PoolHealthGetResponsePOPHealthOrigin ¶
type PoolHealthGetResponsePOPHealthOrigin struct {
IP PoolHealthGetResponsePOPHealthOriginsIP `json:"ip"`
JSON poolHealthGetResponsePOPHealthOriginJSON `json:"-"`
}
func (*PoolHealthGetResponsePOPHealthOrigin) UnmarshalJSON ¶
func (r *PoolHealthGetResponsePOPHealthOrigin) UnmarshalJSON(data []byte) (err error)
type PoolHealthGetResponsePOPHealthOriginsIP ¶
type PoolHealthGetResponsePOPHealthOriginsIP struct {
// Failure reason.
FailureReason string `json:"failure_reason"`
// Origin health status.
Healthy bool `json:"healthy"`
// Response code from origin health check.
ResponseCode float64 `json:"response_code"`
// Origin RTT (Round Trip Time) response.
RTT string `json:"rtt"`
JSON poolHealthGetResponsePOPHealthOriginsIPJSON `json:"-"`
}
func (*PoolHealthGetResponsePOPHealthOriginsIP) UnmarshalJSON ¶
func (r *PoolHealthGetResponsePOPHealthOriginsIP) UnmarshalJSON(data []byte) (err error)
type PoolHealthNewParams ¶
type PoolHealthNewParams struct {
// Identifier
AccountID param.Field[string] `path:"account_id,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"`
// 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"`
// 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[map[string][]string] `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 cloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPoolHealthService method instead.
func NewPoolHealthService ¶
func NewPoolHealthService(opts ...option.RequestOption) (r *PoolHealthService)
NewPoolHealthService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PoolHealthService) Get ¶
func (r *PoolHealthService) Get(ctx context.Context, poolID string, query PoolHealthGetParams, opts ...option.RequestOption) (res *PoolHealthGetResponse, err error)
Fetch the latest pool health status for a single pool.
func (*PoolHealthService) New ¶
func (r *PoolHealthService) New(ctx context.Context, poolID string, params 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 {
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
// The ID of the Monitor to use for checking the health of origins within this
// pool.
Monitor param.Field[string] `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 {
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
// A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
// underscores are allowed.
Name param.Field[string] `json:"name,required"`
// The list of origins within this pool. Traffic directed at this pool is balanced
// across all currently healthy origins, provided the pool itself is healthy.
Origins param.Field[[]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[string] `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 PoolReferenceGetParams ¶
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 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 cloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPoolReferenceService method instead.
func NewPoolReferenceService ¶
func NewPoolReferenceService(opts ...option.RequestOption) (r *PoolReferenceService)
NewPoolReferenceService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PoolReferenceService) Get ¶
func (r *PoolReferenceService) Get(ctx context.Context, poolID string, query PoolReferenceGetParams, opts ...option.RequestOption) (res *pagination.SinglePage[PoolReferenceGetResponse], err error)
Get the list of resources that reference the provided pool.
func (*PoolReferenceService) GetAutoPaging ¶ added in v4.1.0
func (r *PoolReferenceService) GetAutoPaging(ctx context.Context, poolID string, query PoolReferenceGetParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[PoolReferenceGetResponse]
Get the list of resources that reference the provided pool.
type PoolService ¶
type PoolService struct {
Options []option.RequestOption
Health *PoolHealthService
References *PoolReferenceService
}
PoolService contains methods and other services that help with interacting with the cloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPoolService method instead.
func NewPoolService ¶
func NewPoolService(opts ...option.RequestOption) (r *PoolService)
NewPoolService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PoolService) BulkEdit ¶
func (r *PoolService) BulkEdit(ctx context.Context, params PoolBulkEditParams, opts ...option.RequestOption) (res *pagination.SinglePage[Pool], err error)
Apply changes to a number of existing pools, overwriting the supplied properties. Pools are ordered by ascending `name`. Returns the list of affected pools. Supports the standard pagination query parameters, either `limit`/`offset` or `per_page`/`page`.
func (*PoolService) BulkEditAutoPaging ¶ added in v4.1.0
func (r *PoolService) BulkEditAutoPaging(ctx context.Context, params PoolBulkEditParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Pool]
Apply changes to a number of existing pools, overwriting the supplied properties. Pools are ordered by ascending `name`. Returns the list of affected pools. Supports the standard pagination query parameters, either `limit`/`offset` or `per_page`/`page`.
func (*PoolService) Delete ¶
func (r *PoolService) Delete(ctx context.Context, poolID string, body PoolDeleteParams, opts ...option.RequestOption) (res *PoolDeleteResponse, err error)
Delete a configured pool.
func (*PoolService) Edit ¶
func (r *PoolService) Edit(ctx context.Context, poolID string, params PoolEditParams, opts ...option.RequestOption) (res *Pool, err error)
Apply changes to an existing pool, overwriting the supplied properties.
func (*PoolService) Get ¶
func (r *PoolService) Get(ctx context.Context, poolID string, query PoolGetParams, opts ...option.RequestOption) (res *Pool, err error)
Fetch a single configured pool.
func (*PoolService) List ¶
func (r *PoolService) List(ctx context.Context, params PoolListParams, opts ...option.RequestOption) (res *pagination.SinglePage[Pool], err error)
List configured pools.
func (*PoolService) ListAutoPaging ¶
func (r *PoolService) ListAutoPaging(ctx context.Context, params PoolListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Pool]
List configured pools.
func (*PoolService) New ¶
func (r *PoolService) New(ctx context.Context, params PoolNewParams, opts ...option.RequestOption) (res *Pool, err error)
Create a new pool.
func (*PoolService) Update ¶
func (r *PoolService) Update(ctx context.Context, poolID string, params PoolUpdateParams, opts ...option.RequestOption) (res *Pool, err error)
Modify a configured pool.
type PoolUpdateParams ¶
type PoolUpdateParams struct {
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
// A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
// underscores are allowed.
Name param.Field[string] `json:"name,required"`
// The list of origins within this pool. Traffic directed at this pool is balanced
// across all currently healthy origins, provided the pool itself is healthy.
Origins param.Field[[]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[string] `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 PreviewGetParams ¶
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 cloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPreviewService method instead.
func NewPreviewService ¶
func NewPreviewService(opts ...option.RequestOption) (r *PreviewService)
NewPreviewService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PreviewService) Get ¶
func (r *PreviewService) Get(ctx context.Context, previewID string, query PreviewGetParams, 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 map[string]float64 `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[map[string]float64] `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 RatePlanID ¶ added in v4.1.0
type RatePlanID = shared.RatePlanID
The ID of the rate plan.
This is an alias to an internal type.
type RatePlanParam ¶
type RatePlanParam = shared.RatePlanParam
The rate plan applied to the subscription.
This is an alias to an internal type.
type RegionGetParams ¶
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 interface{} `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 RegionListParams ¶
type RegionListParams struct {
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
// Two-letter alpha-2 country code followed in ISO 3166-1.
CountryCodeA2 param.Field[string] `query:"country_code_a2"`
// Two-letter subdivision code followed in ISO 3166-2.
SubdivisionCode param.Field[string] `query:"subdivision_code"`
// Two-letter subdivision code followed in ISO 3166-2.
SubdivisionCodeA2 param.Field[string] `query:"subdivision_code_a2"`
}
func (RegionListParams) URLQuery ¶
func (r RegionListParams) URLQuery() (v url.Values)
URLQuery serializes RegionListParams's query parameters as `url.Values`.
type RegionListResponseEnvelope ¶
type RegionListResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result interface{} `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 RegionService ¶
type RegionService struct {
Options []option.RequestOption
}
RegionService contains methods and other services that help with interacting with the cloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRegionService method instead.
func NewRegionService ¶
func NewRegionService(opts ...option.RequestOption) (r *RegionService)
NewRegionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*RegionService) Get ¶
func (r *RegionService) Get(ctx context.Context, regionID RegionGetParamsRegionID, query RegionGetParams, opts ...option.RequestOption) (res *interface{}, err error)
Get a single region mapping.
func (*RegionService) List ¶
func (r *RegionService) List(ctx context.Context, params RegionListParams, opts ...option.RequestOption) (res *interface{}, err error)
List all region mappings.
type RolePermissions ¶
type RolePermissions = shared.RolePermissions
This is an alias to an internal type.
type RolePermissionsParam ¶
type RolePermissionsParam = shared.RolePermissionsParam
This is an alias to an internal type.
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 map[string][]string `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 string `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 map[string][]string `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 map[string][]string `json:"region_pools"`
// Specifies the type of session affinity the load balancer should use unless
// specified as `"none"`. 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[map[string][]string] `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[string] `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[map[string][]string] `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[map[string][]string] `json:"region_pools"`
// Specifies the type of session affinity the load balancer should use unless
// specified as `"none"`. 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 SearchListParams ¶ added in v4.1.0
type SearchListParams struct {
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
Page param.Field[float64] `query:"page"`
PerPage param.Field[float64] `query:"per_page"`
SearchParams param.Field[SearchListParamsSearchParams] `query:"search_params"`
}
func (SearchListParams) URLQuery ¶ added in v4.1.0
func (r SearchListParams) URLQuery() (v url.Values)
URLQuery serializes SearchListParams's query parameters as `url.Values`.
type SearchListParamsSearchParams ¶ added in v4.1.0
type SearchListParamsSearchParams struct {
// Search query term.
Query param.Field[string] `query:"query"`
// The type of references to include ("\*" for all).
References param.Field[SearchListParamsSearchParamsReferences] `query:"references"`
}
func (SearchListParamsSearchParams) URLQuery ¶ added in v4.1.0
func (r SearchListParamsSearchParams) URLQuery() (v url.Values)
URLQuery serializes SearchListParamsSearchParams's query parameters as `url.Values`.
type SearchListParamsSearchParamsReferences ¶ added in v4.1.0
type SearchListParamsSearchParamsReferences string
The type of references to include ("\*" for all).
const ( SearchListParamsSearchParamsReferencesEmpty SearchListParamsSearchParamsReferences = "" SearchListParamsSearchParamsReferencesStar SearchListParamsSearchParamsReferences = "*" SearchListParamsSearchParamsReferencesReferral SearchListParamsSearchParamsReferences = "referral" SearchListParamsSearchParamsReferencesReferrer SearchListParamsSearchParamsReferences = "referrer" )
func (SearchListParamsSearchParamsReferences) IsKnown ¶ added in v4.1.0
func (r SearchListParamsSearchParamsReferences) IsKnown() bool
type SearchListResponse ¶ added in v4.1.0
type SearchListResponse struct {
// A list of resources matching the search query.
Resources []SearchListResponseResource `json:"resources"`
JSON searchListResponseJSON `json:"-"`
}
func (*SearchListResponse) UnmarshalJSON ¶ added in v4.1.0
func (r *SearchListResponse) UnmarshalJSON(data []byte) (err error)
type SearchListResponseResource ¶ added in v4.1.0
type SearchListResponseResource struct {
// When listed as a reference, the type (direction) of the reference.
ReferenceType SearchListResponseResourcesReferenceType `json:"reference_type"`
// A list of references to (referrer) or from (referral) this resource.
References []interface{} `json:"references"`
ResourceID string `json:"resource_id"`
// The human-identifiable name of the resource.
ResourceName string `json:"resource_name"`
// The type of the resource.
ResourceType SearchListResponseResourcesResourceType `json:"resource_type"`
JSON searchListResponseResourceJSON `json:"-"`
}
A reference to a load balancer resource.
func (*SearchListResponseResource) UnmarshalJSON ¶ added in v4.1.0
func (r *SearchListResponseResource) UnmarshalJSON(data []byte) (err error)
type SearchListResponseResourcesReferenceType ¶ added in v4.1.0
type SearchListResponseResourcesReferenceType string
When listed as a reference, the type (direction) of the reference.
const ( SearchListResponseResourcesReferenceTypeReferral SearchListResponseResourcesReferenceType = "referral" SearchListResponseResourcesReferenceTypeReferrer SearchListResponseResourcesReferenceType = "referrer" )
func (SearchListResponseResourcesReferenceType) IsKnown ¶ added in v4.1.0
func (r SearchListResponseResourcesReferenceType) IsKnown() bool
type SearchListResponseResourcesResourceType ¶ added in v4.1.0
type SearchListResponseResourcesResourceType string
The type of the resource.
const ( SearchListResponseResourcesResourceTypeLoadBalancer SearchListResponseResourcesResourceType = "load_balancer" SearchListResponseResourcesResourceTypeMonitor SearchListResponseResourcesResourceType = "monitor" SearchListResponseResourcesResourceTypePool SearchListResponseResourcesResourceType = "pool" )
func (SearchListResponseResourcesResourceType) IsKnown ¶ added in v4.1.0
func (r SearchListResponseResourcesResourceType) IsKnown() bool
type SearchService ¶
type SearchService struct {
Options []option.RequestOption
}
SearchService contains methods and other services that help with interacting with the cloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSearchService method instead.
func NewSearchService ¶
func NewSearchService(opts ...option.RequestOption) (r *SearchService)
NewSearchService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SearchService) List ¶ added in v4.1.0
func (r *SearchService) List(ctx context.Context, params SearchListParams, opts ...option.RequestOption) (res *pagination.V4PagePagination[SearchListResponse], err error)
Search for Load Balancing resources.
func (*SearchService) ListAutoPaging ¶ added in v4.1.0
func (r *SearchService) ListAutoPaging(ctx context.Context, params SearchListParams, opts ...option.RequestOption) *pagination.V4PagePaginationAutoPager[SearchListResponse]
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"`. 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" )
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
type SubscriptionFrequency ¶
type SubscriptionFrequency = shared.SubscriptionFrequency
How often the subscription is renewed automatically.
This is an alias to an internal type.
type SubscriptionParam ¶
type SubscriptionParam = shared.SubscriptionParam
This is an alias to an internal type.
type SubscriptionState ¶
type SubscriptionState = shared.SubscriptionState
The state that the subscription is in.
This is an alias to an internal type.
type TokenCondition ¶
type TokenCondition = shared.TokenCondition
This is an alias to an internal type.
type TokenConditionCIDRList ¶
type TokenConditionCIDRList = shared.TokenConditionCIDRList
IPv4/IPv6 CIDR.
This is an alias to an internal type.
type TokenConditionCIDRListParam ¶
type TokenConditionCIDRListParam = shared.TokenConditionCIDRListParam
IPv4/IPv6 CIDR.
This is an alias to an internal type.
type TokenConditionParam ¶
type TokenConditionParam = shared.TokenConditionParam
This is an alias to an internal type.
type TokenConditionRequestIP ¶
type TokenConditionRequestIP = shared.TokenConditionRequestIP
Client IP restrictions.
This is an alias to an internal type.
type TokenConditionRequestIPParam ¶
type TokenConditionRequestIPParam = shared.TokenConditionRequestIPParam
Client IP restrictions.
This is an alias to an internal type.
type TokenPolicyEffect ¶
type TokenPolicyEffect = shared.TokenPolicyEffect
Allow or deny operations against the resources.
This is an alias to an internal type.
type TokenPolicyParam ¶
type TokenPolicyParam = shared.TokenPolicyParam
This is an alias to an internal type.
type TokenPolicyPermissionGroup ¶
type TokenPolicyPermissionGroup = shared.TokenPolicyPermissionGroup
A named group of permissions that map to a group of operations against resources.
This is an alias to an internal type.
type TokenPolicyPermissionGroupParam ¶
type TokenPolicyPermissionGroupParam = shared.TokenPolicyPermissionGroupParam
A named group of permissions that map to a group of operations against resources.
This is an alias to an internal type.
type TokenPolicyPermissionGroupsMeta ¶
type TokenPolicyPermissionGroupsMeta = shared.TokenPolicyPermissionGroupsMeta
Attributes associated to the permission group.
This is an alias to an internal type.
type TokenPolicyPermissionGroupsMetaParam ¶
type TokenPolicyPermissionGroupsMetaParam = shared.TokenPolicyPermissionGroupsMetaParam
Attributes associated to the permission group.
This is an alias to an internal type.
type TokenStatus ¶
type TokenStatus = shared.TokenStatus
Status of the token.
This is an alias to an internal type.
type TokenValue ¶
type TokenValue = shared.TokenValue
The token value.
This is an alias to an internal type.