Skip to main content

response_policy_rules

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

Overview​

Nameresponse_policy_rules
TypeResource
Idgoogle.dns.response_policy_rules

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
behaviorstringAnswer this query with a behavior rather than DNS data. (behaviorUnspecified, bypassResponsePolicy)
dnsNamestringThe DNS name (wildcard or exact) to apply this rule to. Must be unique within the Response Policy Rule.
kindstring (default: dns#responsePolicyRule)
localDataobjectAnswer this query directly with DNS data. These ResourceRecordSets override any other DNS behavior for the matched name; in particular they override private zones, the public internet, and GCP internal DNS. No SOA nor NS types are allowed. (id: ResponsePolicyRuleLocalData)
ruleNamestringAn identifier for this rule. Must be unique with the ResponsePolicy.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectproject, responsePolicy, responsePolicyRuleclientOperationIdFetches the representation of an existing Response Policy Rule.
listselectproject, responsePolicymaxResults, pageTokenEnumerates all Response Policy Rules associated with a project.
createinsertproject, responsePolicyclientOperationIdCreates a new Response Policy Rule.
patchupdateproject, responsePolicy, responsePolicyRuleclientOperationIdApplies a partial update to an existing Response Policy Rule.
updatereplaceproject, responsePolicy, responsePolicyRuleclientOperationIdUpdates an existing Response Policy Rule.
deletedeleteproject, responsePolicy, responsePolicyRuleclientOperationIdDeletes a previously created Response Policy Rule.

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
responsePolicyRulestring
clientOperationIdstring
maxResultsinteger (int32)
pageTokenstring

SELECT examples​

Fetches the representation of an existing Response Policy Rule.

SELECT
behavior,
dnsName,
kind,
localData,
ruleName
FROM google.dns.response_policy_rules
WHERE project = '{{ project }}' -- required
AND responsePolicy = '{{ responsePolicy }}' -- required
AND responsePolicyRule = '{{ responsePolicyRule }}' -- required
AND clientOperationId = '{{ clientOperationId }}'
;

INSERT examples​

Creates a new Response Policy Rule.

INSERT INTO google.dns.response_policy_rules (
data__behavior,
data__dnsName,
data__kind,
data__localData,
data__ruleName,
project,
responsePolicy,
clientOperationId
)
SELECT
'{{ behavior }}',
'{{ dnsName }}',
'{{ kind }}',
'{{ localData }}',
'{{ ruleName }}',
'{{ project }}',
'{{ responsePolicy }}',
'{{ clientOperationId }}'
RETURNING
behavior,
dnsName,
kind,
localData,
ruleName
;

UPDATE examples​

Applies a partial update to an existing Response Policy Rule.

UPDATE google.dns.response_policy_rules
SET
data__behavior = '{{ behavior }}',
data__dnsName = '{{ dnsName }}',
data__kind = '{{ kind }}',
data__localData = '{{ localData }}',
data__ruleName = '{{ ruleName }}'
WHERE
project = '{{ project }}' --required
AND responsePolicy = '{{ responsePolicy }}' --required
AND responsePolicyRule = '{{ responsePolicyRule }}' --required
AND clientOperationId = '{{ clientOperationId}}'
RETURNING
responsePolicyRule;

REPLACE examples​

Updates an existing Response Policy Rule.

REPLACE google.dns.response_policy_rules
SET
data__behavior = '{{ behavior }}',
data__dnsName = '{{ dnsName }}',
data__kind = '{{ kind }}',
data__localData = '{{ localData }}',
data__ruleName = '{{ ruleName }}'
WHERE
project = '{{ project }}' --required
AND responsePolicy = '{{ responsePolicy }}' --required
AND responsePolicyRule = '{{ responsePolicyRule }}' --required
AND clientOperationId = '{{ clientOperationId}}'
RETURNING
responsePolicyRule;

DELETE examples​

Deletes a previously created Response Policy Rule.

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