configs
Creates, updates, deletes, gets or lists a configs resource.
Overview
| Name | configs |
| Type | Resource |
| Id | cloudflare.magic_network_monitoring.configs |
Fields
The following fields are returned by SELECT queries:
- list
List account configuration response
| Name | Datatype | Description |
|---|---|---|
name | string | The account name. (example: cloudflare user's account) |
default_sampling | number | Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router. |
router_ips | array | |
warp_devices | array |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | account_id | Lists default sampling, router IPs and warp devices for account. | |
create | insert | account_id, name, default_sampling | Create a new network monitoring configuration. | |
edit | update | account_id | Update fields in an existing network monitoring configuration. | |
update | replace | account_id, name, default_sampling | Update an existing network monitoring configuration, requires the entire configuration to be updated at once. | |
delete | delete | account_id | Delete an existing network monitoring configuration. |
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. |
SELECT examples
- list
Lists default sampling, router IPs and warp devices for account.
SELECT
name,
default_sampling,
router_ips,
warp_devices
FROM cloudflare.magic_network_monitoring.configs
WHERE account_id = '{{ account_id }}' -- required
;
INSERT examples
- create
- Manifest
Create a new network monitoring configuration.
INSERT INTO cloudflare.magic_network_monitoring.configs (
default_sampling,
name,
router_ips,
warp_devices,
account_id
)
SELECT
{{ default_sampling }} /* required */,
'{{ name }}' /* required */,
'{{ router_ips }}',
'{{ warp_devices }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: configs
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the configs resource.
- name: default_sampling
value: {{ default_sampling }}
description: |
Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.
default: 1
- name: name
value: "{{ name }}"
description: |
The account name.
- name: router_ips
value:
- "{{ router_ips }}"
- name: warp_devices
value:
- id: "{{ id }}"
name: "{{ name }}"
router_ip: "{{ router_ip }}"
UPDATE examples
- edit
Update fields in an existing network monitoring configuration.
UPDATE cloudflare.magic_network_monitoring.configs
SET
default_sampling = {{ default_sampling }},
name = '{{ name }}',
router_ips = '{{ router_ips }}',
warp_devices = '{{ warp_devices }}'
WHERE
account_id = '{{ account_id }}' --required
RETURNING
errors,
messages,
result,
success;
REPLACE examples
- update
Update an existing network monitoring configuration, requires the entire configuration to be updated at once.
REPLACE cloudflare.magic_network_monitoring.configs
SET
default_sampling = {{ default_sampling }},
name = '{{ name }}',
router_ips = '{{ router_ips }}',
warp_devices = '{{ warp_devices }}'
WHERE
account_id = '{{ account_id }}' --required
AND name = '{{ name }}' --required
AND default_sampling = '{{ default_sampling }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete
Delete an existing network monitoring configuration.
DELETE FROM cloudflare.magic_network_monitoring.configs
WHERE account_id = '{{ account_id }}' --required
;