healthchecks

package
v2.0.0-beta.11 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error = apierror.Error

type HealthcheckDeleteParams

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

type HealthcheckDeleteResponse

type HealthcheckDeleteResponse struct {
	// Identifier
	ID   string                        `json:"id"`
	JSON healthcheckDeleteResponseJSON `json:"-"`
}

func (*HealthcheckDeleteResponse) UnmarshalJSON

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

type HealthcheckDeleteResponseEnvelope

type HealthcheckDeleteResponseEnvelope struct {
	Errors   []HealthcheckDeleteResponseEnvelopeErrors   `json:"errors,required"`
	Messages []HealthcheckDeleteResponseEnvelopeMessages `json:"messages,required"`
	Result   HealthcheckDeleteResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success HealthcheckDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    healthcheckDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*HealthcheckDeleteResponseEnvelope) UnmarshalJSON

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

type HealthcheckDeleteResponseEnvelopeErrors

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

func (*HealthcheckDeleteResponseEnvelopeErrors) UnmarshalJSON

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

type HealthcheckDeleteResponseEnvelopeMessages

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

func (*HealthcheckDeleteResponseEnvelopeMessages) UnmarshalJSON

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

type HealthcheckDeleteResponseEnvelopeSuccess

type HealthcheckDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	HealthcheckDeleteResponseEnvelopeSuccessTrue HealthcheckDeleteResponseEnvelopeSuccess = true
)

func (HealthcheckDeleteResponseEnvelopeSuccess) IsKnown

type HealthcheckEditParams

type HealthcheckEditParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// The hostname or IP address of the origin server to run health checks on.
	Address param.Field[string] `json:"address,required"`
	// A short name to identify the health check. Only alphanumeric characters, hyphens
	// and underscores are allowed.
	Name param.Field[string] `json:"name,required"`
	// A list of regions from which to run health checks. Null means Cloudflare will
	// pick a default region.
	CheckRegions param.Field[[]HealthcheckEditParamsCheckRegion] `json:"check_regions"`
	// The number of consecutive fails required from a health check before changing the
	// health to unhealthy.
	ConsecutiveFails param.Field[int64] `json:"consecutive_fails"`
	// The number of consecutive successes required from a health check before changing
	// the health to healthy.
	ConsecutiveSuccesses param.Field[int64] `json:"consecutive_successes"`
	// A human-readable description of the health check.
	Description param.Field[string] `json:"description"`
	// Parameters specific to an HTTP or HTTPS health check.
	HTTPConfig param.Field[HealthcheckEditParamsHTTPConfig] `json:"http_config"`
	// The interval between each health check. Shorter intervals may give quicker
	// notifications if the origin status changes, but will increase load on the origin
	// as we check from multiple locations.
	Interval param.Field[int64] `json:"interval"`
	// 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"`
	// If suspended, no health checks are sent to the origin.
	Suspended param.Field[bool] `json:"suspended"`
	// Parameters specific to TCP health check.
	TcpConfig param.Field[HealthcheckEditParamsTcpConfig] `json:"tcp_config"`
	// 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' and 'TCP'.
	Type param.Field[string] `json:"type"`
}

func (HealthcheckEditParams) MarshalJSON

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

type HealthcheckEditParamsCheckRegion

type HealthcheckEditParamsCheckRegion 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, IN: India, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS and ENTERPRISE customers only).

const (
	HealthcheckEditParamsCheckRegionWnam       HealthcheckEditParamsCheckRegion = "WNAM"
	HealthcheckEditParamsCheckRegionEnam       HealthcheckEditParamsCheckRegion = "ENAM"
	HealthcheckEditParamsCheckRegionWeu        HealthcheckEditParamsCheckRegion = "WEU"
	HealthcheckEditParamsCheckRegionEeu        HealthcheckEditParamsCheckRegion = "EEU"
	HealthcheckEditParamsCheckRegionNsam       HealthcheckEditParamsCheckRegion = "NSAM"
	HealthcheckEditParamsCheckRegionSsam       HealthcheckEditParamsCheckRegion = "SSAM"
	HealthcheckEditParamsCheckRegionOc         HealthcheckEditParamsCheckRegion = "OC"
	HealthcheckEditParamsCheckRegionMe         HealthcheckEditParamsCheckRegion = "ME"
	HealthcheckEditParamsCheckRegionNaf        HealthcheckEditParamsCheckRegion = "NAF"
	HealthcheckEditParamsCheckRegionSaf        HealthcheckEditParamsCheckRegion = "SAF"
	HealthcheckEditParamsCheckRegionIn         HealthcheckEditParamsCheckRegion = "IN"
	HealthcheckEditParamsCheckRegionSeas       HealthcheckEditParamsCheckRegion = "SEAS"
	HealthcheckEditParamsCheckRegionNeas       HealthcheckEditParamsCheckRegion = "NEAS"
	HealthcheckEditParamsCheckRegionAllRegions HealthcheckEditParamsCheckRegion = "ALL_REGIONS"
)

func (HealthcheckEditParamsCheckRegion) IsKnown

type HealthcheckEditParamsHTTPConfig

