Skip to main content

phases

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

Overview

Namephases
TypeResource
Idcloudflare.rulesets.phases

Fields

The following fields are returned by SELECT queries:

A ruleset response.

NameDatatypeDescription
idstringThe unique ID of the ruleset. (example: 2f2feab2026849078ba485f918791bdc, title: Ruleset ID)
namestringThe human-readable name of the ruleset. (title: Name)
descriptionstringAn informative description of the ruleset. (default: , title: Description)
kindstringThe kind of the ruleset. (managed, custom, root, zone) (example: root, title: Kind)
last_updatedstring (date-time)The timestamp of when the ruleset was last modified. (title: Last Updated)
phasestringThe phase of the ruleset. (ddos_l4, ddos_l7, http_config_settings, http_custom_errors, http_log_custom_fields, http_ratelimit, http_request_cache_settings, http_request_dynamic_redirect, http_request_firewall_custom, http_request_firewall_managed, http_request_late_transform, http_request_origin, http_request_redirect, http_request_sanitize, http_request_sbfm, http_request_transform, http_response_cache_settings, http_response_compression, http_response_firewall_managed, http_response_headers_transform, magic_transit, magic_transit_ids_managed, magic_transit_managed, magic_transit_ratelimit) (example: http_request_firewall_custom, title: Phase)
rulesarrayThe list of rules in the ruleset. (title: Rules)
versionstringThe version of the ruleset. (example: 1, title: Version)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_by_accountselectruleset_phase, account_idFetches the latest version of the account or zone entry point ruleset for a given phase.
list_by_zoneselectruleset_phase, zone_idFetches the latest version of the account or zone entry point ruleset for a given phase.
update_by_accountreplaceruleset_phase, account_idUpdates an account or zone entry point ruleset, creating a new version.
update_by_zonereplaceruleset_phase, zone_idUpdates an account or zone entry point ruleset, creating a new version.

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.
ruleset_phasestring
zone_idstringThe Cloudflare zone ID.

SELECT examples

Fetches the latest version of the account or zone entry point ruleset for a given phase.

SELECT
id,
name,
description,
kind,
last_updated,
phase,
rules,
version
FROM cloudflare.rulesets.phases
WHERE ruleset_phase = '{{ ruleset_phase }}' -- required
AND account_id = '{{ account_id }}' -- required
;

REPLACE examples

Updates an account or zone entry point ruleset, creating a new version.

REPLACE cloudflare.rulesets.phases
SET
description = '{{ description }}',
name = '{{ name }}',
rules = '{{ rules }}'
WHERE
ruleset_phase = '{{ ruleset_phase }}' --required
AND account_id = '{{ account_id }}' --required
RETURNING
errors,
messages,
result,
success;