// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/dns.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const dns = google.dns('v1beta2');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: [
'https://www.googleapis.com/auth/cloud-platform',
'https://www.googleapis.com/auth/cloud-platform.read-only',
'https://www.googleapis.com/auth/ndev.clouddns.readonly',
'https://www.googleapis.com/auth/ndev.clouddns.readwrite',
],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await dns.changes.get({
// The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse.
changeId: 'placeholder-value',
// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
clientOperationId: 'placeholder-value',
// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
managedZone: 'placeholder-value',
// Identifies the project addressed by this request.
project: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "additions": [],
// "deletions": [],
// "id": "my_id",
// "isServing": false,
// "kind": "my_kind",
// "startTime": "my_startTime",
// "status": "my_status"
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/dns.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const dns = google.dns('v1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: [
'https://www.googleapis.com/auth/cloud-platform',
'https://www.googleapis.com/auth/cloud-platform.read-only',
'https://www.googleapis.com/auth/ndev.clouddns.readonly',
'https://www.googleapis.com/auth/ndev.clouddns.readwrite',
],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await dns.dnsKeys.get({
// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
clientOperationId: 'placeholder-value',
// An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type is computed and displayed.
digestType: 'placeholder-value',
// The identifier of the requested DnsKey.
dnsKeyId: 'placeholder-value',
// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
managedZone: 'placeholder-value',
// Identifies the project addressed by this request.
project: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "algorithm": "my_algorithm",
// "creationTime": "my_creationTime",
// "description": "my_description",
// "digests": [],
// "id": "my_id",
// "isActive": false,
// "keyLength": 0,
// "keyTag": 0,
// "kind": "my_kind",
// "publicKey": "my_publicKey",
// "type": "my_type"
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/dns.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const dns = google.dns('v1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: [
'https://www.googleapis.com/auth/cloud-platform',
'https://www.googleapis.com/auth/ndev.clouddns.readwrite',
],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await dns.managedZones.delete({
// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
clientOperationId: 'placeholder-value',
// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
managedZone: 'placeholder-value',
// Identifies the project addressed by this request.
project: 'placeholder-value',
});
console.log(res.data);
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/dns.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const dns = google.dns('v1beta2');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: [
'https://www.googleapis.com/auth/cloud-platform',
'https://www.googleapis.com/auth/cloud-platform.read-only',
'https://www.googleapis.com/auth/ndev.clouddns.readonly',
'https://www.googleapis.com/auth/ndev.clouddns.readwrite',
],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await dns.resourceRecordSets.get({
// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
clientOperationId: 'placeholder-value',
// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
managedZone: 'placeholder-value',
// Fully qualified domain name.
name: 'placeholder-value',
// Identifies the project addressed by this request.
project: 'placeholder-value',
// RRSet type.
type: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "kind": "my_kind",
// "name": "my_name",
// "routingPolicy": {},
// "rrdatas": [],
// "signatureRrdatas": [],
// "ttl": 0,
// "type": "my_type"
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/dns.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const dns = google.dns('v1beta2');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: [
'https://www.googleapis.com/auth/cloud-platform',
'https://www.googleapis.com/auth/ndev.clouddns.readwrite',
],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await dns.managedZones.delete({
// For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.
clientOperationId: 'placeholder-value',
// Identifies the managed zone addressed by this request. Can be the managed zone name or ID.
managedZone: 'placeholder-value',
// Identifies the project addressed by this request.
project: 'placeholder-value',
});
console.log(res.data);
}
main().catch(e => {
console.error(e);
throw e;
});