Skip to main content

by_tag

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

Overview

Nameby_tag
TypeResource
Idcloudflare.rulesets.by_tag

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
get_by_accountselectrule_tag, ruleset_version, ruleset_id, account_idFetches the rules of a managed account or zone ruleset version for a given tag.
get_by_zoneselectrule_tag, ruleset_version, ruleset_id, zone_idFetches the rules of a managed account or zone ruleset version for a given tag.

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.
rule_tagstring
ruleset_idstringThe ruleset ID.
ruleset_versionstring
zone_idstringThe Cloudflare zone ID.

SELECT examples

Fetches the rules of a managed account or zone ruleset version for a given tag.

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