groups
Creates, updates, deletes, gets or lists a groups resource.
Overview
| Name | groups |
| Type | Resource |
| Id | cloudflare.firewall.groups |
Fields
The following fields are returned by SELECT queries:
- get
- list
Get a WAF rule group response.
| Name | Datatype | Description |
|---|---|---|
errors | array | |
messages | array | |
result | object | |
success | boolean | Defines whether the API call was successful. (true) |
Defines the list WAF rule groups response.
| Name | Datatype | Description |
|---|---|---|
id | string | Defines the unique identifier of the rule group. (example: de677e5818985db1285d0e80225f06e5) |
name | string | Defines the name of the rule group. (example: Project Honey Pot) |
package_id | string | Defines the unique identifier of a WAF package. (example: a25a9a7e9c00afc1fb2e0245519d725b) |
allowed_modes | array | Defines the available states for the rule group. |
description | string | Defines an informative summary of what the rule group does. (example: Group designed to protect against IP addresses that are a threat and typically used to launch DDoS attacks) |
mode | string | Defines the state of the rules contained in the rule group. When on, the rules in the group are configurable/usable. (on, off) (default: on) |
modified_rules_count | number | Defines the number of rules within the group that have been modified from their default configuration. |
rules_count | number | Defines the number of rules in the current rule group. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | group_id, package_id, zone_id | Fetches the details of a WAF rule group. Note: Applies only to the previous version of WAF managed rules. | |
list | select | package_id, zone_id | mode, page, per_page, order, direction, match, name, rules_count | Fetches the WAF rule groups in a WAF package. Note: Applies only to the previous version of WAF managed rules. |
edit | update | group_id, package_id, zone_id | Updates a WAF rule group. You can update the state (mode parameter) of a rule group. Note: Applies only to the previous version of WAF managed rules. |
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 |
|---|---|---|
group_id | string | The Access group ID. |
package_id | string | |
zone_id | string | The Cloudflare zone ID. |
direction | string | |
match | string | |
mode | string | |
name | string | |
order | string | |
page | number | |
per_page | number | |
rules_count | number |
SELECT examples
- get
- list
Fetches the details of a WAF rule group. Note: Applies only to the previous version of WAF managed rules.
SELECT
errors,
messages,
result,
success
FROM cloudflare.firewall.groups
WHERE group_id = '{{ group_id }}' -- required
AND package_id = '{{ package_id }}' -- required
AND zone_id = '{{ zone_id }}' -- required
;
Fetches the WAF rule groups in a WAF package. Note: Applies only to the previous version of WAF managed rules.
SELECT
id,
name,
package_id,
allowed_modes,
description,
mode,
modified_rules_count,
rules_count
FROM cloudflare.firewall.groups
WHERE package_id = '{{ package_id }}' -- required
AND zone_id = '{{ zone_id }}' -- required
AND mode = '{{ mode }}'
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND order = '{{ order }}'
AND direction = '{{ direction }}'
AND match = '{{ match }}'
AND name = '{{ name }}'
AND rules_count = '{{ rules_count }}'
;
UPDATE examples
- edit
Updates a WAF rule group. You can update the state (mode parameter) of a rule group. Note: Applies only to the previous version of WAF managed rules.
UPDATE cloudflare.firewall.groups
SET
mode = '{{ mode }}'
WHERE
group_id = '{{ group_id }}' --required
AND package_id = '{{ package_id }}' --required
AND zone_id = '{{ zone_id }}' --required
RETURNING
errors,
messages,
result,
success;