peers
Creates, updates, deletes, gets or lists a peers resource.
Overview
| Name | peers |
| Type | Resource |
| Id | cloudflare.dns.peers |
Fields
The following fields are returned by SELECT queries:
- get
- list
Peer Details response.
| Name | Datatype | Description |
|---|---|---|
id | string | (example: 23ff594956f20c2a721606e94745a8aa) |
name | string | The name of the peer. (example: my-peer-1) |
tsig_id | string | TSIG authentication will be used for zone transfer if configured. (example: 69cd1e104af3e6ed3cb344f263fd0d5a) |
ip | string | IPv4/IPv6 address of primary or secondary nameserver, depending on what zone this peer is linked to. For primary zones this IP defines the IP of the secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary zones this IP defines the IP of the primary nameserver Cloudflare will send AXFR/IXFR requests to. (example: 192.0.2.53) |
ixfr_enable | boolean | Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary zones. |
port | number | DNS port of primary or secondary nameserver, depending on what zone this peer is linked to. |
List Peers response.
| Name | Datatype | Description |
|---|---|---|
id | string | (example: 23ff594956f20c2a721606e94745a8aa) |
name | string | The name of the peer. (example: my-peer-1) |
tsig_id | string | TSIG authentication will be used for zone transfer if configured. (example: 69cd1e104af3e6ed3cb344f263fd0d5a) |
ip | string | IPv4/IPv6 address of primary or secondary nameserver, depending on what zone this peer is linked to. For primary zones this IP defines the IP of the secondary nameserver Cloudflare will NOTIFY upon zone changes. For secondary zones this IP defines the IP of the primary nameserver Cloudflare will send AXFR/IXFR requests to. (example: 192.0.2.53) |
ixfr_enable | boolean | Enable IXFR transfer protocol, default is AXFR. Only applicable to secondary zones. |
port | number | DNS port of primary or secondary nameserver, depending on what zone this peer is linked to. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | peer_id, account_id | Get Peer. | |
list | select | account_id | List Peers. | |
create | insert | account_id, name | Create Peer. | |
update | replace | peer_id, account_id, name | Modify Peer. | |
delete | delete | peer_id, account_id | Delete Peer. |
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. |
peer_id | string |
SELECT examples
- get
- list
Get Peer.
SELECT
id,
name,
tsig_id,
ip,
ixfr_enable,
port
FROM cloudflare.dns.peers
WHERE peer_id = '{{ peer_id }}' -- required
AND account_id = '{{ account_id }}' -- required
;
List Peers.
SELECT
id,
name,
tsig_id,
ip,
ixfr_enable,
port
FROM cloudflare.dns.peers
WHERE account_id = '{{ account_id }}' -- required
;
INSERT examples
- create
- Manifest
Create Peer.
INSERT INTO cloudflare.dns.peers (
name,
account_id
)
SELECT
'{{ name }}' /* required */,
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: peers
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the peers resource.
- name: name
value: "{{ name }}"
description: |
The name of the peer.
REPLACE examples
- update
Modify Peer.
REPLACE cloudflare.dns.peers
SET
ip = '{{ ip }}',
ixfr_enable = {{ ixfr_enable }},
name = '{{ name }}',
port = {{ port }},
tsig_id = '{{ tsig_id }}'
WHERE
peer_id = '{{ peer_id }}' --required
AND account_id = '{{ account_id }}' --required
AND name = '{{ name }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete
Delete Peer.
DELETE FROM cloudflare.dns.peers
WHERE peer_id = '{{ peer_id }}' --required
AND account_id = '{{ account_id }}' --required
;