views
Creates, updates, deletes, gets or lists a views resource.
Overview
| Name | views |
| Type | Resource |
| Id | cloudflare.dns.views |
Fields
The following fields are returned by SELECT queries:
- get
- list
Get DNS Internal View response
| Name | Datatype | Description |
|---|---|---|
id | string | Identifier. (example: 023e105f4ecef8ad9ca31a8372d0c353) |
name | string | The name of the view. (example: my view) |
created_time | string (date-time) | When the view was created. (example: 2014-01-01T05:20:00.12345Z) |
modified_time | string (date-time) | When the view was last modified. (example: 2014-01-01T05:20:00.12345Z) |
zones | array | The list of zones linked to this view. (x-stainless-collection-type: set) |
List Internal DNS Views response
| Name | Datatype | Description |
|---|---|---|
id | string | Identifier. (example: 023e105f4ecef8ad9ca31a8372d0c353) |
name | string | The name of the view. (example: my view) |
created_time | string (date-time) | When the view was created. (example: 2014-01-01T05:20:00.12345Z) |
modified_time | string (date-time) | When the view was last modified. (example: 2014-01-01T05:20:00.12345Z) |
zones | array | The list of zones linked to this view. (x-stainless-collection-type: set) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | account_id, view_id | Get DNS Internal View | |
list | select | account_id | name, name.exact, name.contains, name.startswith, name.endswith, zone_id, zone_name, match, page, per_page, order, direction | List DNS Internal Views for an Account |
create | insert | account_id | Create Internal DNS View for an account | |
edit | update | account_id, view_id | Update an existing Internal DNS View | |
delete | delete | account_id, view_id | Delete 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.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
view_id | string | |
direction | string | |
match | string | |
name | string | |
name.contains | string | |
name.endswith | string | |
name.exact | string | |
name.startswith | string | |
order | string | |
page | number | |
per_page | number | |
zone_id | string | |
zone_name | string |
SELECT examples
- get
- list
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
;
List DNS Internal Views for an Account
SELECT
id,
name,
created_time,
modified_time,
zones
FROM cloudflare.dns.views
WHERE account_id = '{{ account_id }}' -- required
AND name = '{{ name }}'
AND name.exact = '{{ name.exact }}'
AND name.contains = '{{ name.contains }}'
AND name.startswith = '{{ name.startswith }}'
AND name.endswith = '{{ name.endswith }}'
AND zone_id = '{{ zone_id }}'
AND zone_name = '{{ zone_name }}'
AND match = '{{ match }}'
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND order = '{{ order }}'
AND direction = '{{ direction }}'
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: views
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the views resource.
- name: name
value: "{{ name }}"
description: |
The name of the view.
- name: zones
value:
- "{{ zones }}"
description: |
The list of zones linked to this view.
UPDATE examples
- edit
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
Delete an existing Internal DNS View
DELETE FROM cloudflare.dns.views
WHERE account_id = '{{ account_id }}' --required
AND view_id = '{{ view_id }}' --required
;