0.0.20241021 • Published 8 months ago

@maxim_mazurok/gapi.client.dns-v1 v0.0.20241021

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

TypeScript typings for Cloud DNS API v1

For detailed description please check documentation.

Installing

Install typings for Cloud DNS API:

npm install @types/gapi.client.dns-v1 --save-dev

Usage

You need to initialize Google API client in your code:

gapi.load('client', () => {
  // now we can use gapi.client
  // ...
});

Then load api client wrapper:

gapi.client.load(
  'https://dns.googleapis.com/$discovery/rest?version=v1',
  () => {
    // now we can use:
    // gapi.client.dns
  }
);
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
gapi.client.load('dns', 'v1', () => {
  // now we can use:
  // gapi.client.dns
});

Don't forget to authenticate your client before sending any request to resources:

// declare client_id registered in Google Developers Console
var client_id = '',
  scope = [
    // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
    'https://www.googleapis.com/auth/cloud-platform',

    // View your data across Google Cloud services and see the email address of your Google Account
    'https://www.googleapis.com/auth/cloud-platform.read-only',

    // View your DNS records hosted by Google Cloud DNS
    'https://www.googleapis.com/auth/ndev.clouddns.readonly',

    // View and manage your DNS records hosted by Google Cloud DNS
    'https://www.googleapis.com/auth/ndev.clouddns.readwrite',
  ],
  immediate = true;
// ...

gapi.auth.authorize(
  {client_id: client_id, scope: scope, immediate: immediate},
  authResult => {
    if (authResult && !authResult.error) {
      /* handle successful authorization */
    } else {
      /* handle authorization error */
    }
  }
);

After that you can use Cloud DNS API resources:

/*
Atomically updates the ResourceRecordSet collection.
*/
await gapi.client.dns.changes.create({
  managedZone: 'managedZone',
  project: 'project',
});

/*
Fetches the representation of an existing Change.
*/
await gapi.client.dns.changes.get({
  changeId: 'changeId',
  managedZone: 'managedZone',
  project: 'project',
});

/*
Enumerates Changes to a ResourceRecordSet collection.
*/
await gapi.client.dns.changes.list({
  managedZone: 'managedZone',
  project: 'project',
});

/*
Fetches the representation of an existing DnsKey.
*/
await gapi.client.dns.dnsKeys.get({
  dnsKeyId: 'dnsKeyId',
  managedZone: 'managedZone',
  project: 'project',
});

/*
Enumerates DnsKeys to a ResourceRecordSet collection.
*/
await gapi.client.dns.dnsKeys.list({
  managedZone: 'managedZone',
  project: 'project',
});

/*
Fetches the representation of an existing Operation.
*/
await gapi.client.dns.managedZoneOperations.get({
  managedZone: 'managedZone',
  operation: 'operation',
  project: 'project',
});

/*
Enumerates Operations for the given ManagedZone.
*/
await gapi.client.dns.managedZoneOperations.list({
  managedZone: 'managedZone',
  project: 'project',
});

/*
Creates a new ManagedZone.
*/
await gapi.client.dns.managedZones.create({project: 'project'});

/*
Deletes a previously created ManagedZone.
*/
await gapi.client.dns.managedZones.delete({
  managedZone: 'managedZone',
  project: 'project',
});

/*
Fetches the representation of an existing ManagedZone.
*/
await gapi.client.dns.managedZones.get({
  managedZone: 'managedZone',
  project: 'project',
});

/*
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
*/
await gapi.client.dns.managedZones.getIamPolicy({resource: 'resource'});

/*
Enumerates ManagedZones that have been created but not yet deleted.
*/
await gapi.client.dns.managedZones.list({project: 'project'});

/*
Applies a partial update to an existing ManagedZone.
*/
await gapi.client.dns.managedZones.patch({
  managedZone: 'managedZone',
  project: 'project',
});

/*
Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
*/
await gapi.client.dns.managedZones.setIamPolicy({resource: 'resource'});

/*
Returns permissions that a caller has on the specified resource. If the resource does not exist, this returns an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
*/
await gapi.client.dns.managedZones.testIamPermissions({resource: 'resource'});

