From 9f45c28aac865295b0f6baa39b52ccf995454dd9 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 12 Jun 2018 17:45:12 +0000 Subject: [PATCH] Generated from 03bed4e902bf8ce3d2c1b3221160082601ecb34a Move DNS to use the common definition for resource groups --- lib/services/dnsManagement/LICENSE.txt | 42 ++--- lib/services/dnsManagement/README.md | 88 +++++----- .../dnsManagement/lib/operations/index.d.ts | 78 ++++++--- .../lib/operations/recordSets.js | 161 +++++++++++++++--- .../dnsManagement/lib/operations/zones.js | 124 ++++++++++++-- lib/services/dnsManagement/package.json | 9 +- 6 files changed, 369 insertions(+), 133 deletions(-) diff --git a/lib/services/dnsManagement/LICENSE.txt b/lib/services/dnsManagement/LICENSE.txt index a70e8cf660..5431ba98b9 100644 --- a/lib/services/dnsManagement/LICENSE.txt +++ b/lib/services/dnsManagement/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -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 -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -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. +The MIT License (MIT) + +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 +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +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. diff --git a/lib/services/dnsManagement/README.md b/lib/services/dnsManagement/README.md index a0605693ba..82c1f6898c 100644 --- a/lib/services/dnsManagement/README.md +++ b/lib/services/dnsManagement/README.md @@ -1,44 +1,44 @@ ---- -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 - - -## How to Install - -```bash -npm install azure-arm-dns -``` - -## 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 = ""; - 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}); -}); - -## Related projects - -- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) +--- +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 + + +## How to Install + +```bash +npm install azure-arm-dns +``` + +## 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 = ""; + 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 occurred:'); + console.dir(err, {depth: null, colors: true}); +}); + +## Related projects + +- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/dnsManagement/lib/operations/index.d.ts b/lib/services/dnsManagement/lib/operations/index.d.ts index c1e4045aab..1153659198 100644 --- a/lib/services/dnsManagement/lib/operations/index.d.ts +++ b/lib/services/dnsManagement/lib/operations/index.d.ts @@ -24,7 +24,8 @@ export interface RecordSets { /** * Updates a record set within a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -120,7 +121,8 @@ export interface RecordSets { /** * Updates a record set within a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -235,7 +237,8 @@ export interface RecordSets { /** * Creates or updates a record set within a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -337,7 +340,8 @@ export interface RecordSets { /** * Creates or updates a record set within a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -458,7 +462,8 @@ export interface RecordSets { /** * Deletes a record set from a DNS zone. This operation cannot be undone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -491,7 +496,8 @@ export interface RecordSets { /** * Deletes a record set from a DNS zone. This operation cannot be undone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -542,7 +548,8 @@ export interface RecordSets { /** * Gets a record set. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -570,7 +577,8 @@ export interface RecordSets { /** * Gets a record set. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -617,7 +625,8 @@ export interface RecordSets { /** * Lists the record sets of a specified type in a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -650,7 +659,8 @@ export interface RecordSets { /** * Lists the record sets of a specified type in a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -702,7 +712,8 @@ export interface RecordSets { /** * Lists all record sets in a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -731,7 +742,8 @@ export interface RecordSets { /** * Lists all record sets in a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -779,7 +791,8 @@ export interface RecordSets { /** * Lists all record sets in a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -808,7 +821,8 @@ export interface RecordSets { /** * Lists all record sets in a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1036,7 +1050,8 @@ export interface Zones { /** * Creates or updates a DNS zone. Does not modify DNS records within the zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1085,7 +1100,8 @@ export interface Zones { /** * Creates or updates a DNS zone. Does not modify DNS records within the zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1154,7 +1170,8 @@ export interface Zones { * Deletes a DNS zone. WARNING: All DNS records in the zone will also be * deleted. This operation cannot be undone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1180,7 +1197,8 @@ export interface Zones { * Deletes a DNS zone. WARNING: All DNS records in the zone will also be * deleted. This operation cannot be undone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1224,7 +1242,8 @@ export interface Zones { * Gets a DNS zone. Retrieves the zone properties, but not the record sets * within the zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1246,7 +1265,8 @@ export interface Zones { * Gets a DNS zone. Retrieves the zone properties, but not the record sets * within the zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1286,7 +1306,8 @@ export interface Zones { /** * Updates a DNS zone. Does not modify DNS records within the zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1315,7 +1336,8 @@ export interface Zones { /** * Updates a DNS zone. Does not modify DNS records within the zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1363,7 +1385,8 @@ export interface Zones { /** * Lists the DNS zones within a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {object} [options] Optional Parameters. * @@ -1384,7 +1407,8 @@ export interface Zones { /** * Lists the DNS zones within a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {object} [options] Optional Parameters. * @@ -1482,7 +1506,8 @@ export interface Zones { * Deletes a DNS zone. WARNING: All DNS records in the zone will also be * deleted. This operation cannot be undone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1508,7 +1533,8 @@ export interface Zones { * Deletes a DNS zone. WARNING: All DNS records in the zone will also be * deleted. This operation cannot be undone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). diff --git a/lib/services/dnsManagement/lib/operations/recordSets.js b/lib/services/dnsManagement/lib/operations/recordSets.js index a78fba6519..584fc0dfa2 100644 --- a/lib/services/dnsManagement/lib/operations/recordSets.js +++ b/lib/services/dnsManagement/lib/operations/recordSets.js @@ -17,7 +17,8 @@ const WebResource = msRest.WebResource; /** * Updates a record set within a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -131,6 +132,20 @@ function _update(resourceGroupName, zoneName, relativeRecordSetName, recordType, if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } if (zoneName === null || zoneName === undefined || typeof zoneName.valueOf() !== 'string') { throw new Error('zoneName cannot be null or undefined and it must be of type string.'); } @@ -275,7 +290,8 @@ function _update(resourceGroupName, zoneName, relativeRecordSetName, recordType, /** * Creates or updates a record set within a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -396,6 +412,20 @@ function _createOrUpdate(resourceGroupName, zoneName, relativeRecordSetName, rec if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } if (zoneName === null || zoneName === undefined || typeof zoneName.valueOf() !== 'string') { throw new Error('zoneName cannot be null or undefined and it must be of type string.'); } @@ -563,7 +593,8 @@ function _createOrUpdate(resourceGroupName, zoneName, relativeRecordSetName, rec /** * Deletes a record set from a DNS zone. This operation cannot be undone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -613,6 +644,20 @@ function _deleteMethod(resourceGroupName, zoneName, relativeRecordSetName, recor if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } if (zoneName === null || zoneName === undefined || typeof zoneName.valueOf() !== 'string') { throw new Error('zoneName cannot be null or undefined and it must be of type string.'); } @@ -723,7 +768,8 @@ function _deleteMethod(resourceGroupName, zoneName, relativeRecordSetName, recor /** * Gets a record set. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -768,6 +814,20 @@ function _get(resourceGroupName, zoneName, relativeRecordSetName, recordType, op if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } if (zoneName === null || zoneName === undefined || typeof zoneName.valueOf() !== 'string') { throw new Error('zoneName cannot be null or undefined and it must be of type string.'); } @@ -889,7 +949,8 @@ function _get(resourceGroupName, zoneName, relativeRecordSetName, recordType, op /** * Lists the record sets of a specified type in a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -941,6 +1002,20 @@ function _listByType(resourceGroupName, zoneName, recordType, options, callback) if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } if (zoneName === null || zoneName === undefined || typeof zoneName.valueOf() !== 'string') { throw new Error('zoneName cannot be null or undefined and it must be of type string.'); } @@ -1070,7 +1145,8 @@ function _listByType(resourceGroupName, zoneName, recordType, options, callback) /** * Lists all record sets in a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1118,6 +1194,20 @@ function _listByDnsZone(resourceGroupName, zoneName, options, callback) { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } if (zoneName === null || zoneName === undefined || typeof zoneName.valueOf() !== 'string') { throw new Error('zoneName cannot be null or undefined and it must be of type string.'); } @@ -1238,7 +1328,8 @@ function _listByDnsZone(resourceGroupName, zoneName, options, callback) { /** * Lists all record sets in a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1286,6 +1377,20 @@ function _listAllByDnsZone(resourceGroupName, zoneName, options, callback) { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } if (zoneName === null || zoneName === undefined || typeof zoneName.valueOf() !== 'string') { throw new Error('zoneName cannot be null or undefined and it must be of type string.'); } @@ -1807,7 +1912,8 @@ class RecordSets { /** * Updates a record set within a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1915,7 +2021,8 @@ class RecordSets { /** * Updates a record set within a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -2045,7 +2152,8 @@ class RecordSets { /** * Creates or updates a record set within a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -2159,7 +2267,8 @@ class RecordSets { /** * Creates or updates a record set within a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -2295,7 +2404,8 @@ class RecordSets { /** * Deletes a record set from a DNS zone. This operation cannot be undone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -2340,7 +2450,8 @@ class RecordSets { /** * Deletes a record set from a DNS zone. This operation cannot be undone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -2406,7 +2517,8 @@ class RecordSets { /** * Gets a record set. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -2446,7 +2558,8 @@ class RecordSets { /** * Gets a record set. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -2508,7 +2621,8 @@ class RecordSets { /** * Lists the record sets of a specified type in a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -2553,7 +2667,8 @@ class RecordSets { /** * Lists the record sets of a specified type in a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -2620,7 +2735,8 @@ class RecordSets { /** * Lists all record sets in a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -2661,7 +2777,8 @@ class RecordSets { /** * Lists all record sets in a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -2724,7 +2841,8 @@ class RecordSets { /** * Lists all record sets in a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -2765,7 +2883,8 @@ class RecordSets { /** * Lists all record sets in a DNS zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). diff --git a/lib/services/dnsManagement/lib/operations/zones.js b/lib/services/dnsManagement/lib/operations/zones.js index 65855a68fc..46985a4071 100644 --- a/lib/services/dnsManagement/lib/operations/zones.js +++ b/lib/services/dnsManagement/lib/operations/zones.js @@ -17,7 +17,8 @@ const WebResource = msRest.WebResource; /** * Creates or updates a DNS zone. Does not modify DNS records within the zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -85,6 +86,20 @@ function _createOrUpdate(resourceGroupName, zoneName, parameters, options, callb if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } if (zoneName === null || zoneName === undefined || typeof zoneName.valueOf() !== 'string') { throw new Error('zoneName cannot be null or undefined and it must be of type string.'); } @@ -241,7 +256,8 @@ function _createOrUpdate(resourceGroupName, zoneName, parameters, options, callb * Deletes a DNS zone. WARNING: All DNS records in the zone will also be * deleted. This operation cannot be undone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -309,7 +325,8 @@ function _deleteMethod(resourceGroupName, zoneName, options, callback) { * Gets a DNS zone. Retrieves the zone properties, but not the record sets * within the zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -347,6 +364,20 @@ function _get(resourceGroupName, zoneName, options, callback) { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } if (zoneName === null || zoneName === undefined || typeof zoneName.valueOf() !== 'string') { throw new Error('zoneName cannot be null or undefined and it must be of type string.'); } @@ -455,7 +486,8 @@ function _get(resourceGroupName, zoneName, options, callback) { /** * Updates a DNS zone. Does not modify DNS records within the zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -502,6 +534,20 @@ function _update(resourceGroupName, zoneName, parameters, options, callback) { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } if (zoneName === null || zoneName === undefined || typeof zoneName.valueOf() !== 'string') { throw new Error('zoneName cannot be null or undefined and it must be of type string.'); } @@ -633,7 +679,8 @@ function _update(resourceGroupName, zoneName, parameters, options, callback) { /** * Lists the DNS zones within a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {object} [options] Optional Parameters. * @@ -672,6 +719,20 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } if (top !== null && top !== undefined && typeof top !== 'number') { throw new Error('top must be of type number.'); } @@ -926,7 +987,8 @@ function _list(options, callback) { * Deletes a DNS zone. WARNING: All DNS records in the zone will also be * deleted. This operation cannot be undone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -968,6 +1030,20 @@ function _beginDeleteMethod(resourceGroupName, zoneName, options, callback) { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } if (zoneName === null || zoneName === undefined || typeof zoneName.valueOf() !== 'string') { throw new Error('zoneName cannot be null or undefined and it must be of type string.'); } @@ -1338,7 +1414,8 @@ class Zones { /** * Creates or updates a DNS zone. Does not modify DNS records within the zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1399,7 +1476,8 @@ class Zones { /** * Creates or updates a DNS zone. Does not modify DNS records within the zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1483,7 +1561,8 @@ class Zones { * Deletes a DNS zone. WARNING: All DNS records in the zone will also be * deleted. This operation cannot be undone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1521,7 +1600,8 @@ class Zones { * Deletes a DNS zone. WARNING: All DNS records in the zone will also be * deleted. This operation cannot be undone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1580,7 +1660,8 @@ class Zones { * Gets a DNS zone. Retrieves the zone properties, but not the record sets * within the zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1614,7 +1695,8 @@ class Zones { * Gets a DNS zone. Retrieves the zone properties, but not the record sets * within the zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1669,7 +1751,8 @@ class Zones { /** * Updates a DNS zone. Does not modify DNS records within the zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1710,7 +1793,8 @@ class Zones { /** * Updates a DNS zone. Does not modify DNS records within the zone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1773,7 +1857,8 @@ class Zones { /** * Lists the DNS zones within a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {object} [options] Optional Parameters. * @@ -1806,7 +1891,8 @@ class Zones { /** * Lists the DNS zones within a resource group. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {object} [options] Optional Parameters. * @@ -1946,7 +2032,8 @@ class Zones { * Deletes a DNS zone. WARNING: All DNS records in the zone will also be * deleted. This operation cannot be undone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). @@ -1984,7 +2071,8 @@ class Zones { * Deletes a DNS zone. WARNING: All DNS records in the zone will also be * deleted. This operation cannot be undone. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the resource group. The name + * is case insensitive. * * @param {string} zoneName The name of the DNS zone (without a terminating * dot). diff --git a/lib/services/dnsManagement/package.json b/lib/services/dnsManagement/package.json index 707884e292..7616501f42 100644 --- a/lib/services/dnsManagement/package.json +++ b/lib/services/dnsManagement/package.json @@ -2,12 +2,15 @@ "name": "azure-arm-dns", "author": "Microsoft Corporation", "description": "DnsManagementClient Library with typescript type definitions for node", - "version": "2.1.0", + "version": "2.0.0-preview", "dependencies": { - "ms-rest": "^2.3.2", + "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5" }, - "keywords": [ "node", "azure" ], + "keywords": [ + "node", + "azure" + ], "license": "MIT", "main": "./lib/dnsManagementClient.js", "types": "./lib/dnsManagementClient.d.ts",