Skip to main content

delegations

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

Overview

Namedelegations
TypeResource
Idcloudflare.addressing.delegations

Fields

The following fields are returned by SELECT queries:

List Prefix Delegations response

NameDatatypeDescription
idstringIdentifier of a Delegation. (example: d933b1530bc56c9953cf8ce166da8004)
delegated_account_idstringAccount identifier for the account to which prefix is being delegated. (example: b1946ac92492d2347c6235b4d2611184)
parent_prefix_idstringIdentifier of an IP Prefix. (example: 2af39739cc4e3b5910c918468bb89828)
cidrstringIP Prefix in Classless Inter-Domain Routing format. (example: 192.0.2.0/24)
created_atstring (date-time) (example: 2014-01-01T05:20:00.12345Z)
modified_atstring (date-time) (example: 2014-01-01T05:20:00.12345Z)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectprefix_id, account_idList all delegations for a given account IP prefix.
createinsertprefix_id, account_id, cidr, delegated_account_idCreate a new account delegation for a given IP prefix.
deletedeletedelegation_id, prefix_id, account_idDelete an account delegation for a given IP prefix.

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.
delegation_idstring
prefix_idstringThe IP prefix ID.

SELECT examples

List all delegations for a given account IP prefix.

SELECT
id,
delegated_account_id,
parent_prefix_id,
cidr,
created_at,
modified_at
FROM cloudflare.addressing.delegations
WHERE prefix_id = '{{ prefix_id }}' -- required
AND account_id = '{{ account_id }}' -- required
;

INSERT examples

Create a new account delegation for a given IP prefix.

INSERT INTO cloudflare.addressing.delegations (
cidr,
delegated_account_id,
prefix_id,
account_id
)
SELECT
'{{ cidr }}' /* required */,
'{{ delegated_account_id }}' /* required */,
'{{ prefix_id }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;

DELETE examples

Delete an account delegation for a given IP prefix.

DELETE FROM cloudflare.addressing.delegations
WHERE delegation_id = '{{ delegation_id }}' --required
AND prefix_id = '{{ prefix_id }}' --required
AND account_id = '{{ account_id }}' --required
;