Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2676 from Azure/daschult/dnsManagement
Browse files Browse the repository at this point in the history
Regenerate dnsManagement and change version to 2.1.0
  • Loading branch information
Dan Schulte authored Apr 4, 2018
2 parents 1f8d69f + 41904d6 commit 5d76ffe
Show file tree
Hide file tree
Showing 13 changed files with 1,285 additions and 60 deletions.
4 changes: 2 additions & 2 deletions lib/services/dnsManagement/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2017 Microsoft
Copyright (c) 2018 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
58 changes: 32 additions & 26 deletions lib/services/dnsManagement/README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,44 @@
# Microsoft Azure SDK for Node.js - DNSManagement
---
uid: azure-arm-dns
summary: *content

---
# Microsoft Azure SDK for Node.js - DnsManagementClient
This project provides a Node.js package for accessing Azure. Right now it supports:
- **Node.js version 6.x.x or higher**

## Features

This project provides a Node.js package that makes it easy to manage Microsoft Azure DNS.
## API-Version: 2017-09-01
## Minimum node.js version >= 6.x.x

## How to Install

```bash
npm install azure-arm-dns
```

## How to Use

### Authentication, client creation and listing zones as an example

```javascript
const msRestAzure = require('ms-rest-azure');
const DNSManagement = require("azure-arm-dns");

// Interactive Login
// It provides a url and code that needs to be copied and pasted in a browser and authenticated over there. If successful,
// the user will get a DeviceTokenCredentials object.
msRestAzure.interactiveLogin().then((credentials) => {
let client = new DNSManagement(credentials, 'your-subscription-id');
return client.zones.list();
}).then((zones) => {
console.log('List of zones:');
console.dir(zones, {depth: null, colors: true});
## How to use

### Authentication, client creation and get recordSets as an example.

```javascript
const msRestAzure = require("ms-rest-azure");
const DnsManagementClient = require("azure-arm-dns");
msRestAzure.interactiveLogin().then((creds) => {
const subscriptionId = "<Subscription_Id>";
const client = new DnsManagementClient(creds, subscriptionId);
const resourceGroupName = "testresourceGroupName";
const zoneName = "testzoneName";
const relativeRecordSetName = "testrelativeRecordSetName";
const recordType = "A";
return client.recordSets.get(resourceGroupName, zoneName, relativeRecordSetName, recordType).then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.log('An error ocurred');
console.dir(err, {depth: null, colors: true});
});
```
console.log('An error ocurred:');
console.dir(err, {depth: null, colors: true});
});

## Related projects

- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node)
- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node)
5 changes: 3 additions & 2 deletions lib/services/dnsManagement/lib/dnsManagementClient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@

import { ServiceClientCredentials } from 'ms-rest';
import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure';
import * as models from "./models";
import * as operations from "./operations";

declare class DnsManagementClient extends AzureServiceClient {
export default class DnsManagementClient extends AzureServiceClient {
/**
* Initializes a new instance of the DnsManagementClient class.
* @constructor
Expand Down Expand Up @@ -59,4 +60,4 @@ declare class DnsManagementClient extends AzureServiceClient {
zones: operations.Zones;
}

export = DnsManagementClient;
export { DnsManagementClient, models as DnsManagementModels };
5 changes: 4 additions & 1 deletion lib/services/dnsManagement/lib/dnsManagementClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class DnsManagementClient extends ServiceClient {

super(credentials, options);

this.apiVersion = '2017-09-01';
this.apiVersion = '2018-03-01-preview';
this.acceptLanguage = 'en-US';
this.longRunningOperationRetryTimeout = 30;
this.generateClientRequestId = true;
Expand Down Expand Up @@ -81,3 +81,6 @@ class DnsManagementClient extends ServiceClient {
}

module.exports = DnsManagementClient;
module.exports['default'] = DnsManagementClient;
module.exports.DnsManagementClient = DnsManagementClient;
module.exports.DnsManagementModels = models;
35 changes: 35 additions & 0 deletions lib/services/dnsManagement/lib/models/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,18 @@ export interface RecordSetUpdateParameters {
recordSet?: RecordSet;
}

/**
* @class
* Initializes a new instance of the SubResource class.
* @constructor
* A reference to a another resource
*
* @member {string} [id] Resource Id.
*/
export interface SubResource {
id?: string;
}

/**
* @class
* Initializes a new instance of the Resource class.
Expand Down Expand Up @@ -318,12 +330,35 @@ export interface Resource extends BaseResource {
* value will be ignored.
* @member {array} [nameServers] The name servers for this DNS zone. This is a
* read-only property and any attempt to set this value will be ignored.
* @member {string} [zoneType] The type of this DNS zone (Public or Private).
* Possible values include: 'Public', 'Private'. Default value: 'Public' .
* @member {array} [registrationVirtualNetworks] A list of references to
* virtual networks that register hostnames in this DNS zone. This is a only
* when ZoneType is Private.
* @member {array} [resolutionVirtualNetworks] A list of references to virtual
* networks that resolve records in this DNS zone. This is a only when ZoneType
* is Private.
*/
export interface Zone extends Resource {
etag?: string;
readonly maxNumberOfRecordSets?: number;
readonly numberOfRecordSets?: number;
readonly nameServers?: string[];
zoneType?: string;
registrationVirtualNetworks?: SubResource[];
resolutionVirtualNetworks?: SubResource[];
}

/**
* @class
* Initializes a new instance of the ZoneUpdate class.
* @constructor
* Describes a request to update a DNS zone.
*
* @member {object} [tags] Resource tags.
*/
export interface ZoneUpdate {
tags?: { [propertyName: string]: string };
}


Expand Down
2 changes: 2 additions & 0 deletions lib/services/dnsManagement/lib/models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ exports.SoaRecord = require('./soaRecord');
exports.CaaRecord = require('./caaRecord');
exports.RecordSet = require('./recordSet');
exports.RecordSetUpdateParameters = require('./recordSetUpdateParameters');
exports.SubResource = require('./subResource');
exports.Resource = require('./resource');
exports.Zone = require('./zone');
exports.ZoneUpdate = require('./zoneUpdate');
exports.RecordSetListResult = require('./recordSetListResult');
exports.ZoneListResult = require('./zoneListResult');
52 changes: 52 additions & 0 deletions lib/services/dnsManagement/lib/models/subResource.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

'use strict';

/**
* A reference to a another resource
*
*/
class SubResource {
/**
* Create a SubResource.
* @member {string} [id] Resource Id.
*/
constructor() {
}

/**
* Defines the metadata of SubResource
*
* @returns {object} metadata of SubResource
*
*/
mapper() {
return {
required: false,
serializedName: 'SubResource',
type: {
name: 'Composite',
className: 'SubResource',
modelProperties: {
id: {
required: false,
serializedName: 'id',
type: {
name: 'String'
}
}
}
}
};
}
}

module.exports = SubResource;
47 changes: 47 additions & 0 deletions lib/services/dnsManagement/lib/models/zone.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ class Zone extends models['Resource'] {
* value will be ignored.
* @member {array} [nameServers] The name servers for this DNS zone. This is
* a read-only property and any attempt to set this value will be ignored.
* @member {string} [zoneType] The type of this DNS zone (Public or Private).
* Possible values include: 'Public', 'Private'. Default value: 'Public' .
* @member {array} [registrationVirtualNetworks] A list of references to
* virtual networks that register hostnames in this DNS zone. This is a only
* when ZoneType is Private.
* @member {array} [resolutionVirtualNetworks] A list of references to
* virtual networks that resolve records in this DNS zone. This is a only
* when ZoneType is Private.
*/
constructor() {
super();
Expand Down Expand Up @@ -130,6 +138,45 @@ class Zone extends models['Resource'] {
}
}
}
},
zoneType: {
required: false,
serializedName: 'properties.zoneType',
defaultValue: 'Public',
type: {
name: 'Enum',
allowedValues: [ 'Public', 'Private' ]
}
},
registrationVirtualNetworks: {
required: false,
serializedName: 'properties.registrationVirtualNetworks',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'SubResourceElementType',
type: {
name: 'Composite',
className: 'SubResource'
}
}
}
},
resolutionVirtualNetworks: {
required: false,
serializedName: 'properties.resolutionVirtualNetworks',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'SubResourceElementType',
type: {
name: 'Composite',
className: 'SubResource'
}
}
}
}
}
}
Expand Down
59 changes: 59 additions & 0 deletions lib/services/dnsManagement/lib/models/zoneUpdate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

'use strict';

/**
* Describes a request to update a DNS zone.
*
*/
class ZoneUpdate {
/**
* Create a ZoneUpdate.
* @member {object} [tags] Resource tags.
*/
constructor() {
}

/**
* Defines the metadata of ZoneUpdate
*
* @returns {object} metadata of ZoneUpdate
*
*/
mapper() {
return {
required: false,
serializedName: 'ZoneUpdate',
type: {
name: 'Composite',
className: 'ZoneUpdate',
modelProperties: {
tags: {
required: false,
serializedName: 'tags',
type: {
name: 'Dictionary',
value: {
required: false,
serializedName: 'StringElementType',
type: {
name: 'String'
}
}
}
}
}
}
};
}
}

module.exports = ZoneUpdate;
Loading

0 comments on commit 5d76ffe

Please sign in to comment.