/*
Updates an existing ManagedZone.
*/
await gapi.client.dns.managedZones.update({
  managedZone: 'managedZone',
  project: 'project',
});

/*
Creates a new Policy.
*/
await gapi.client.dns.policies.create({project: 'project'});

/*
Deletes a previously created Policy. Fails if the policy is still being referenced by a network.
*/
await gapi.client.dns.policies.delete({policy: 'policy', project: 'project'});

/*
Fetches the representation of an existing Policy.
*/
await gapi.client.dns.policies.get({policy: 'policy', project: 'project'});

/*
Enumerates all Policies associated with a project.
*/
await gapi.client.dns.policies.list({project: 'project'});

/*
Applies a partial update to an existing Policy.
*/
await gapi.client.dns.policies.patch({policy: 'policy', project: 'project'});

/*
Updates an existing Policy.
*/
await gapi.client.dns.policies.update({policy: 'policy', project: 'project'});

/*
Fetches the representation of an existing Project.
*/
await gapi.client.dns.projects.get({project: 'project'});

/*
Creates a new ResourceRecordSet.
*/
await gapi.client.dns.resourceRecordSets.create({
  managedZone: 'managedZone',
  project: 'project',
});

/*
Deletes a previously created ResourceRecordSet.
*/
await gapi.client.dns.resourceRecordSets.delete({
  managedZone: 'managedZone',
  name: 'name',
  project: 'project',
  type: 'type',
});

/*
Fetches the representation of an existing ResourceRecordSet.
*/
await gapi.client.dns.resourceRecordSets.get({
  managedZone: 'managedZone',
  name: 'name',
  project: 'project',
  type: 'type',
});

/*
Enumerates ResourceRecordSets that you have created but not yet deleted.
*/
await gapi.client.dns.resourceRecordSets.list({
  managedZone: 'managedZone',
  project: 'project',
});

/*
Applies a partial update to an existing ResourceRecordSet.
*/
await gapi.client.dns.resourceRecordSets.patch({
  managedZone: 'managedZone',
  name: 'name',
  project: 'project',
  type: 'type',
});

/*
Creates a new Response Policy
*/
await gapi.client.dns.responsePolicies.create({project: 'project'});

/*
Deletes a previously created Response Policy. Fails if the response policy is non-empty or still being referenced by a network.
*/
await gapi.client.dns.responsePolicies.delete({
  project: 'project',
  responsePolicy: 'responsePolicy',
});

/*
Fetches the representation of an existing Response Policy.
*/
await gapi.client.dns.responsePolicies.get({
  project: 'project',
  responsePolicy: 'responsePolicy',
});

/*
Enumerates all Response Policies associated with a project.
*/
await gapi.client.dns.responsePolicies.list({project: 'project'});

/*
Applies a partial update to an existing Response Policy.
*/
await gapi.client.dns.responsePolicies.patch({
  project: 'project',
  responsePolicy: 'responsePolicy',
});

/*
Updates an existing Response Policy.
*/
await gapi.client.dns.responsePolicies.update({
  project: 'project',
  responsePolicy: 'responsePolicy',
});

/*
Creates a new Response Policy Rule.
*/
await gapi.client.dns.responsePolicyRules.create({
  project: 'project',
  responsePolicy: 'responsePolicy',
});

/*
Deletes a previously created Response Policy Rule.
*/
await gapi.client.dns.responsePolicyRules.delete({
  project: 'project',
  responsePolicy: 'responsePolicy',
  responsePolicyRule: 'responsePolicyRule',
});

/*
Fetches the representation of an existing Response Policy Rule.
*/
await gapi.client.dns.responsePolicyRules.get({
  project: 'project',
  responsePolicy: 'responsePolicy',
  responsePolicyRule: 'responsePolicyRule',
});

/*
Enumerates all Response Policy Rules associated with a project.
*/
await gapi.client.dns.responsePolicyRules.list({
  project: 'project',
  responsePolicy: 'responsePolicy',
});