type HealthcheckEditParamsHTTPConfig struct {
	// Do not validate the certificate when the health check uses HTTPS.
	AllowInsecure param.Field[bool] `json:"allow_insecure"`
	// 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.
	ExpectedBody param.Field[string] `json:"expected_body"`
	// The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
	// codes starting with 2) of the health check.
	ExpectedCodes param.Field[[]string] `json:"expected_codes"`
	// Follow redirects if the origin returns a 3xx status code.
	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.
	Header param.Field[interface{}] `json:"header"`
	// The HTTP method to use for the health check.
	Method param.Field[HealthcheckEditParamsHTTPConfigMethod] `json:"method"`
	// The endpoint path to health check against.
	Path param.Field[string] `json:"path"`
	// Port number to connect to for the health check. Defaults to 80 if type is HTTP
	// or 443 if type is HTTPS.
	Port param.Field[int64] `json:"port"`
}

Parameters specific to an HTTP or HTTPS health check.

func (HealthcheckEditParamsHTTPConfig) MarshalJSON

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

type HealthcheckEditParamsHTTPConfigMethod

type HealthcheckEditParamsHTTPConfigMethod string

The HTTP method to use for the health check.

const (
	HealthcheckEditParamsHTTPConfigMethodGet  HealthcheckEditParamsHTTPConfigMethod = "GET"
	HealthcheckEditParamsHTTPConfigMethodHead HealthcheckEditParamsHTTPConfigMethod = "HEAD"
)

func (HealthcheckEditParamsHTTPConfigMethod) IsKnown

type HealthcheckEditParamsTcpConfig

type HealthcheckEditParamsTcpConfig struct {
	// The TCP connection method to use for the health check.
	Method param.Field[HealthcheckEditParamsTcpConfigMethod] `json:"method"`
	// Port number to connect to for the health check. Defaults to 80.
	Port param.Field[int64] `json:"port"`
}

Parameters specific to TCP health check.

func (HealthcheckEditParamsTcpConfig) MarshalJSON

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

type HealthcheckEditParamsTcpConfigMethod

type HealthcheckEditParamsTcpConfigMethod string

The TCP connection method to use for the health check.

const (
	HealthcheckEditParamsTcpConfigMethodConnectionEstablished HealthcheckEditParamsTcpConfigMethod = "connection_established"
)

func (HealthcheckEditParamsTcpConfigMethod) IsKnown

type HealthcheckEditResponseEnvelope

type HealthcheckEditResponseEnvelope struct {
	Errors   []HealthcheckEditResponseEnvelopeErrors   `json:"errors,required"`
	Messages []HealthcheckEditResponseEnvelopeMessages `json:"messages,required"`
	Result   HealthchecksHealthchecks                  `json:"result,required"`
	// Whether the API call was successful
	Success HealthcheckEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    healthcheckEditResponseEnvelopeJSON    `json:"-"`
}

func (*HealthcheckEditResponseEnvelope) UnmarshalJSON

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

type HealthcheckEditResponseEnvelopeErrors

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

func (*HealthcheckEditResponseEnvelopeErrors) UnmarshalJSON

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

type HealthcheckEditResponseEnvelopeMessages

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

func (*HealthcheckEditResponseEnvelopeMessages) UnmarshalJSON

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

type HealthcheckEditResponseEnvelopeSuccess

type HealthcheckEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	HealthcheckEditResponseEnvelopeSuccessTrue HealthcheckEditResponseEnvelopeSuccess = true
)

func (HealthcheckEditResponseEnvelopeSuccess) IsKnown

type HealthcheckGetParams

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

type HealthcheckGetResponseEnvelope

type HealthcheckGetResponseEnvelope struct {
	Errors   []HealthcheckGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []HealthcheckGetResponseEnvelopeMessages `json:"messages,required"`
	Result   HealthchecksHealthchecks                 `json:"result,required"`
	// Whether the API call was successful
	Success HealthcheckGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    healthcheckGetResponseEnvelopeJSON    `json:"-"`
}

func (*HealthcheckGetResponseEnvelope) UnmarshalJSON

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

type HealthcheckGetResponseEnvelopeErrors

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

func (*HealthcheckGetResponseEnvelopeErrors) UnmarshalJSON

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

type HealthcheckGetResponseEnvelopeMessages

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

func (*HealthcheckGetResponseEnvelopeMessages) UnmarshalJSON

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

type HealthcheckGetResponseEnvelopeSuccess

type HealthcheckGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	HealthcheckGetResponseEnvelopeSuccessTrue HealthcheckGetResponseEnvelopeSuccess = true
)

func (HealthcheckGetResponseEnvelopeSuccess) IsKnown

type HealthcheckListParams

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

type HealthcheckListResponseEnvelope

type HealthcheckListResponseEnvelope struct {
	Errors   []HealthcheckListResponseEnvelopeErrors   `json:"errors,required"`
	Messages []HealthcheckListResponseEnvelopeMessages `json:"messages,required"`
	Result   []HealthchecksHealthchecks                `json:"result,required,nullable"`
	// Whether the API call was successful
	Success    HealthcheckListResponseEnvelopeSuccess    `json:"success,required"`
	ResultInfo HealthcheckListResponseEnvelopeResultInfo `json:"result_info"`
	JSON       healthcheckListResponseEnvelopeJSON       `json:"-"`
}

func (*HealthcheckListResponseEnvelope) UnmarshalJSON

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

type HealthcheckListResponseEnvelopeErrors

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

func (*HealthcheckListResponseEnvelopeErrors) UnmarshalJSON

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

type HealthcheckListResponseEnvelopeMessages

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

func (*HealthcheckListResponseEnvelopeMessages) UnmarshalJSON

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

type HealthcheckListResponseEnvelopeResultInfo

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

func (*HealthcheckListResponseEnvelopeResultInfo) UnmarshalJSON

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

type HealthcheckListResponseEnvelopeSuccess

type HealthcheckListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	HealthcheckListResponseEnvelopeSuccessTrue HealthcheckListResponseEnvelopeSuccess = true
)

func (HealthcheckListResponseEnvelopeSuccess) IsKnown

type HealthcheckNewParams

type HealthcheckNewParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// The hostname or IP address of the origin server to run health checks on.
	Address param.Field[string] `json:"address,required"`
	// A short name to identify the health check. Only alphanumeric characters, hyphens
	// and underscores are allowed.
	Name param.Field[string] `json:"name,required"`
	// A list of regions from which to run health checks. Null means Cloudflare will
	// pick a default region.
	CheckRegions param.Field[[]HealthcheckNewParamsCheckRegion] `json:"check_regions"`
	// The number of consecutive fails required from a health check before changing the
	// health to unhealthy.
	ConsecutiveFails param.Field[int64] `json:"consecutive_fails"`
	// The number of consecutive successes required from a health check before changing
	// the health to healthy.
	ConsecutiveSuccesses param.Field[int64] `json:"consecutive_successes"`
	// A human-readable description of the health check.
	Description param.Field[string] `json:"description"`
	// Parameters specific to an HTTP or HTTPS health check.
	HTTPConfig param.Field[HealthcheckNewParamsHTTPConfig] `json:"http_config"`
	// The interval between each health check. Shorter intervals may give quicker
	// notifications if the origin status changes, but will increase load on the origin
	// as we check from multiple locations.
	Interval param.Field[int64] `json:"interval"`
	// 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"`
	// If suspended, no health checks are sent to the origin.
	Suspended param.Field[bool] `json:"suspended"`
	// Parameters specific to TCP health check.
	TcpConfig param.Field[HealthcheckNewParamsTcpConfig] `json:"tcp_config"`
	// 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' and 'TCP'.
	Type param.Field[string] `json:"type"`
}

func (HealthcheckNewParams) MarshalJSON

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

type HealthcheckNewParamsCheckRegion

type HealthcheckNewParamsCheckRegion 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, IN: India, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS and ENTERPRISE customers only).

const (
	HealthcheckNewParamsCheckRegionWnam       HealthcheckNewParamsCheckRegion = "WNAM"
	HealthcheckNewParamsCheckRegionEnam       HealthcheckNewParamsCheckRegion = "ENAM"
	HealthcheckNewParamsCheckRegionWeu        HealthcheckNewParamsCheckRegion = "WEU"
	HealthcheckNewParamsCheckRegionEeu        HealthcheckNewParamsCheckRegion = "EEU"
	HealthcheckNewParamsCheckRegionNsam       HealthcheckNewParamsCheckRegion = "NSAM"
	HealthcheckNewParamsCheckRegionSsam       HealthcheckNewParamsCheckRegion = "SSAM"
	HealthcheckNewParamsCheckRegionOc         HealthcheckNewParamsCheckRegion = "OC"
	HealthcheckNewParamsCheckRegionMe         HealthcheckNewParamsCheckRegion = "ME"
	HealthcheckNewParamsCheckRegionNaf        HealthcheckNewParamsCheckRegion = "NAF"
	HealthcheckNewParamsCheckRegionSaf        HealthcheckNewParamsCheckRegion = "SAF"
	HealthcheckNewParamsCheckRegionIn         HealthcheckNewParamsCheckRegion = "IN"
	HealthcheckNewParamsCheckRegionSeas       HealthcheckNewParamsCheckRegion = "SEAS"
	HealthcheckNewParamsCheckRegionNeas       HealthcheckNewParamsCheckRegion = "NEAS"
	HealthcheckNewParamsCheckRegionAllRegions HealthcheckNewParamsCheckRegion = "ALL_REGIONS"
)

func (HealthcheckNewParamsCheckRegion) IsKnown

type HealthcheckNewParamsHTTPConfig

type HealthcheckNewParamsHTTPConfig struct {
	// Do not validate the certificate when the health check uses HTTPS.
	AllowInsecure param.Field[bool] `json:"allow_insecure"`
	// 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.
	ExpectedBody param.Field[string] `json:"expected_body"`
	// The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
	// codes starting with 2) of the health check.
	ExpectedCodes param.Field[[]string] `json:"expected_codes"`
	// Follow redirects if the origin returns a 3xx status code.
	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.
	Header param.Field[interface{}] `json:"header"`
	// The HTTP method to use for the health check.
	Method param.Field[HealthcheckNewParamsHTTPConfigMethod] `json:"method"`
	// The endpoint path to health check against.
	Path param.Field[string] `json:"path"`
	// Port number to connect to for the health check. Defaults to 80 if type is HTTP
	// or 443 if type is HTTPS.
	Port param.Field[int64] `json:"port"`
}

Parameters specific to an HTTP or HTTPS health check.

func (HealthcheckNewParamsHTTPConfig) MarshalJSON

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

type HealthcheckNewParamsHTTPConfigMethod

type HealthcheckNewParamsHTTPConfigMethod string

The HTTP method to use for the health check.

const (
	HealthcheckNewParamsHTTPConfigMethodGet  HealthcheckNewParamsHTTPConfigMethod = "GET"
	HealthcheckNewParamsHTTPConfigMethodHead HealthcheckNewParamsHTTPConfigMethod = "HEAD"
)

func (HealthcheckNewParamsHTTPConfigMethod) IsKnown

type HealthcheckNewParamsTcpConfig

