Skip to main content

response_policies

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

Overview

Nameresponse_policies
TypeResource
Idgoogle.dns.response_policies

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
idstring (int64)Unique identifier for the resource; defined by the server (output only).
descriptionstringUser-provided description for this Response Policy.
gkeClustersarrayThe list of Google Kubernetes Engine clusters to which this response policy is applied.
kindstring (default: dns#responsePolicy)
labelsobjectUser labels.
networksarrayList of network names specifying networks to which this policy is applied.
responsePolicyNamestringUser assigned name for this Response Policy.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectproject, responsePolicyclientOperationIdFetches the representation of an existing Response Policy.
listselectprojectmaxResults, pageTokenEnumerates all Response Policies associated with a project.
createinsertprojectclientOperationIdCreates a new Response Policy
patchupdateproject, responsePolicyclientOperationIdApplies a partial update to an existing Response Policy.
updatereplaceproject, responsePolicyclientOperationIdUpdates an existing Response Policy.
deletedeleteproject, responsePolicyclientOperationIdDeletes a previously created Response Policy. Fails if the response policy is non-empty or 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.

NameDatatypeDescription
projectstring
responsePolicystring
clientOperationIdstring
maxResultsinteger (int32)
pageTokenstring

SELECT examples

Fetches the representation of an existing Response Policy.

SELECT
id,
description,
gkeClusters,
kind,
labels,
networks,
responsePolicyName
FROM google.dns.response_policies
WHERE project = '{{ project }}' -- required
AND responsePolicy = '{{ responsePolicy }}' -- required
AND clientOperationId = '{{ clientOperationId }}';

INSERT examples

Creates a new Response Policy

INSERT INTO google.dns.response_policies (
data__id,
data__responsePolicyName,
data__description,
data__networks,
data__gkeClusters,
data__labels,
data__kind,
project,
clientOperationId
)
SELECT
'{{ id }}',
'{{ responsePolicyName }}',
'{{ description }}',
'{{ networks }}',
'{{ gkeClusters }}',
'{{ labels }}',
'{{ kind }}',
'{{ project }}',
'{{ clientOperationId }}'
RETURNING
id,
description,
gkeClusters,
kind,
labels,
networks,
responsePolicyName
;

UPDATE examples

Applies a partial update to an existing Response Policy.

UPDATE google.dns.response_policies
SET
data__id = '{{ id }}',
data__responsePolicyName = '{{ responsePolicyName }}',
data__description = '{{ description }}',
data__networks = '{{ networks }}',
data__gkeClusters = '{{ gkeClusters }}',
data__labels = '{{ labels }}',
data__kind = '{{ kind }}'
WHERE
project = '{{ project }}' --required
AND responsePolicy = '{{ responsePolicy }}' --required
AND clientOperationId = '{{ clientOperationId}}'
RETURNING
responsePolicy;

REPLACE examples

Updates an existing Response Policy.

REPLACE google.dns.response_policies
SET
data__id = '{{ id }}',
data__responsePolicyName = '{{ responsePolicyName }}',
data__description = '{{ description }}',
data__networks = '{{ networks }}',
data__gkeClusters = '{{ gkeClusters }}',
data__labels = '{{ labels }}',
data__kind = '{{ kind }}'
WHERE
project = '{{ project }}' --required
AND responsePolicy = '{{ responsePolicy }}' --required
AND clientOperationId = '{{ clientOperationId}}'
RETURNING
responsePolicy;

DELETE examples

Deletes a previously created Response Policy. Fails if the response policy is non-empty or still being referenced by a network.

DELETE FROM google.dns.response_policies
WHERE project = '{{ project }}' --required
AND responsePolicy = '{{ responsePolicy }}' --required
AND clientOperationId = '{{ clientOperationId }}';