rules
Creates, updates, deletes, gets or lists a rules resource.
Overview
| Name | rules |
| Type | Resource |
| Id | cloudflare.magic_transit.rules |
Fields
The following fields are returned by SELECT queries:
- get
- list
Get DNS Protection rule response.
| Name | Datatype | Description |
|---|---|---|
id | string | The unique ID of the DNS Protection rule. |
name | string | The name of the DNS Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'. |
burst_sensitivity | string | The burst sensitivity. Must be one of 'low', 'medium', 'high'. |
created_on | string (date-time) | The creation timestamp of the DNS Protection rule. |
mode | string | The mode for DNS Protection. Must be one of 'enabled', 'disabled', 'monitoring'. |
modified_on | string (date-time) | The last modification timestamp of the DNS Protection rule. |
profile_sensitivity | string | The profile sensitivity. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'. |
rate_sensitivity | string | The rate sensitivity. Must be one of 'low', 'medium', 'high'. |
scope | string | The scope for the DNS Protection rule. Must be one of 'global', 'region', or 'datacenter'. |
List all DNS Protection rules response.
| Name | Datatype | Description |
|---|---|---|
id | string | The unique ID of the DNS Protection rule. |
name | string | The name of the DNS Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'. |
burst_sensitivity | string | The burst sensitivity. Must be one of 'low', 'medium', 'high'. |
created_on | string (date-time) | The creation timestamp of the DNS Protection rule. |
mode | string | The mode for DNS Protection. Must be one of 'enabled', 'disabled', 'monitoring'. |
modified_on | string (date-time) | The last modification timestamp of the DNS Protection rule. |
profile_sensitivity | string | The profile sensitivity. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'. |
rate_sensitivity | string | The rate sensitivity. Must be one of 'low', 'medium', 'high'. |
scope | string | The scope for the DNS Protection rule. Must be one of 'global', 'region', or 'datacenter'. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | account_id, rule_id | Get a DNS Protection rule specified by the given UUID. | |
list | select | account_id | page, per_page, order, direction | List all DNS Protection rules for an account. |
create_dns_protection_rule | insert | account_id, scope, name, mode, profile_sensitivity, rate_sensitivity, burst_sensitivity | Create a DNS Protection rule for an account. | |
update_dns_protection_rule | update | account_id, rule_id | Update a DNS Protection rule specified by the given UUID. | |
delete_dns_protection_rule | delete | account_id, rule_id | Delete a DNS Protection rule specified by the given UUID. | |
delete_dns_protection_rules_for_account | delete | account_id | Delete all DNS Protection rules for an account. |
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. |
rule_id | string | The rule ID. |
direction | string | The direction of ordering (ASC or DESC). Defaults to 'ASC'. |
order | string | The field to order by. Defaults to 'prefix'. |
page | integer (int64) | The page number for pagination. Defaults to 1. |
per_page | integer (int64) | The number of items per page. Must be between 10 and 1000. Defaults to 25. |
SELECT examples
- get
- list
Get a DNS Protection rule specified by the given UUID.
SELECT
id,
name,
burst_sensitivity,
created_on,
mode,
modified_on,
profile_sensitivity,
rate_sensitivity,
scope
FROM cloudflare.magic_transit.rules
WHERE account_id = '{{ account_id }}' -- required
AND rule_id = '{{ rule_id }}' -- required
;
List all DNS Protection rules for an account.
SELECT
id,
name,
burst_sensitivity,
created_on,
mode,
modified_on,
profile_sensitivity,
rate_sensitivity,
scope
FROM cloudflare.magic_transit.rules
WHERE account_id = '{{ account_id }}' -- required
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND order = '{{ order }}'
AND direction = '{{ direction }}'
;
INSERT examples
- create_dns_protection_rule
- Manifest
Create a DNS Protection rule for an account.
INSERT INTO cloudflare.magic_transit.rules (
burst_sensitivity,
mode,
name,
profile_sensitivity,
rate_sensitivity,
scope,
account_id
)
SELECT
'{{ burst_sensitivity }}' /* required */,
'{{ mode }}' /* required */,
'{{ name }}' /* required */,
'{{ profile_sensitivity }}' /* required */,
'{{ rate_sensitivity }}' /* required */,
'{{ scope }}' /* required */,
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: rules
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the rules resource.
- name: burst_sensitivity
value: "{{ burst_sensitivity }}"
description: |
The burst sensitivity. Must be one of 'low', 'medium', 'high'.
- name: mode
value: "{{ mode }}"
description: |
The mode for DNS Protection. Must be one of 'enabled', 'disabled', 'monitoring'.
- name: name
value: "{{ name }}"
description: |
The name of the DNS Protection rule. Value is relative to the 'scope' setting. For 'global' scope, name should be 'global'. For either the 'region' or 'datacenter' scope, name should be the actual name of the region or datacenter, e.g., 'wnam' or 'lax'.
- name: profile_sensitivity
value: "{{ profile_sensitivity }}"
description: |
The profile sensitivity. Recommended setting is 'low'. Must be one of 'low', 'medium', 'high', or 'very_high'.
- name: rate_sensitivity
value: "{{ rate_sensitivity }}"
description: |
The rate sensitivity. Must be one of 'low', 'medium', 'high'.
- name: scope
value: "{{ scope }}"
description: |
The scope for the DNS Protection rule. Must be one of 'global', 'region', or 'datacenter'.
UPDATE examples
- update_dns_protection_rule
Update a DNS Protection rule specified by the given UUID.
UPDATE cloudflare.magic_transit.rules
SET
burst_sensitivity = '{{ burst_sensitivity }}',
mode = '{{ mode }}',
profile_sensitivity = '{{ profile_sensitivity }}',
rate_sensitivity = '{{ rate_sensitivity }}'
WHERE
account_id = '{{ account_id }}' --required
AND rule_id = '{{ rule_id }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete_dns_protection_rule
- delete_dns_protection_rules_for_account
Delete a DNS Protection rule specified by the given UUID.
DELETE FROM cloudflare.magic_transit.rules
WHERE account_id = '{{ account_id }}' --required
AND rule_id = '{{ rule_id }}' --required
;
Delete all DNS Protection rules for an account.
DELETE FROM cloudflare.magic_transit.rules
WHERE account_id = '{{ account_id }}' --required
;