type HealthcheckNewParamsTcpConfig struct {
	// The TCP connection method to use for the health check.
	Method param.Field[HealthcheckNewParamsTcpConfigMethod] `json:"method"`
	// Port number to connect to for the health check. Defaults to 80.
	Port param.Field[int64] `json:"port"`
}

Parameters specific to TCP health check.

func (HealthcheckNewParamsTcpConfig) MarshalJSON

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

type HealthcheckNewParamsTcpConfigMethod

type HealthcheckNewParamsTcpConfigMethod string

The TCP connection method to use for the health check.

const (
	HealthcheckNewParamsTcpConfigMethodConnectionEstablished HealthcheckNewParamsTcpConfigMethod = "connection_established"
)

func (HealthcheckNewParamsTcpConfigMethod) IsKnown

type HealthcheckNewResponseEnvelope

type HealthcheckNewResponseEnvelope struct {
	Errors   []HealthcheckNewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []HealthcheckNewResponseEnvelopeMessages `json:"messages,required"`
	Result   HealthchecksHealthchecks                 `json:"result,required"`
	// Whether the API call was successful
	Success HealthcheckNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    healthcheckNewResponseEnvelopeJSON    `json:"-"`
}

func (*HealthcheckNewResponseEnvelope) UnmarshalJSON

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

type HealthcheckNewResponseEnvelopeErrors

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

func (*HealthcheckNewResponseEnvelopeErrors) UnmarshalJSON

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

type HealthcheckNewResponseEnvelopeMessages

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

func (*HealthcheckNewResponseEnvelopeMessages) UnmarshalJSON

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

type HealthcheckNewResponseEnvelopeSuccess

type HealthcheckNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	HealthcheckNewResponseEnvelopeSuccessTrue HealthcheckNewResponseEnvelopeSuccess = true
)

func (HealthcheckNewResponseEnvelopeSuccess) IsKnown

type HealthcheckService

type HealthcheckService struct {
	Options  []option.RequestOption
	Previews *PreviewService
}

HealthcheckService 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 NewHealthcheckService method instead.

func NewHealthcheckService

func NewHealthcheckService(opts ...option.RequestOption) (r *HealthcheckService)

NewHealthcheckService 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 (*HealthcheckService) Delete

func (r *HealthcheckService) Delete(ctx context.Context, healthcheckID string, body HealthcheckDeleteParams, opts ...option.RequestOption) (res *HealthcheckDeleteResponse, err error)

Delete a health check.

func (*HealthcheckService) Edit

func (r *HealthcheckService) Edit(ctx context.Context, healthcheckID string, params HealthcheckEditParams, opts ...option.RequestOption) (res *HealthchecksHealthchecks, err error)

Patch a configured health check.

func (*HealthcheckService) Get

func (r *HealthcheckService) Get(ctx context.Context, healthcheckID string, query HealthcheckGetParams, opts ...option.RequestOption) (res *HealthchecksHealthchecks, err error)

Fetch a single configured health check.

func (*HealthcheckService) List

List configured health checks.

func (*HealthcheckService) New

Create a new health check.

func (*HealthcheckService) Update

func (r *HealthcheckService) Update(ctx context.Context, healthcheckID string, params HealthcheckUpdateParams, opts ...option.RequestOption) (res *HealthchecksHealthchecks, err error)

Update a configured health check.

type HealthcheckUpdateParams

type HealthcheckUpdateParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// The hostname or IP address of the origin server to run health checks on.
	Address param.Field[string] `json:"address,required"`
	// A short name to identify the health check. Only alphanumeric characters, hyphens
	// and underscores are allowed.
	Name param.Field[string] `json:"name,required"`
	// A list of regions from which to run health checks. Null means Cloudflare will
	// pick a default region.
	CheckRegions param.Field[[]HealthcheckUpdateParamsCheckRegion] `json:"check_regions"`
	// The number of consecutive fails required from a health check before changing the
	// health to unhealthy.
	ConsecutiveFails param.Field[int64] `json:"consecutive_fails"`
	// The number of consecutive successes required from a health check before changing
	// the health to healthy.
	ConsecutiveSuccesses param.Field[int64] `json:"consecutive_successes"`
	// A human-readable description of the health check.
	Description param.Field[string] `json:"description"`
	// Parameters specific to an HTTP or HTTPS health check.
	HTTPConfig param.Field[HealthcheckUpdateParamsHTTPConfig] `json:"http_config"`
	// The interval between each health check. Shorter intervals may give quicker
	// notifications if the origin status changes, but will increase load on the origin
	// as we check from multiple locations.
	Interval param.Field[int64] `json:"interval"`
	// 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"`
	// If suspended, no health checks are sent to the origin.
	Suspended param.Field[bool] `json:"suspended"`
	// Parameters specific to TCP health check.
	TcpConfig param.Field[HealthcheckUpdateParamsTcpConfig] `json:"tcp_config"`
	// 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' and 'TCP'.
	Type param.Field[string] `json:"type"`
}

func (HealthcheckUpdateParams) MarshalJSON

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

type HealthcheckUpdateParamsCheckRegion

type HealthcheckUpdateParamsCheckRegion 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, IN: India, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS and ENTERPRISE customers only).

