phases
Creates, updates, deletes, gets or lists a phases resource.
Overview
| Name | phases |
| Type | Resource |
| Id | cloudflare.rulesets.phases |
Fields
The following fields are returned by SELECT queries:
- list_by_account
- list_by_zone
A ruleset response.
| Name | Datatype | Description |
|---|---|---|
id | string | The unique ID of the ruleset. (example: 2f2feab2026849078ba485f918791bdc, title: Ruleset ID) |
name | string | The human-readable name of the ruleset. (title: Name) |
description | string | An informative description of the ruleset. (default: , title: Description) |
kind | string | The kind of the ruleset. (managed, custom, root, zone) (example: root, title: Kind) |
last_updated | string (date-time) | The timestamp of when the ruleset was last modified. (title: Last Updated) |
phase | string | The 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) |
rules | array | The list of rules in the ruleset. (title: Rules) |
version | string | The version of the ruleset. (example: 1, title: Version) |
A ruleset response.
| Name | Datatype | Description |
|---|---|---|
id | string | The unique ID of the ruleset. (example: 2f2feab2026849078ba485f918791bdc, title: Ruleset ID) |
name | string | The human-readable name of the ruleset. (title: Name) |
description | string | An informative description of the ruleset. (default: , title: Description) |
kind | string | The kind of the ruleset. (managed, custom, root, zone) (example: root, title: Kind) |
last_updated | string (date-time) | The timestamp of when the ruleset was last modified. (title: Last Updated) |
phase | string | The 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) |
rules | array | The list of rules in the ruleset. (title: Rules) |
version | string | The version of the ruleset. (example: 1, title: Version) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_by_account | select | ruleset_phase, account_id | Fetches the latest version of the account or zone entry point ruleset for a given phase. | |
list_by_zone | select | ruleset_phase, zone_id | Fetches the latest version of the account or zone entry point ruleset for a given phase. | |
update_by_account | replace | ruleset_phase, account_id | Updates an account or zone entry point ruleset, creating a new version. | |
update_by_zone | replace | ruleset_phase, zone_id | Updates 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.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
ruleset_phase | string | |
zone_id | string | The Cloudflare zone ID. |
SELECT examples
- list_by_account
- list_by_zone
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
;
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 zone_id = '{{ zone_id }}' -- required
;
REPLACE examples
- update_by_account
- update_by_zone
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;
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 zone_id = '{{ zone_id }}' --required
RETURNING
errors,
messages,
result,
success;