Skip to main content

dns_zones

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

Overview

Namedns_zones
TypeResource
Idgoogle.servicenetworking.dns_zones

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
consumerPeeringZoneobjectThe DNS peering zone created in the consumer project. (id: DnsZone)
producerPrivateZoneobjectThe private DNS zone created in the shared producer host project. (id: DnsZone)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservicesId, projectsId, networksId, dnsZonesIdService producers can use this method to retrieve a DNS zone in the shared producer host project and the matching peering zones in consumer project
listselectservicesId, projectsId, networksId* Service producers can use this method to retrieve a list of available DNS zones in the shared producer host project and the matching peering zones in the consumer project. *
addinsertservicesIdService producers can use this method to add private DNS zones in the shared producer host project and matching peering zones in the consumer project.
removedeleteservicesIdService producers can use this method to remove private DNS zones in the shared producer host project and matching peering zones in the consumer project.

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
dnsZonesIdstring
networksIdstring
projectsIdstring
servicesIdstring

SELECT examples

Service producers can use this method to retrieve a DNS zone in the shared producer host project and the matching peering zones in consumer project

SELECT
consumerPeeringZone,
producerPrivateZone
FROM google.servicenetworking.dns_zones
WHERE servicesId = '{{ servicesId }}' -- required
AND projectsId = '{{ projectsId }}' -- required
AND networksId = '{{ networksId }}' -- required
AND dnsZonesId = '{{ dnsZonesId }}' -- required;

INSERT examples

Service producers can use this method to add private DNS zones in the shared producer host project and matching peering zones in the consumer project.

INSERT INTO google.servicenetworking.dns_zones (
data__consumerNetwork,
data__name,
data__dnsSuffix,
servicesId
)
SELECT
'{{ consumerNetwork }}',
'{{ name }}',
'{{ dnsSuffix }}',
'{{ servicesId }}'
RETURNING
name,
done,
error,
metadata,
response
;

DELETE examples

Service producers can use this method to remove private DNS zones in the shared producer host project and matching peering zones in the consumer project.

DELETE FROM google.servicenetworking.dns_zones
WHERE servicesId = '{{ servicesId }}' --required;