Skip to main content

views

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

Overview

Nameviews
TypeResource
Idcloudflare.dns.views

Fields

The following fields are returned by SELECT queries:

Get DNS Internal View response

NameDatatypeDescription
idstringIdentifier. (example: 023e105f4ecef8ad9ca31a8372d0c353)
namestringThe name of the view. (example: my view)
created_timestring (date-time)When the view was created. (example: 2014-01-01T05:20:00.12345Z)
modified_timestring (date-time)When the view was last modified. (example: 2014-01-01T05:20:00.12345Z)
zonesarrayThe list of zones linked to this view. (x-stainless-collection-type: set)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectaccount_id, view_idGet DNS Internal View
listselectaccount_idname, name.exact, name.contains, name.startswith, name.endswith, zone_id, zone_name, match, page, per_page, order, directionList DNS Internal Views for an Account
createinsertaccount_idCreate Internal DNS View for an account
editupdateaccount_id, view_idUpdate an existing Internal DNS View
deletedeleteaccount_id, view_idDelete an existing Internal DNS View

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.
view_idstring
directionstring
matchstring
namestring
name.containsstring
name.endswithstring
name.exactstring
name.startswithstring
orderstring
pagenumber
per_pagenumber
zone_idstring
zone_namestring

SELECT examples

Get DNS Internal View

SELECT
id,
name,
created_time,
modified_time,
zones
FROM cloudflare.dns.views
WHERE account_id = '{{ account_id }}' -- required
AND view_id = '{{ view_id }}' -- required
;

INSERT examples

Create Internal DNS View for an account

INSERT INTO cloudflare.dns.views (
name,
zones,
account_id
)
SELECT
'{{ name }}',
'{{ zones }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;

UPDATE examples

Update an existing Internal DNS View

UPDATE cloudflare.dns.views
SET
name = '{{ name }}',
zones = '{{ zones }}'
WHERE
account_id = '{{ account_id }}' --required
AND view_id = '{{ view_id }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Delete an existing Internal DNS View

DELETE FROM cloudflare.dns.views
WHERE account_id = '{{ account_id }}' --required
AND view_id = '{{ view_id }}' --required
;