const (
	HealthcheckUpdateParamsCheckRegionWnam       HealthcheckUpdateParamsCheckRegion = "WNAM"
	HealthcheckUpdateParamsCheckRegionEnam       HealthcheckUpdateParamsCheckRegion = "ENAM"
	HealthcheckUpdateParamsCheckRegionWeu        HealthcheckUpdateParamsCheckRegion = "WEU"
	HealthcheckUpdateParamsCheckRegionEeu        HealthcheckUpdateParamsCheckRegion = "EEU"
	HealthcheckUpdateParamsCheckRegionNsam       HealthcheckUpdateParamsCheckRegion = "NSAM"
	HealthcheckUpdateParamsCheckRegionSsam       HealthcheckUpdateParamsCheckRegion = "SSAM"
	HealthcheckUpdateParamsCheckRegionOc         HealthcheckUpdateParamsCheckRegion = "OC"
	HealthcheckUpdateParamsCheckRegionMe         HealthcheckUpdateParamsCheckRegion = "ME"
	HealthcheckUpdateParamsCheckRegionNaf        HealthcheckUpdateParamsCheckRegion = "NAF"
	HealthcheckUpdateParamsCheckRegionSaf        HealthcheckUpdateParamsCheckRegion = "SAF"
	HealthcheckUpdateParamsCheckRegionIn         HealthcheckUpdateParamsCheckRegion = "IN"
	HealthcheckUpdateParamsCheckRegionSeas       HealthcheckUpdateParamsCheckRegion = "SEAS"
	HealthcheckUpdateParamsCheckRegionNeas       HealthcheckUpdateParamsCheckRegion = "NEAS"
	HealthcheckUpdateParamsCheckRegionAllRegions HealthcheckUpdateParamsCheckRegion = "ALL_REGIONS"
)

func (HealthcheckUpdateParamsCheckRegion) IsKnown

type HealthcheckUpdateParamsHTTPConfig

type HealthcheckUpdateParamsHTTPConfig struct {
	// Do not validate the certificate when the health check uses HTTPS.
	AllowInsecure param.Field[bool] `json:"allow_insecure"`
	// 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.
	ExpectedBody param.Field[string] `json:"expected_body"`
	// The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
	// codes starting with 2) of the health check.
	ExpectedCodes param.Field[[]string] `json:"expected_codes"`
	// Follow redirects if the origin returns a 3xx status code.
	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.
	Header param.Field[interface{}] `json:"header"`
	// The HTTP method to use for the health check.
	Method param.Field[HealthcheckUpdateParamsHTTPConfigMethod] `json:"method"`
	// The endpoint path to health check against.
	Path param.Field[string] `json:"path"`
	// Port number to connect to for the health check. Defaults to 80 if type is HTTP
	// or 443 if type is HTTPS.
	Port param.Field[int64] `json:"port"`
}

Parameters specific to an HTTP or HTTPS health check.

func (HealthcheckUpdateParamsHTTPConfig) MarshalJSON

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

type HealthcheckUpdateParamsHTTPConfigMethod

type HealthcheckUpdateParamsHTTPConfigMethod string

The HTTP method to use for the health check.

const (
	HealthcheckUpdateParamsHTTPConfigMethodGet  HealthcheckUpdateParamsHTTPConfigMethod = "GET"
	HealthcheckUpdateParamsHTTPConfigMethodHead HealthcheckUpdateParamsHTTPConfigMethod = "HEAD"
)

func (HealthcheckUpdateParamsHTTPConfigMethod) IsKnown

type HealthcheckUpdateParamsTcpConfig

type HealthcheckUpdateParamsTcpConfig struct {
	// The TCP connection method to use for the health check.
	Method param.Field[HealthcheckUpdateParamsTcpConfigMethod] `json:"method"`
	// Port number to connect to for the health check. Defaults to 80.
	Port param.Field[int64] `json:"port"`
}

Parameters specific to TCP health check.

func (HealthcheckUpdateParamsTcpConfig) MarshalJSON

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

type HealthcheckUpdateParamsTcpConfigMethod

type HealthcheckUpdateParamsTcpConfigMethod string

The TCP connection method to use for the health check.

const (
	HealthcheckUpdateParamsTcpConfigMethodConnectionEstablished HealthcheckUpdateParamsTcpConfigMethod = "connection_established"
)

func (HealthcheckUpdateParamsTcpConfigMethod) IsKnown

type HealthcheckUpdateResponseEnvelope

type HealthcheckUpdateResponseEnvelope struct {
	Errors   []HealthcheckUpdateResponseEnvelopeErrors   `json:"errors,required"`
	Messages []HealthcheckUpdateResponseEnvelopeMessages `json:"messages,required"`
	Result   HealthchecksHealthchecks                    `json:"result,required"`
	// Whether the API call was successful
	Success HealthcheckUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    healthcheckUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*HealthcheckUpdateResponseEnvelope) UnmarshalJSON

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

type HealthcheckUpdateResponseEnvelopeErrors

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

func (*HealthcheckUpdateResponseEnvelopeErrors) UnmarshalJSON

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

type HealthcheckUpdateResponseEnvelopeMessages

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

func (*HealthcheckUpdateResponseEnvelopeMessages) UnmarshalJSON

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

type HealthcheckUpdateResponseEnvelopeSuccess

type HealthcheckUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	HealthcheckUpdateResponseEnvelopeSuccessTrue HealthcheckUpdateResponseEnvelopeSuccess = true
)

func (HealthcheckUpdateResponseEnvelopeSuccess) IsKnown

type HealthchecksHealthchecks