/*
Applies a partial update to an existing Response Policy Rule.
*/
await gapi.client.dns.responsePolicyRules.patch({
  project: 'project',
  responsePolicy: 'responsePolicy',
  responsePolicyRule: 'responsePolicyRule',
});

/*
Updates an existing Response Policy Rule.
*/
await gapi.client.dns.responsePolicyRules.update({
  project: 'project',
  responsePolicy: 'responsePolicy',
  responsePolicyRule: 'responsePolicyRule',
});
0.0.20241021

8 months ago

0.0.20241011

9 months ago

0.0.20240919

9 months ago

0.0.20240904

10 months ago

0.0.20240827

10 months ago

0.0.20240726

11 months ago

0.0.20240616

1 year ago

0.0.20240610

1 year ago

0.0.20240626

1 year ago

0.0.20240627

12 months ago

0.0.20240622

1 year ago

0.0.20240517

1 year ago

0.0.20240531

1 year ago

0.0.20240801

11 months ago

0.0.20240521

1 year ago

0.0.20240524

1 year ago

0.0.20240704

12 months ago

0.0.20240719

11 months ago

0.0.20240514

1 year ago

0.0.20240507

1 year ago

0.0.20240501

1 year ago

0.0.20240428

1 year ago

0.0.20240419

1 year ago

0.0.20240413

1 year ago

0.0.20240323

1 year ago

0.0.20240314

1 year ago

0.0.20240307

1 year ago

0.0.20240304

1 year ago

0.0.20240229

1 year ago

0.0.20240222

1 year ago

0.0.20240208

1 year ago

0.0.20240129

1 year ago

0.0.20240118

1 year ago

0.0.20240112

1 year ago

0.0.20240107

1 year ago

0.0.20231231

1 year ago

0.0.20231218

2 years ago

0.0.20231209

2 years ago

0.0.20231130

2 years ago

0.0.20231110

2 years ago

0.0.20230807

2 years ago

0.0.20230721

2 years ago

0.0.20230801

2 years ago

0.0.20230923

2 years ago

0.0.20231020

2 years ago

0.0.20231104

2 years ago

0.0.20231027

2 years ago

0.0.20230917

2 years ago

0.0.20230712

2 years ago

0.0.20230831

2 years ago

0.0.20230708

2 years ago

0.0.20230706

2 years ago

0.0.20230909

2 years ago

0.0.20230630

2 years ago

0.0.20231002

2 years ago

0.0.20230628

2 years ago

0.0.20230620

2 years ago

0.0.20230622

2 years ago

0.0.20230511

2 years ago

0.0.20230518

2 years ago

0.0.20230615

2 years ago

0.0.20230608

2 years ago

0.0.20230509

2 years ago

0.0.20230601

2 years ago

0.0.20230525

2 years ago

0.0.20230526

2 years ago

0.0.20230427

2 years ago

0.0.20230413

2 years ago

0.0.20230317

2 years ago

0.0.20230323

2 years ago

0.0.20230420

2 years ago

0.0.20230302

2 years ago

0.0.20230407

2 years ago

0.0.20230309

2 years ago

0.0.20230330

2 years ago

0.0.20230410

2 years ago

0.0.20230216

2 years ago

0.0.20230223

2 years ago

0.0.20230202

2 years ago

0.0.20230126

2 years ago

0.0.20230209

2 years ago

0.0.20230106

2 years ago

0.0.20221215

3 years ago

0.0.20221104

3 years ago

0.0.20221202

3 years ago

0.0.20230119

2 years ago

0.0.20221110

3 years ago

0.0.20221208

3 years ago

0.0.20230112

2 years ago

0.0.20221031

3 years ago

0.0.20221020

3 years ago

0.0.20221027

3 years ago

0.0.20221013

3 years ago

0.0.20220929

3 years ago

0.0.20220921

3 years ago

0.0.20220817

3 years ago

0.0.20220908

3 years ago

0.0.20220831

3 years ago

0.0.20220915

3 years ago

0.0.20220811

3 years ago

0.0.20220804

3 years ago