Get
Returns the specified DNS zone.
To get the list of all available DNS zones, make a List request.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetDnsZoneRequest = cloudApi.dns.dns_zone_service.GetDnsZoneRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.DnsZoneServiceClient);
const result = await client.get(
GetDnsZoneRequest.fromPartial({
dnsZoneId: "dnsZoneId",
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.dns.v1.dns_zone_service_pb2_grpc import DnsZoneServiceStub
from yandex.cloud.dns.v1.dns_zone_service_pb2 import GetDnsZoneRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(DnsZoneServiceStub)
response = service.Get(GetDnsZoneRequest(dns_zone_id="dnsZoneId"))
print(response)
GetDnsZoneRequest
dnsZoneId
: string
ID of the DNS zone to return.
To get a DNS zone ID, make a DnsZoneService.List request.
DnsZone
A DNS zone. For details about the concept, see DNS zones.
id
: string
ID of the DNS zone. Generated at creation time.
folderId
: string
ID of the folder that the DNS zone belongs to.
createdAt
: google.protobuf.Timestamp
Creation timestamp.
name
: string
Name of the DNS zone. The name is unique within the folder.
description
: string
Description of the DNS zone.
labels
: string
DNS zone labels as key:value
pairs.
zone
: string
DNS zone suffix.
privateVisibility
: PrivateVisibility
Privately visible zone settings. Specifies whether records within the zone are visible from a VPC networks only.
publicVisibility
: PublicVisibility
Publicly visible zone settings. Indicates whether records within the zone are publicly visible.
deletionProtection
: bool
Prevents accidental zone removal.
PrivateVisibility
Configuration for privately visible zones.
networkIds
: string
Network IDs.
PublicVisibility
Configuration for publicly visible zones.