type HealthchecksHealthchecks struct {
	// Identifier
	ID string `json:"id"`
	// The hostname or IP address of the origin server to run health checks on.
	Address string `json:"address"`
	// A list of regions from which to run health checks. Null means Cloudflare will
	// pick a default region.
	CheckRegions []HealthchecksHealthchecksCheckRegion `json:"check_regions,nullable"`
	// The number of consecutive fails required from a health check before changing the
	// health to unhealthy.
	ConsecutiveFails int64 `json:"consecutive_fails"`
	// The number of consecutive successes required from a health check before changing
	// the health to healthy.
	ConsecutiveSuccesses int64     `json:"consecutive_successes"`
	CreatedOn            time.Time `json:"created_on" format:"date-time"`
	// A human-readable description of the health check.
	Description string `json:"description"`
	// The current failure reason if status is unhealthy.
	FailureReason string `json:"failure_reason"`
	// Parameters specific to an HTTP or HTTPS health check.
	HTTPConfig HealthchecksHealthchecksHTTPConfig `json:"http_config,nullable"`
	// The interval between each health check. Shorter intervals may give quicker
	// notifications if the origin status changes, but will increase load on the origin
	// as we check from multiple locations.
	Interval   int64     `json:"interval"`
	ModifiedOn time.Time `json:"modified_on" format:"date-time"`
	// A short name to identify the health check. Only alphanumeric characters, hyphens
	// and underscores are allowed.
	Name string `json:"name"`
	// 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 current status of the origin server according to the health check.
	Status HealthchecksHealthchecksStatus `json:"status"`
	// If suspended, no health checks are sent to the origin.
	Suspended bool `json:"suspended"`
	// Parameters specific to TCP health check.
	TcpConfig HealthchecksHealthchecksTcpConfig `json:"tcp_config,nullable"`
	// 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' and 'TCP'.
	Type string                       `json:"type"`
	JSON healthchecksHealthchecksJSON `json:"-"`
}

func (*HealthchecksHealthchecks) UnmarshalJSON

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

type HealthchecksHealthchecksCheckRegion

type HealthchecksHealthchecksCheckRegion 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, IN: India, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS and ENTERPRISE customers only).

const (
	HealthchecksHealthchecksCheckRegionWnam       HealthchecksHealthchecksCheckRegion = "WNAM"
	HealthchecksHealthchecksCheckRegionEnam       HealthchecksHealthchecksCheckRegion = "ENAM"
	HealthchecksHealthchecksCheckRegionWeu        HealthchecksHealthchecksCheckRegion = "WEU"
	HealthchecksHealthchecksCheckRegionEeu        HealthchecksHealthchecksCheckRegion = "EEU"
	HealthchecksHealthchecksCheckRegionNsam       HealthchecksHealthchecksCheckRegion = "NSAM"
	HealthchecksHealthchecksCheckRegionSsam       HealthchecksHealthchecksCheckRegion = "SSAM"
	HealthchecksHealthchecksCheckRegionOc         HealthchecksHealthchecksCheckRegion = "OC"
	HealthchecksHealthchecksCheckRegionMe         HealthchecksHealthchecksCheckRegion = "ME"
	HealthchecksHealthchecksCheckRegionNaf        HealthchecksHealthchecksCheckRegion = "NAF"
	HealthchecksHealthchecksCheckRegionSaf        HealthchecksHealthchecksCheckRegion = "SAF"
	HealthchecksHealthchecksCheckRegionIn         HealthchecksHealthchecksCheckRegion = "IN"
	HealthchecksHealthchecksCheckRegionSeas       HealthchecksHealthchecksCheckRegion = "SEAS"
	HealthchecksHealthchecksCheckRegionNeas       HealthchecksHealthchecksCheckRegion = "NEAS"
	HealthchecksHealthchecksCheckRegionAllRegions HealthchecksHealthchecksCheckRegion = "ALL_REGIONS"
)

func (HealthchecksHealthchecksCheckRegion) IsKnown

type HealthchecksHealthchecksHTTPConfig

type HealthchecksHealthchecksHTTPConfig struct {
	// Do not validate the certificate when the health check uses HTTPS.
	AllowInsecure bool `json:"allow_insecure"`
	// 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.
	ExpectedBody string `json:"expected_body"`
	// The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
	// codes starting with 2) of the health check.
	ExpectedCodes []string `json:"expected_codes,nullable"`
	// Follow redirects if the origin returns a 3xx status code.
	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.
	Header interface{} `json:"header,nullable"`
	// The HTTP method to use for the health check.
	Method HealthchecksHealthchecksHTTPConfigMethod `json:"method"`
	// The endpoint path to health check against.
	Path string `json:"path"`
	// Port number to connect to for the health check. Defaults to 80 if type is HTTP
	// or 443 if type is HTTPS.
	Port int64                                  `json:"port"`
	JSON healthchecksHealthchecksHTTPConfigJSON `json:"-"`
}

Parameters specific to an HTTP or HTTPS health check.

func (*HealthchecksHealthchecksHTTPConfig) UnmarshalJSON

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

type HealthchecksHealthchecksHTTPConfigMethod

type HealthchecksHealthchecksHTTPConfigMethod string

The HTTP method to use for the health check.

const (
	HealthchecksHealthchecksHTTPConfigMethodGet  HealthchecksHealthchecksHTTPConfigMethod = "GET"
	HealthchecksHealthchecksHTTPConfigMethodHead HealthchecksHealthchecksHTTPConfigMethod = "HEAD"
)

func (HealthchecksHealthchecksHTTPConfigMethod) IsKnown

type HealthchecksHealthchecksStatus

type HealthchecksHealthchecksStatus string

The current status of the origin server according to the health check.

