policies
Creates, updates, deletes, gets or lists a policies
resource.
Overview
Name | policies |
Type | Resource |
Id | google.dns.policies |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
id | string (uint64) | Unique identifier for the resource; defined by the server (output only). |
name | string | User-assigned name for this policy. |
alternativeNameServerConfig | object | Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified. (id: PolicyAlternativeNameServerConfig) |
description | string | A mutable string of at most 1024 characters associated with this resource for the user's convenience. Has no effect on the policy's function. |
dns64Config | object | Configurations related to DNS64 for this Policy. (id: PolicyDns64Config) |
enableInboundForwarding | boolean | Allows networks bound to this policy to receive DNS queries sent by VMs or applications over VPN connections. When enabled, a virtual IP address is allocated from each of the subnetworks that are bound to this policy. |
enableLogging | boolean | Controls whether logging is enabled for the networks bound to this policy. Defaults to no logging if not set. |
kind | string | (default: dns#policy) |
networks | array | List of network names specifying networks to which this policy is applied. |
Successful response
Name | Datatype | Description |
---|---|---|
id | string (uint64) | Unique identifier for the resource; defined by the server (output only). |
name | string | User-assigned name for this policy. |
alternativeNameServerConfig | object | Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified. (id: PolicyAlternativeNameServerConfig) |
description | string | A mutable string of at most 1024 characters associated with this resource for the user's convenience. Has no effect on the policy's function. |
dns64Config | object | Configurations related to DNS64 for this Policy. (id: PolicyDns64Config) |
enableInboundForwarding | boolean | Allows networks bound to this policy to receive DNS queries sent by VMs or applications over VPN connections. When enabled, a virtual IP address is allocated from each of the subnetworks that are bound to this policy. |
enableLogging | boolean | Controls whether logging is enabled for the networks bound to this policy. Defaults to no logging if not set. |
kind | string | (default: dns#policy) |
networks | array | List of network names specifying networks to which this policy is applied. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | project , policy | clientOperationId | Fetches the representation of an existing Policy. |
list | select | project | maxResults , pageToken | Enumerates all Policies associated with a project. |
create | insert | project | clientOperationId | Creates a new Policy. |
patch | update | project , policy | clientOperationId | Applies a partial update to an existing Policy. |
update | replace | project , policy | clientOperationId | Updates an existing Policy. |
delete | delete | project , policy | clientOperationId | Deletes a previously created Policy. Fails if the policy is still being referenced by a 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 |
---|---|---|
policy | string | |
project | string | |
clientOperationId | string | |
maxResults | integer (int32) | |
pageToken | string |
SELECT
examples
- get
- list
Fetches the representation of an existing Policy.
SELECT
id,
name,
alternativeNameServerConfig,
description,
dns64Config,
enableInboundForwarding,
enableLogging,
kind,
networks
FROM google.dns.policies
WHERE project = '{{ project }}' -- required
AND policy = '{{ policy }}' -- required
AND clientOperationId = '{{ clientOperationId }}';
Enumerates all Policies associated with a project.
SELECT
id,
name,
alternativeNameServerConfig,
description,
dns64Config,
enableInboundForwarding,
enableLogging,
kind,
networks
FROM google.dns.policies
WHERE project = '{{ project }}' -- required
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- create
- Manifest
Creates a new Policy.
INSERT INTO google.dns.policies (
data__id,
data__name,
data__enableInboundForwarding,
data__description,
data__networks,
data__alternativeNameServerConfig,
data__enableLogging,
data__dns64Config,
data__kind,
project,
clientOperationId
)
SELECT
'{{ id }}',
'{{ name }}',
{{ enableInboundForwarding }},
'{{ description }}',
'{{ networks }}',
'{{ alternativeNameServerConfig }}',
{{ enableLogging }},
'{{ dns64Config }}',
'{{ kind }}',
'{{ project }}',
'{{ clientOperationId }}'
RETURNING
id,
name,
alternativeNameServerConfig,
description,
dns64Config,
enableInboundForwarding,
enableLogging,
kind,
networks
;
# Description fields are for documentation purposes
- name: policies
props:
- name: project
value: string
description: Required parameter for the policies resource.
- name: id
value: string
description: >
Unique identifier for the resource; defined by the server (output only).
- name: name
value: string
description: >
User-assigned name for this policy.
- name: enableInboundForwarding
value: boolean
description: >
Allows networks bound to this policy to receive DNS queries sent by VMs or applications over VPN connections. When enabled, a virtual IP address is allocated from each of the subnetworks that are bound to this policy.
- name: description
value: string
description: >
A mutable string of at most 1024 characters associated with this resource for the user's convenience. Has no effect on the policy's function.
- name: networks
value: array
description: >
List of network names specifying networks to which this policy is applied.
- name: alternativeNameServerConfig
value: object
description: >
Sets an alternative name server for the associated networks. When specified, all DNS queries are forwarded to a name server that you choose. Names such as .internal are not available when an alternative name server is specified.
- name: enableLogging
value: boolean
description: >
Controls whether logging is enabled for the networks bound to this policy. Defaults to no logging if not set.
- name: dns64Config
value: object
description: >
Configurations related to DNS64 for this Policy.
- name: kind
value: string
default: dns#policy
- name: clientOperationId
value: string
UPDATE
examples
- patch
Applies a partial update to an existing Policy.
UPDATE google.dns.policies
SET
data__id = '{{ id }}',
data__name = '{{ name }}',
data__enableInboundForwarding = {{ enableInboundForwarding }},
data__description = '{{ description }}',
data__networks = '{{ networks }}',
data__alternativeNameServerConfig = '{{ alternativeNameServerConfig }}',
data__enableLogging = {{ enableLogging }},
data__dns64Config = '{{ dns64Config }}',
data__kind = '{{ kind }}'
WHERE
project = '{{ project }}' --required
AND policy = '{{ policy }}' --required
AND clientOperationId = '{{ clientOperationId}}'
RETURNING
policy;
REPLACE
examples
- update
Updates an existing Policy.
REPLACE google.dns.policies
SET
data__id = '{{ id }}',
data__name = '{{ name }}',
data__enableInboundForwarding = {{ enableInboundForwarding }},
data__description = '{{ description }}',
data__networks = '{{ networks }}',
data__alternativeNameServerConfig = '{{ alternativeNameServerConfig }}',
data__enableLogging = {{ enableLogging }},
data__dns64Config = '{{ dns64Config }}',
data__kind = '{{ kind }}'
WHERE
project = '{{ project }}' --required
AND policy = '{{ policy }}' --required
AND clientOperationId = '{{ clientOperationId}}'
RETURNING
policy;
DELETE
examples
- delete
Deletes a previously created Policy. Fails if the policy is still being referenced by a network.
DELETE FROM google.dns.policies
WHERE project = '{{ project }}' --required
AND policy = '{{ policy }}' --required
AND clientOperationId = '{{ clientOperationId }}';