Skip to main content

previews

Creates, updates, deletes, gets or lists a previews resource.

Overview

Namepreviews
TypeResource
Idcloudflare.load_balancers.previews

Fields

The following fields are returned by SELECT queries:

Preview Result response.

NameDatatypeDescription
errorsarray
messagesarray
resultobjectResulting health data from a preview operation.
successbooleanWhether the API call was successful. (true)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectpreview_id, account_idGet the result of a previous preview operation using the provided preview_id.
createinsertmonitor_id, account_idPreview pools using the specified monitor with provided monitor details. The returned preview_id can be used in the preview endpoint to retrieve the results.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
monitor_idstringThe Load Balancer monitor ID.
preview_idstring

SELECT examples

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

SELECT
errors,
messages,
result,
success
FROM cloudflare.load_balancers.previews
WHERE preview_id = '{{ preview_id }}' -- required
AND account_id = '{{ account_id }}' -- required
;

INSERT examples

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.

INSERT INTO cloudflare.load_balancers.previews (
allow_insecure,
consecutive_down,
consecutive_up,
description,
expected_body,
expected_codes,
follow_redirects,
header,
interval,
method,
path,
port,
probe_zone,
retries,
timeout,
type,
monitor_id,
account_id
)
SELECT
{{ allow_insecure }},
{{ consecutive_down }},
{{ consecutive_up }},
'{{ description }}',
'{{ expected_body }}',
'{{ expected_codes }}',
{{ follow_redirects }},
'{{ header }}',
{{ interval }},
'{{ method }}',
'{{ path }}',
{{ port }},
'{{ probe_zone }}',
{{ retries }},
{{ timeout }},
'{{ type }}',
'{{ monitor_id }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;