const (
	HealthchecksHealthchecksStatusUnknown   HealthchecksHealthchecksStatus = "unknown"
	HealthchecksHealthchecksStatusHealthy   HealthchecksHealthchecksStatus = "healthy"
	HealthchecksHealthchecksStatusUnhealthy HealthchecksHealthchecksStatus = "unhealthy"
	HealthchecksHealthchecksStatusSuspended HealthchecksHealthchecksStatus = "suspended"
)

func (HealthchecksHealthchecksStatus) IsKnown

type HealthchecksHealthchecksTcpConfig

type HealthchecksHealthchecksTcpConfig struct {
	// The TCP connection method to use for the health check.
	Method HealthchecksHealthchecksTcpConfigMethod `json:"method"`
	// Port number to connect to for the health check. Defaults to 80.
	Port int64                                 `json:"port"`
	JSON healthchecksHealthchecksTcpConfigJSON `json:"-"`
}

Parameters specific to TCP health check.

func (*HealthchecksHealthchecksTcpConfig) UnmarshalJSON

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

type HealthchecksHealthchecksTcpConfigMethod

type HealthchecksHealthchecksTcpConfigMethod string

The TCP connection method to use for the health check.

const (
	HealthchecksHealthchecksTcpConfigMethodConnectionEstablished HealthchecksHealthchecksTcpConfigMethod = "connection_established"
)

func (HealthchecksHealthchecksTcpConfigMethod) IsKnown

type PreviewDeleteParams

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

type PreviewDeleteResponse

type PreviewDeleteResponse struct {
	// Identifier
	ID   string                    `json:"id"`
	JSON previewDeleteResponseJSON `json:"-"`
}

func (*PreviewDeleteResponse) UnmarshalJSON

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

type PreviewDeleteResponseEnvelope

type PreviewDeleteResponseEnvelope struct {
	Errors   []PreviewDeleteResponseEnvelopeErrors   `json:"errors,required"`
	Messages []PreviewDeleteResponseEnvelopeMessages `json:"messages,required"`
	Result   PreviewDeleteResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success PreviewDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    previewDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*PreviewDeleteResponseEnvelope) UnmarshalJSON

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

type PreviewDeleteResponseEnvelopeErrors

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

func (*PreviewDeleteResponseEnvelopeErrors) UnmarshalJSON

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

type PreviewDeleteResponseEnvelopeMessages

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

func (*PreviewDeleteResponseEnvelopeMessages) UnmarshalJSON

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

type PreviewDeleteResponseEnvelopeSuccess

type PreviewDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PreviewDeleteResponseEnvelopeSuccessTrue PreviewDeleteResponseEnvelopeSuccess = true
)

func (PreviewDeleteResponseEnvelopeSuccess) IsKnown

type PreviewGetParams

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

type PreviewGetResponseEnvelope

type PreviewGetResponseEnvelope struct {
	Errors   []PreviewGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []PreviewGetResponseEnvelopeMessages `json:"messages,required"`
	Result   HealthchecksHealthchecks             `json:"result,required"`
	// Whether the API call was successful
	Success PreviewGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    previewGetResponseEnvelopeJSON    `json:"-"`
}

func (*PreviewGetResponseEnvelope) UnmarshalJSON

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

type PreviewGetResponseEnvelopeErrors

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

func (*PreviewGetResponseEnvelopeErrors) UnmarshalJSON

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

type PreviewGetResponseEnvelopeMessages

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

func (*PreviewGetResponseEnvelopeMessages) UnmarshalJSON

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

type PreviewGetResponseEnvelopeSuccess

type PreviewGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PreviewGetResponseEnvelopeSuccessTrue PreviewGetResponseEnvelopeSuccess = true
)

func (PreviewGetResponseEnvelopeSuccess) IsKnown

type PreviewNewParams

type PreviewNewParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// The hostname or IP address of the origin server to run health checks on.
	Address param.Field[string] `json:"address,required"`
	// A short name to identify the health check. Only alphanumeric characters, hyphens
	// and underscores are allowed.
	Name param.Field[string] `json:"name,required"`
	// A list of regions from which to run health checks. Null means Cloudflare will
	// pick a default region.
	CheckRegions param.Field[[]PreviewNewParamsCheckRegion] `json:"check_regions"`
	// The number of consecutive fails required from a health check before changing the
	// health to unhealthy.
	ConsecutiveFails param.Field[int64] `json:"consecutive_fails"`
	// The number of consecutive successes required from a health check before changing
	// the health to healthy.
	ConsecutiveSuccesses param.Field[int64] `json:"consecutive_successes"`
	// A human-readable description of the health check.
	Description param.Field[string] `json:"description"`
	// Parameters specific to an HTTP or HTTPS health check.
	HTTPConfig param.Field[PreviewNewParamsHTTPConfig] `json:"http_config"`
	// The interval between each health check. Shorter intervals may give quicker
	// notifications if the origin status changes, but will increase load on the origin
	// as we check from multiple locations.
	Interval param.Field[int64] `json:"interval"`
	// 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"`
	// If suspended, no health checks are sent to the origin.
	Suspended param.Field[bool] `json:"suspended"`
	// Parameters specific to TCP health check.
	TcpConfig param.Field[PreviewNewParamsTcpConfig] `json:"tcp_config"`
	// 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' and 'TCP'.
	Type param.Field[string] `json:"type"`
}

func (PreviewNewParams) MarshalJSON

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

type PreviewNewParamsCheckRegion

type PreviewNewParamsCheckRegion 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, IN: India, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (BUSINESS and ENTERPRISE customers only).

