virtual_networks
Creates, updates, deletes, gets or lists a virtual_networks resource.
Overview
| Name | virtual_networks |
| Type | Resource |
| Id | cloudflare.zero_trust.virtual_networks |
Fields
The following fields are returned by SELECT queries:
- get
- list
A virtual network response
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | UUID of the virtual network. (example: f70ff985-a4ef-4643-bbbc-4a0ed4fc8415) |
name | string | A user-friendly name for the virtual network. (example: us-east-1-vpc) |
comment | string | Optional remark describing the virtual network. (default: , example: Staging VPC for data science) |
created_at | string (date-time) | Timestamp of when the resource was created. (example: 2021-01-25T18:22:34.317854Z) |
deleted_at | string (date-time) | Timestamp of when the resource was deleted. If null, the resource has not been deleted. (example: 2009-11-10T23:00:00.000000Z) |
is_default_network | boolean | If true, this virtual network is the default for the account. (x-stainless-terraform-configurability: computed_optional) |
List virtual networks response
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | UUID of the virtual network. (example: f70ff985-a4ef-4643-bbbc-4a0ed4fc8415) |
name | string | A user-friendly name for the virtual network. (example: us-east-1-vpc) |
comment | string | Optional remark describing the virtual network. (default: , example: Staging VPC for data science) |
created_at | string (date-time) | Timestamp of when the resource was created. (example: 2021-01-25T18:22:34.317854Z) |
deleted_at | string (date-time) | Timestamp of when the resource was deleted. If null, the resource has not been deleted. (example: 2009-11-10T23:00:00.000000Z) |
is_default_network | boolean | If true, this virtual network is the default for the account. (x-stainless-terraform-configurability: computed_optional) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | account_id, virtual_network_id | Get a virtual network. | |
list | select | account_id | id, name, is_default, is_default_network, is_deleted | Lists and filters virtual networks in an account. |
create | insert | account_id, name | Adds a new virtual network to an account. | |
edit | update | account_id, virtual_network_id | Updates an existing virtual network. | |
delete | delete | virtual_network_id, account_id | Deletes an existing virtual network. |
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. |
virtual_network_id | string (uuid) | |
id | string (uuid) | |
is_default | boolean | |
is_default_network | boolean | |
is_deleted | boolean | |
name | string |
SELECT examples
- get
- list
Get a virtual network.
SELECT
id,
name,
comment,
created_at,
deleted_at,
is_default_network
FROM cloudflare.zero_trust.virtual_networks
WHERE account_id = '{{ account_id }}' -- required
AND virtual_network_id = '{{ virtual_network_id }}' -- required
;
Lists and filters virtual networks in an account.
SELECT
id,
name,
comment,
created_at,
deleted_at,
is_default_network
FROM cloudflare.zero_trust.virtual_networks
WHERE account_id = '{{ account_id }}' -- required
AND id = '{{ id }}'
AND name = '{{ name }}'
AND is_default = '{{ is_default }}'
AND is_default_network = '{{ is_default_network }}'
AND is_deleted = '{{ is_deleted }}'
;
INSERT examples
- create
- Manifest
Adds a new virtual network to an account.
INSERT INTO cloudflare.zero_trust.virtual_networks (
comment,
is_default,
is_default_network,
name,
account_id
)
SELECT
'{{ comment }}',
{{ is_default }},
{{ is_default_network }},
'{{ name }}' /* required */,
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: virtual_networks
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the virtual_networks resource.
- name: comment
value: "{{ comment }}"
description: |
Optional remark describing the virtual network.
default:
- name: is_default
value: {{ is_default }}
description: |
If `true`, this virtual network is the default for the account.
- name: is_default_network
value: {{ is_default_network }}
description: |
If `true`, this virtual network is the default for the account.
default: false
- name: name
value: "{{ name }}"
description: |
A user-friendly name for the virtual network.
UPDATE examples
- edit
Updates an existing virtual network.
UPDATE cloudflare.zero_trust.virtual_networks
SET
comment = '{{ comment }}',
is_default_network = {{ is_default_network }},
name = '{{ name }}'
WHERE
account_id = '{{ account_id }}' --required
AND virtual_network_id = '{{ virtual_network_id }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete
Deletes an existing virtual network.
DELETE FROM cloudflare.zero_trust.virtual_networks
WHERE virtual_network_id = '{{ virtual_network_id }}' --required
AND account_id = '{{ account_id }}' --required
;