const (
	PreviewNewParamsCheckRegionWnam       PreviewNewParamsCheckRegion = "WNAM"
	PreviewNewParamsCheckRegionEnam       PreviewNewParamsCheckRegion = "ENAM"
	PreviewNewParamsCheckRegionWeu        PreviewNewParamsCheckRegion = "WEU"
	PreviewNewParamsCheckRegionEeu        PreviewNewParamsCheckRegion = "EEU"
	PreviewNewParamsCheckRegionNsam       PreviewNewParamsCheckRegion = "NSAM"
	PreviewNewParamsCheckRegionSsam       PreviewNewParamsCheckRegion = "SSAM"
	PreviewNewParamsCheckRegionOc         PreviewNewParamsCheckRegion = "OC"
	PreviewNewParamsCheckRegionMe         PreviewNewParamsCheckRegion = "ME"
	PreviewNewParamsCheckRegionNaf        PreviewNewParamsCheckRegion = "NAF"
	PreviewNewParamsCheckRegionSaf        PreviewNewParamsCheckRegion = "SAF"
	PreviewNewParamsCheckRegionIn         PreviewNewParamsCheckRegion = "IN"
	PreviewNewParamsCheckRegionSeas       PreviewNewParamsCheckRegion = "SEAS"
	PreviewNewParamsCheckRegionNeas       PreviewNewParamsCheckRegion = "NEAS"
	PreviewNewParamsCheckRegionAllRegions PreviewNewParamsCheckRegion = "ALL_REGIONS"
)

func (PreviewNewParamsCheckRegion) IsKnown

func (r PreviewNewParamsCheckRegion) IsKnown() bool

type PreviewNewParamsHTTPConfig

type PreviewNewParamsHTTPConfig struct {
	// Do not validate the certificate when the health check uses HTTPS.
	AllowInsecure param.Field[bool] `json:"allow_insecure"`
	// 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.
	ExpectedBody param.Field[string] `json:"expected_body"`
	// The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all
	// codes starting with 2) of the health check.
	ExpectedCodes param.Field[[]string] `json:"expected_codes"`
	// Follow redirects if the origin returns a 3xx status code.
	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.
	Header param.Field[interface{}] `json:"header"`
	// The HTTP method to use for the health check.
	Method param.Field[PreviewNewParamsHTTPConfigMethod] `json:"method"`
	// The endpoint path to health check against.
	Path param.Field[string] `json:"path"`
	// Port number to connect to for the health check. Defaults to 80 if type is HTTP
	// or 443 if type is HTTPS.
	Port param.Field[int64] `json:"port"`
}

Parameters specific to an HTTP or HTTPS health check.

func (PreviewNewParamsHTTPConfig) MarshalJSON

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

type PreviewNewParamsHTTPConfigMethod

type PreviewNewParamsHTTPConfigMethod string

The HTTP method to use for the health check.

const (
	PreviewNewParamsHTTPConfigMethodGet  PreviewNewParamsHTTPConfigMethod = "GET"
	PreviewNewParamsHTTPConfigMethodHead PreviewNewParamsHTTPConfigMethod = "HEAD"
)

func (PreviewNewParamsHTTPConfigMethod) IsKnown

type PreviewNewParamsTcpConfig

type PreviewNewParamsTcpConfig struct {
	// The TCP connection method to use for the health check.
	Method param.Field[PreviewNewParamsTcpConfigMethod] `json:"method"`
	// Port number to connect to for the health check. Defaults to 80.
	Port param.Field[int64] `json:"port"`
}

Parameters specific to TCP health check.

func (PreviewNewParamsTcpConfig) MarshalJSON

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

type PreviewNewParamsTcpConfigMethod

type PreviewNewParamsTcpConfigMethod string

The TCP connection method to use for the health check.

const (
	PreviewNewParamsTcpConfigMethodConnectionEstablished PreviewNewParamsTcpConfigMethod = "connection_established"
)

func (PreviewNewParamsTcpConfigMethod) IsKnown

type PreviewNewResponseEnvelope

type PreviewNewResponseEnvelope struct {
	Errors   []PreviewNewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []PreviewNewResponseEnvelopeMessages `json:"messages,required"`
	Result   HealthchecksHealthchecks             `json:"result,required"`
	// Whether the API call was successful
	Success PreviewNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    previewNewResponseEnvelopeJSON    `json:"-"`
}

func (*PreviewNewResponseEnvelope) UnmarshalJSON

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

type PreviewNewResponseEnvelopeErrors

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

func (*PreviewNewResponseEnvelopeErrors) UnmarshalJSON

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

type PreviewNewResponseEnvelopeMessages

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

func (*PreviewNewResponseEnvelopeMessages) UnmarshalJSON

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

type PreviewNewResponseEnvelopeSuccess

type PreviewNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PreviewNewResponseEnvelopeSuccessTrue PreviewNewResponseEnvelopeSuccess = true
)

func (PreviewNewResponseEnvelopeSuccess) IsKnown

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) Delete

func (r *PreviewService) Delete(ctx context.Context, healthcheckID string, body PreviewDeleteParams, opts ...option.RequestOption) (res *PreviewDeleteResponse, err error)

Delete a health check.

func (*PreviewService) Get

func (r *PreviewService) Get(ctx context.Context, healthcheckID string, query PreviewGetParams, opts ...option.RequestOption) (res *HealthchecksHealthchecks, err error)

Fetch a single configured health check preview.

func (*PreviewService) New

Create a new preview health check.

Jump to

Keyboard shortcuts

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