From 1fdc640ce9a7acc924a182be3ea36fba2bb208b7 Mon Sep 17 00:00:00 2001 From: JhontSouth Date: Thu, 10 Aug 2023 12:17:00 -0500 Subject: [PATCH 1/7] remove ms-rest-azure package --- package.json | 2 - tools/framework/authentication.js | 88 ------- tools/framework/subscriptionUtils.js | 123 --------- tools/framework/suite-base.js | 73 +++--- tools/package.json | 4 +- .../lib/resource/models/baseResource.js | 54 ++++ .../lib/resource/models/cloudError.js | 243 ++++++++++++++++++ .../lib/resource/models/index.js | 6 +- .../operations/deploymentOperations.js | 8 +- .../lib/resource/operations/deployments.js | 20 +- .../lib/resource/operations/providers.js | 12 +- .../lib/resource/operations/resourceGroups.js | 18 +- .../lib/resource/operations/resources.js | 32 +-- .../lib/resource/operations/tags.js | 14 +- .../lib/resource/resourceManagementClient.js | 62 ++++- yarn.lock | 173 +++++++------ 16 files changed, 539 insertions(+), 393 deletions(-) delete mode 100644 tools/framework/authentication.js delete mode 100644 tools/framework/subscriptionUtils.js create mode 100644 tools/resourceManagement/lib/resource/models/baseResource.js create mode 100644 tools/resourceManagement/lib/resource/models/cloudError.js diff --git a/package.json b/package.json index 1d3cb2da16..1256b4032b 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,6 @@ "async": "3.2.3", "minimist": "^1.2.6", "mixme": "0.5.2", - "ms-rest-azure": "2.6.2", "node-fetch": "2.6.7", "underscore": "1.13.1", "json-schema": "0.4.0", @@ -83,7 +82,6 @@ "exorcist": "^1.0.1", "mocha": "^6.2.3", "mocha-junit-reporter": "^2.0.0", - "ms-rest-azure": "^2.6.2", "npm-run-all": "^4.1.5", "nyc": "^15.1.0", "prettier": "^2.1.2", diff --git a/tools/framework/authentication.js b/tools/framework/authentication.js deleted file mode 100644 index 08f0cd79a4..0000000000 --- a/tools/framework/authentication.js +++ /dev/null @@ -1,88 +0,0 @@ -// -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the 'License'); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an 'AS IS' BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// - -'use strict'; - -var adal = require('adal-node'); -var fs = require('fs'); -var https = require('https'); -var util = require('util'); -var msRestAzure = require('ms-rest-azure'); -var AuthenticationContext = adal.AuthenticationContext; - -function turnOnLogging() { - var log = adal.Logging; - log.setLoggingOptions( - { - level : log.LOGGING_LEVEL.VERBOSE, - log : function (level, message, error) { - console.log(message); - if (error) { - console.log(error); - } - } - }); -} - -turnOnLogging(); - -var authenticationParameters = { - tenant: 'common', - authorityHostUrl: 'https://login.windows.net', - clientId: '04b07795-8ddb-461a-bbee-02f9e1bf7b46' -}; - -/** - * Authenticate with username and password - * @param {string} username - Username - * @param {string} password - Password - * @param {function} callback - The callback to handle the error and result. - */ -exports.authenticateWithUsernamePassword = function (username, password, callback) { - var authorityUrl = authenticationParameters.authorityHostUrl + '/' + authenticationParameters.tenant; - var resource = 'https://management.core.windows.net/'; - var context = new AuthenticationContext(authorityUrl); - context.acquireTokenWithUsernamePassword(resource, authenticationParameters.username, authenticationParameters.password, authenticationParameters.clientId, function (err, tokenResponse) { - if (err) { - callback('Authentication failed. The error is: ' + util.inspect(err)); - } else { - callback(null, tokenResponse); - } - }); -}; - -/** - * Authenticate with Service Principal - * @param {string} clientId - Id of the service principal - * @param {string} clientSecret - Password/Secret of the service principal - * @param {string} tenant - The tenant id of the service principal. - * @param {function} callback - The callback to handle the error and result. - */ -exports.authenticateWithServicePrincipal = function (clientId, clientSecret, tenant, callback) { - var authorityUrl = authenticationParameters.authorityHostUrl + '/' + tenant; - var resource = 'https://management.core.windows.net/'; - var context = new AuthenticationContext(authorityUrl); - context.acquireTokenWithClientCredentials(resource, authenticationParameters.clientId, authenticationParameters.clientSecret, function (err, tokenResponse) { - if (err) { - callback('Authentication failed. The error is: ' + util.inspect(err)); - } else { - //new msRestAzure.SubscriptionCredentials(tokenResponse, - callback(null, tokenResponse); - } - }); -}; - -exports = module.exports; \ No newline at end of file diff --git a/tools/framework/subscriptionUtils.js b/tools/framework/subscriptionUtils.js deleted file mode 100644 index 3985802ca5..0000000000 --- a/tools/framework/subscriptionUtils.js +++ /dev/null @@ -1,123 +0,0 @@ -/** -* Copyright (c) Microsoft. All rights reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var __ = require('underscore'); -var async = require('async'); -var util = require('util'); -var msRestAzure = require('ms-rest-azure'); -var SubscriptionClient = require('../../lib/services/resourceManagement/lib/subscriptionClient/SubscriptionClient'); - - -exports.getSubscriptions = function (environment, username, password, tenant, callback) { - environment.acquireToken(username, password, tenant, function (err, authContext) { - if (err) return callback(err); - username = _crossCheckUserNameWithToken(username, authContext.userId); - - async.waterfall([ - function (callback) { - _buildTenantList(environment, username, password, tenant, authContext, callback); - }, - function (tenantList, callback) { - getSubscriptionsFromTenants(environment, username, tenantList, callback); - }, - ], function (err, subscriptions) { - callback(err, subscriptions); - }); - }); -}; - -exports.getSubscriptionsFromTenants = function (username, authContext, callback) { - _buildTenantList(username, password, tenant, authContext, function (err, tenants) { - if (err) { - callback(err); - } - var subscriptions = []; - async.eachSeries(tenants, function (tenant, cb) { - var tenantId = tenant.tenantId; - var subscriptionClient = new SubscriptionClient(_createCredential(tenant.authContext)); - subscriptionClient.subscriptions.list(function (err, result) { - if (!err) { - subscriptions = subscriptions.concat(result.value.map(function (s) { - return new msRestAzure.SubscriptionCredential(tenant.authContext, s.subscriptionId); - })); - } - cb(err); - }); - }, function (err) { - callback(err, subscriptions); - }); - }); -}; - -function _buildTenantList(environment, username, password, tenant, authContext, callback) { - var tenants = []; - if (tenant) { - tenants = [{ - tenantId: tenant,//'tenant' could be a logical name, interchangable with a tenant guid though - authContext: authContext - }]; - return callback(null, tenants); - } - var armClient = environment.getArmClient(_createCredential(authContext)); - armClient.tenants.list(function (err, result) { - if (err) return callback(err); - async.eachSeries(result.tenantIds/*'tenantInfos' could be a better name*/, function (tenantInfo, cb) { - environment.acquireToken(username, password, tenantInfo.tenantId, function (err, authContext) { - //TODO: verify - if (err && err.match(new RegExp('.*\"error_codes\":\\[50034|50000\\].*'))) { - console.log(util.format('Due to current limitation, we will skip retrieving subscriptions from the external tenant \'%s\'', tenantInfo.tenantId)); - err = null; - } - if (!err) { - tenants.push({ - tenantId: tenantInfo.tenantId, - authContext: authContext - }); - } - cb(err); - }); - }, function (err) { - callback(err, tenants); - }); - }); -} - -function _ignoreCaseAndSpaceEquals(a, b) { - return a === b || (_toLowerCaseAndRemoveSpace(a) === _toLowerCaseAndRemoveSpace(b)); -} - -function _toLowerCaseAndRemoveSpace(str) { - if (!str) { - return str; - } - - return str.replace(/ /gi, '').toLowerCase(); -} - -function _crossCheckUserNameWithToken(usernameFromCommandline, userIdFromToken) { - if (_ignoreCaseAndSpaceEquals(usernameFromCommandline, userIdFromToken)) { - return userIdFromToken; - } else { - throw new Error(util.format('invalid user name %s', usernameFromCommandline)); - } -} - -function _createCredential(authContext) { - return new msRestAzure.SubscriptionCredentials(authContext, 'notUsed'); -} - -exports = module.exports; \ No newline at end of file diff --git a/tools/framework/suite-base.js b/tools/framework/suite-base.js index f2151cdb19..aa6c10783a 100644 --- a/tools/framework/suite-base.js +++ b/tools/framework/suite-base.js @@ -7,7 +7,7 @@ // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, +// distributed under the License is distributed on an "AS IS" BASIS,ms-rest-azure // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // // See the License for the specific language governing permissions and @@ -23,7 +23,8 @@ var _ = require('underscore'); var util = require('util'); var uuid = require('uuid'); var msRest = require('ms-rest'); -var msRestAzure = require('ms-rest-azure'); +var msRestAuth = require("@azure/ms-rest-nodeauth"); +var {Environment} = require("@azure/ms-rest-azure-env") var MicrosoftAppCredentials = require('botframework-connector/lib/auth/microsoftAppCredentials'); var TokenApiClient = require('botframework-connector/lib/tokenApi/tokenApiClient'); var FileTokenCache = require('../util/fileTokenCache'); @@ -33,7 +34,7 @@ var ResourceManagementClient = require('../resourceManagement/lib/resource/resou var async = require('async'); var adal = require('adal-node'); -var DEFAULT_ADAL_CLIENT_ID = '04b07795-8ddb-461a-bbee-02f9e1bf7b46'; +var DEFAULT_ADAL_CLIENT_ID = '04b07795-8ddb-461a-bbee-02f9e1bf7b46'; /** * @class @@ -54,7 +55,7 @@ var DEFAULT_ADAL_CLIENT_ID = '04b07795-8ddb-461a-bbee-02f9e1bf7b46'; */ function SuiteBase(mochaSuiteObject, testPrefix, env, libraryPath) { this.mochaSuiteObject = mochaSuiteObject; - this.testPrefix = this.normalizeTestName(testPrefix); + this.testPrefix = this.normalizeTestName(testPrefix); this.mockServerClient; this.currentTest = ''; //Recording info @@ -73,7 +74,7 @@ function SuiteBase(mochaSuiteObject, testPrefix, env, libraryPath) { this.password = process.env['AZURE_PASSWORD'] || 'dummypassword'; this.secret = process.env['CLIENT_SECRET'] || 'dummysecret'; this.tokenCache = new adal.MemoryCache(); - + this._setCredentials(); //subscriptionId should be recorded for playback if (!env) { @@ -101,11 +102,11 @@ _.extend(SuiteBase.prototype, { let token = process.env['AZURE_ACCESS_TOKEN'] || 'token'; this.credentials = new msRest.TokenCredentials('token'); } else if ((process.env['AZURE_PASSWORD'] && process.env['CLIENT_SECRET']) || - (!process.env['AZURE_PASSWORD'] && !process.env['CLIENT_SECRET'])) { + (!process.env['AZURE_PASSWORD'] && !process.env['CLIENT_SECRET'])) { throw new Error('You must either set the envt. variables \'AZURE_USERNAME\' ' + - 'and \'AZURE_PASSWORD\' for running tests as a user or set the ' + - 'envt. variable \'CLIENT_ID\' and \'CLIENT_SECRET\' ' + - 'for running tests as a service-principal, but not both.'); + 'and \'AZURE_PASSWORD\' for running tests as a user or set the ' + + 'envt. variable \'CLIENT_ID\' and \'CLIENT_SECRET\' ' + + 'for running tests as a service-principal, but not both.'); } if (process.env['AZURE_PASSWORD']) { @@ -123,7 +124,7 @@ _.extend(SuiteBase.prototype, { /** * Creates the UserTokenCredentials object. * - * @returns {ms-rest-azure.UserTokenCredentials} The user token credentials object. + * @returns {@azure/ms-rest-nodeauth.UserTokenCredentials} The user token credentials object. */ _createUserCredentials: function() { if(process.env['AZURE_ENVIRONMENT'] && process.env['AZURE_ENVIRONMENT'].toUpperCase() === 'DOGFOOD') { @@ -135,19 +136,19 @@ _.extend(SuiteBase.prototype, { managementEndpointUrl: 'https://management-preview.core.windows-int.net/', resourceManagerEndpointUrl: 'https://api-dogfood.resources.windows-int.net/' }; - var env = msRestAzure.AzureEnvironment.add(df); - return new msRestAzure.UserTokenCredentials(this.clientId, this.domain, this.username, + var env = Environment.add(df); + return new msRestAuth.UserTokenCredentials(this.clientId, this.domain, this.username, this.password, { 'tokenCache': this.tokenCache, 'environment': env }); } - - return new msRestAzure.UserTokenCredentials(this.clientId, this.domain, this.username, + + return new msRestAuth.UserTokenCredentials(this.clientId, this.domain, this.username, this.password, { 'tokenCache': this.tokenCache }); }, /** * Creates the ApplicationTokenCredentials object. * - * @returns {ms-rest-azure.ApplicationTokenCredentials} The application token credentials object. + * @returns {@azure/ms-rest-nodeauth.ApplicationTokenCredentials} The application token credentials object. */ _createApplicationCredentials: function() { if(process.env['AZURE_ENVIRONMENT'] && process.env['AZURE_ENVIRONMENT'].toUpperCase() === 'DOGFOOD') { @@ -159,14 +160,14 @@ _.extend(SuiteBase.prototype, { managementEndpointUrl: 'https://management-preview.core.windows-int.net/', resourceManagerEndpointUrl: 'https://api-dogfood.resources.windows-int.net/' }; - var env = msRestAzure.AzureEnvironment.add(df); - return new msRestAzure.ApplicationTokenCredentials(this.clientId, this.domain, this.secret, { + var env = Environment.add(df); + return new msRestAuth.ApplicationTokenCredentials(this.clientId, this.domain, this.secret, { 'tokenCache': this.tokenCache, 'environment': env }); } - - return new msRestAzure.ApplicationTokenCredentials(this.clientId, this.domain, this.secret, { + + return new msRestAuth.ApplicationTokenCredentials(this.clientId, this.domain, this.secret, { 'tokenCache': this.tokenCache }); }, @@ -242,7 +243,7 @@ _.extend(SuiteBase.prototype, { */ getTestRecordingsFile: function() { this.testRecordingsFile = this.getRecordingsDirectory() + - this.normalizeTestName(this.currentTest) + '.nock.js'; + this.normalizeTestName(this.currentTest) + '.nock.js'; return this.testRecordingsFile; }, @@ -278,7 +279,7 @@ _.extend(SuiteBase.prototype, { if (missing.length > 0) { messages.push('This test requires the following environment variables which are not set: ' + - missing.join(', ')); + missing.join(', ')); } if (messages.length > 0) { @@ -364,11 +365,11 @@ _.extend(SuiteBase.prototype, { secondCallback(null); } ], - function(err, results) { - if (err) { - throw err; - } - }); + function(err, results) { + if (err) { + throw err; + } + }); }, /** @@ -438,7 +439,7 @@ _.extend(SuiteBase.prototype, { }); } else { throw new Error('It appears the ' + this.getTestRecordingsFile() + ' file has more tests than there are mocked tests. ' + - 'You may need to re-generate it.'); + 'You may need to re-generate it.'); } } @@ -484,13 +485,13 @@ _.extend(SuiteBase.prototype, { line = line.replace(/(\.get\('.*\/microsoft.insights\/eventtypes\/management\/values\?api-version=[0-9-]+)[^)]+\)/, '.filteringPath(function (path) { return path.slice(0, path.indexOf(\'&\')); })\n$1\')'); if (line.match(/\/oauth2\/token\//ig) === null && - line.match(/login\.windows\.net/ig) === null && + line.match(/login\.windows\.net/ig) === null && line.match(/login\.windows-ppe\.net/ig) === null && line.match(/login\.microsoftonline\.com/ig) === null && line.match(/login\.chinacloudapi\.cn/ig) === null && line.match(/login\.microsoftonline\.de/ig) === null) { scope += (lineWritten ? ',\n' : '') + 'function (nock) { \n' + - 'var result = ' + line + ' return result; }'; + 'var result = ' + line + ' return result; }'; lineWritten = true; } } @@ -656,7 +657,7 @@ _.extend(SuiteBase.prototype, { * in 'Record' mode or keeps it in memory when the test is run in 'Live' mode. */ saveMockVariable: function(mockVariableName, mockVariable) { - //record or live + //record or live if (!this.isPlayback) { this.mockVariables[mockVariableName] = mockVariable; } @@ -709,17 +710,17 @@ _.extend(SuiteBase.prototype, { */ _stubMethods: function() { if (this.isPlayback) { - if (msRestAzure.UserTokenCredentials.prototype.signRequest.restore) { - msRestAzure.UserTokenCredentials.prototype.signRequest.restore(); + if (msRestAuth.UserTokenCredentials.prototype.signRequest.restore) { + msRestAuth.UserTokenCredentials.prototype.signRequest.restore(); } - sinon.stub(msRestAzure.UserTokenCredentials.prototype, 'signRequest').callsFake(function(webResource, callback) { + sinon.stub(msRestAuth.UserTokenCredentials.prototype, 'signRequest').callsFake(function (webResource, callback) { return callback(null); }); - if (msRestAzure.ApplicationTokenCredentials.prototype.signRequest.restore) { - msRestAzure.ApplicationTokenCredentials.prototype.signRequest.restore(); + if (msRestAuth.ApplicationTokenCredentials.prototype.signRequest.restore) { + msRestAuth.ApplicationTokenCredentials.prototype.signRequest.restore(); } - sinon.stub(msRestAzure.ApplicationTokenCredentials.prototype, 'signRequest').callsFake(function(webResource, callback) { + sinon.stub(msRestAuth.ApplicationTokenCredentials.prototype, 'signRequest').callsFake(function (webResource, callback) { return callback(null); }); diff --git a/tools/package.json b/tools/package.json index 28d2fad03e..3f94081a26 100644 --- a/tools/package.json +++ b/tools/package.json @@ -29,12 +29,14 @@ "main": "./lib/azure.js", "license": "(MIT OR Apache-2.0)", "dependencies": { + "@azure/ms-rest-azure-js": "^2.1.0", + "@azure/ms-rest-nodeauth": "^3.1.1", + "@azure/ms-rest-azure-env":"^2.0.0", "@types/request": "^2.47.1", "botframework-connector": "4.1.6", "dotenv": "^4.0.0", "mime": "^1.4.1", "ms-rest": "^2.3.6", - "ms-rest-azure": "^2.5.7", "underscore": "^1.13.1", "uuid": "^3.3.2" }, diff --git a/tools/resourceManagement/lib/resource/models/baseResource.js b/tools/resourceManagement/lib/resource/models/baseResource.js new file mode 100644 index 0000000000..7162642092 --- /dev/null +++ b/tools/resourceManagement/lib/resource/models/baseResource.js @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +'use strict'; + +/** + * @class + * Initializes a new instance of the Resource class. + * @constructor + */ +class BaseResource { + constructor() { } + + /** + * Defines the metadata of BaseResource + * + * @returns {object} metadata of BaseResource + * + */ + mapper() { + return { + required: false, + serializedName: 'BaseResource', + type: { + name: 'Composite', + className: 'BaseResource', + modelProperties: { + } + } + }; + } + + /** + * Validate the payload against the Resource schema + * + * @param {JSON} payload + * + */ + serialize() { + return {}; + } + + /** + * Deserialize the instance to Resource schema + * + * @param {JSON} instance + * + */ + deserialize(instance) { + return instance; + } +} + +module.exports = BaseResource; diff --git a/tools/resourceManagement/lib/resource/models/cloudError.js b/tools/resourceManagement/lib/resource/models/cloudError.js new file mode 100644 index 0000000000..7a5d2f29a9 --- /dev/null +++ b/tools/resourceManagement/lib/resource/models/cloudError.js @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +'use strict'; + +/** + * @class + * Provides additional information about an http error response returned from a Microsoft Azure service. + * @constructor + * @member {string} [code] The error code parsed from the body of the http error response + * + * @member {string} [message] The error message parsed from the body of the http error response + * + * @member {string} [target] The target of the error + * + * @member {array} [details] An array of CloudError objects specifying the details + * + * @member {Object} [innererror] The inner error parsed from the body of the http error response + * + * @member {Object} [additionalInfo] The additional error information + */ +class CloudError extends Error { + constructor(parameters) { + super(); + this.name = this.constructor.name; + + if (parameters) { + if (parameters.code) { + this.code = parameters.code; + } + + if (parameters.message) { + this.message = parameters.message; + } + + if (parameters.target) { + this.target = parameters.target; + } + + if (parameters.details) { + var tempDetails = []; + parameters.details.forEach(function (element) { + if (element) { + element = new CloudError(element); + } + tempDetails.push(element); + }); + this.details = tempDetails; + } + + if (parameters.innererror) { + this.innererror = JSON.parse(JSON.stringify(parameters.innererror)); + } + + if (parameters.additionalInfo) { + this.additionalInfo = parameters.additionalInfo; + } + } + } + + /** + * Defines the metadata of CloudError + * + * @returns {object} metadata of CloudError + * + */ + mapper() { + return { + required: false, + serializedName: 'CloudError', + type: { + name: 'Composite', + className: 'CloudError', + modelProperties: { + code: { + required: false, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + }, + target: { + required: false, + serializedName: 'target', + type: { + name: 'String' + } + }, + details: { + required: false, + serializedName: 'details', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CloudErrorElementType', + type: { + name: 'Composite', + className: 'CloudError' + } + } + } + }, + innererror: { + required: false, + serializedName: 'innererror', + type: { + name: 'Object' + } + }, + additionalInfo: { + required: false, + serializedName: 'additionalInfo', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AdditionalInfoElementType', + type: { + name: 'Composite', + className: 'AdditionalInfoElement', + modelProperties: { + type: { + required: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + info: { + required: false, + serializedName: 'info', + type: { + name: 'Object' + } + } + } + } + } + } + } + } + } + }; + } + + /** + * Serialize the instance to CloudError schema + * + * @param {JSON} instance + * + */ + serialize() { + var payload = { error: {} }; + if (this.code) { + payload.error.code = this.code; + } + + if (this.message) { + payload.error.message = this.message; + } + + if (this.target) { + payload.error.target = this.target; + } + + if (this.details) { + var deserializedArray = []; + this.details.forEach(function (element1) { + if (element1) { + element1 = this.serialize(element1); + } + deserializedArray.push(element1); + }); + payload.error.details = deserializedArray; + } + + if (this.innererror) { + payload.error.innererror = JSON.parse(JSON.stringify(this.innererror)); + } + + if (this.additionalInfo) { + payload.error.additionalInfo = JSON.parse(JSON.stringify(this.additionalInfo)); + } + + return payload; + } + + /** + * Deserialize the instance to CloudError schema + * + * @param {JSON} instance + * + */ + deserialize(instance) { + if (instance) { + + if (instance.error) { + + if (instance.error.code) { + this.code = instance.error.code; + } + + if (instance.error.message) { + this.message = instance.error.message; + } + + if (instance.error.target) { + this.target = instance.error.target; + } + + if (instance.error.details) { + var deserializedArray = []; + instance.error.details.forEach(function (element1) { + if (element1) { + element1 = this.deserialize(element1); + } + deserializedArray.push(element1); + }); + this.details = deserializedArray; + } + + if (instance.error.innererror) { + this.innererror = JSON.parse(JSON.stringify(instance.error.innererror)); + } + + if (instance.error.additionalInfo) { + this.additionalInfo = JSON.parse(JSON.stringify(instance.error.additionalInfo)); + } + } + } + return this; + } +} + +module.exports = CloudError; diff --git a/tools/resourceManagement/lib/resource/models/index.js b/tools/resourceManagement/lib/resource/models/index.js index d3190d8dc9..bd292d0bf8 100644 --- a/tools/resourceManagement/lib/resource/models/index.js +++ b/tools/resourceManagement/lib/resource/models/index.js @@ -14,10 +14,8 @@ 'use strict'; -var msRestAzure = require('ms-rest-azure'); - -exports.BaseResource = msRestAzure.BaseResource; -exports.CloudError = msRestAzure.CloudError; +exports.BaseResource = require('./baseResource'); +exports.CloudError = require('./cloudError'); exports.DeploymentExtendedFilter = require('./deploymentExtendedFilter'); exports.GenericResourceFilter = require('./genericResourceFilter'); exports.ResourceGroupFilter = require('./resourceGroupFilter'); diff --git a/tools/resourceManagement/lib/resource/operations/deploymentOperations.js b/tools/resourceManagement/lib/resource/operations/deploymentOperations.js index 278d90b590..e5a2c637fb 100644 --- a/tools/resourceManagement/lib/resource/operations/deploymentOperations.js +++ b/tools/resourceManagement/lib/resource/operations/deploymentOperations.js @@ -11,7 +11,7 @@ 'use strict'; const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); +const uuid = require('uuid'); const WebResource = msRest.WebResource; /** @@ -125,7 +125,7 @@ function _get(resourceGroupName, deploymentName, operationId, options, callback) // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -310,7 +310,7 @@ function _list(resourceGroupName, deploymentName, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -438,7 +438,7 @@ function _listNext(nextPageLink, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; diff --git a/tools/resourceManagement/lib/resource/operations/deployments.js b/tools/resourceManagement/lib/resource/operations/deployments.js index 2232d1ec2a..270b838671 100644 --- a/tools/resourceManagement/lib/resource/operations/deployments.js +++ b/tools/resourceManagement/lib/resource/operations/deployments.js @@ -11,7 +11,7 @@ 'use strict'; const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); +const uuid = require('uuid'); const WebResource = msRest.WebResource; @@ -193,7 +193,7 @@ function _checkExistence(resourceGroupName, deploymentName, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -492,7 +492,7 @@ function _get(resourceGroupName, deploymentName, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -670,7 +670,7 @@ function _cancel(resourceGroupName, deploymentName, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -890,7 +890,7 @@ function _validate(resourceGroupName, deploymentName, parameters, options, callb // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -1097,7 +1097,7 @@ function _exportTemplate(resourceGroupName, deploymentName, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -1271,7 +1271,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -1455,7 +1455,7 @@ function _beginDeleteMethod(resourceGroupName, deploymentName, options, callback // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -1677,7 +1677,7 @@ function _beginCreateOrUpdate(resourceGroupName, deploymentName, parameters, opt // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -1835,7 +1835,7 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; diff --git a/tools/resourceManagement/lib/resource/operations/providers.js b/tools/resourceManagement/lib/resource/operations/providers.js index 46daa81baa..10c0b8f9ec 100644 --- a/tools/resourceManagement/lib/resource/operations/providers.js +++ b/tools/resourceManagement/lib/resource/operations/providers.js @@ -11,7 +11,7 @@ 'use strict'; const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); +const uuid = require('uuid'); const WebResource = msRest.WebResource; /** @@ -85,7 +85,7 @@ function _unregister(resourceProviderNamespace, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -225,7 +225,7 @@ function _register(resourceProviderNamespace, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -380,7 +380,7 @@ function _list(options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -530,7 +530,7 @@ function _get(resourceProviderNamespace, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -657,7 +657,7 @@ function _listNext(nextPageLink, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; diff --git a/tools/resourceManagement/lib/resource/operations/resourceGroups.js b/tools/resourceManagement/lib/resource/operations/resourceGroups.js index a5dffe088c..4f7248e29e 100644 --- a/tools/resourceManagement/lib/resource/operations/resourceGroups.js +++ b/tools/resourceManagement/lib/resource/operations/resourceGroups.js @@ -11,7 +11,7 @@ 'use strict'; const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); +const uuid = require('uuid'); const WebResource = msRest.WebResource; /** @@ -98,7 +98,7 @@ function _checkExistence(resourceGroupName, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -255,7 +255,7 @@ function _createOrUpdate(resourceGroupName, parameters, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -506,7 +506,7 @@ function _get(resourceGroupName, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -678,7 +678,7 @@ function _update(resourceGroupName, parameters, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -860,7 +860,7 @@ function _exportTemplate(resourceGroupName, parameters, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -1027,7 +1027,7 @@ function _list(options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -1184,7 +1184,7 @@ function _beginDeleteMethod(resourceGroupName, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -1295,7 +1295,7 @@ function _listNext(nextPageLink, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; diff --git a/tools/resourceManagement/lib/resource/operations/resources.js b/tools/resourceManagement/lib/resource/operations/resources.js index c154fb5b08..1334376fb3 100644 --- a/tools/resourceManagement/lib/resource/operations/resources.js +++ b/tools/resourceManagement/lib/resource/operations/resources.js @@ -9,9 +9,9 @@ */ 'use strict'; - +const uuid = require('uuid'); const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); + const WebResource = msRest.WebResource; /** @@ -127,7 +127,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -439,7 +439,7 @@ function _list(options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -620,7 +620,7 @@ function _checkExistence(resourceGroupName, resourceProviderNamespace, parentRes // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -988,7 +988,7 @@ function _get(resourceGroupName, resourceProviderNamespace, parentResourcePath, // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -1126,7 +1126,7 @@ function _checkExistenceById(resourceId, apiVersion, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -1436,7 +1436,7 @@ function _getById(resourceId, apiVersion, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -1604,7 +1604,7 @@ function _beginMoveResources(sourceResourceGroupName, parameters, options, callb // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -1772,7 +1772,7 @@ function _beginValidateMoveResources(sourceResourceGroupName, parameters, option // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -1949,7 +1949,7 @@ function _beginDeleteMethod(resourceGroupName, resourceProviderNamespace, parent // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -2158,7 +2158,7 @@ function _beginCreateOrUpdate(resourceGroupName, resourceProviderNamespace, pare // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -2327,7 +2327,7 @@ function _beginDeleteById(resourceId, apiVersion, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -2494,7 +2494,7 @@ function _beginCreateOrUpdateById(resourceId, apiVersion, parameters, options, c // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -2652,7 +2652,7 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -2779,7 +2779,7 @@ function _listNext(nextPageLink, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; diff --git a/tools/resourceManagement/lib/resource/operations/tags.js b/tools/resourceManagement/lib/resource/operations/tags.js index 28cebfcf69..46b3d53fcb 100644 --- a/tools/resourceManagement/lib/resource/operations/tags.js +++ b/tools/resourceManagement/lib/resource/operations/tags.js @@ -11,7 +11,7 @@ 'use strict'; const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); +const uuid = require('uuid'); const WebResource = msRest.WebResource; /** @@ -89,7 +89,7 @@ function _deleteValue(tagName, tagValue, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -217,7 +217,7 @@ function _createOrUpdateValue(tagName, tagValue, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -377,7 +377,7 @@ function _createOrUpdate(tagName, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -534,7 +534,7 @@ function _deleteMethod(tagName, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -651,7 +651,7 @@ function _list(options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; @@ -779,7 +779,7 @@ function _listNext(nextPageLink, options, callback) { // Set Headers httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + httpRequest.headers['x-ms-client-request-id'] = uuid.v4(); } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; diff --git a/tools/resourceManagement/lib/resource/resourceManagementClient.js b/tools/resourceManagement/lib/resource/resourceManagementClient.js index 9e7be32a70..4d10fc867e 100644 --- a/tools/resourceManagement/lib/resource/resourceManagementClient.js +++ b/tools/resourceManagement/lib/resource/resourceManagementClient.js @@ -15,8 +15,9 @@ 'use strict'; const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const ServiceClient = msRestAzure.AzureServiceClient; +const fs = require('fs'); +const path = require('path'); +const ServiceClient = msRest.ServiceClient; const models = require('./models'); const operations = require('./operations'); @@ -61,15 +62,18 @@ class ResourceManagementClient extends ServiceClient { this.credentials = credentials; this.subscriptionId = subscriptionId; + //property to store various pieces of information we would finally concat to produce a user-agent header. + this.userAgentInfo = { value: [] }; + let packageInfo = this.getPackageJsonInfo(__dirname); this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; } - if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { + if (options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { this.generateClientRequestId = options.generateClientRequestId; } this.deployments = new operations.Deployments(this); @@ -82,6 +86,54 @@ class ResourceManagementClient extends ServiceClient { msRest.addSerializationMixin(this); } + addUserAgentInfo(additionalUserAgentInfo) { + if (this.userAgentInfo.value.indexOf(additionalUserAgentInfo) === -1) { + this.userAgentInfo.value.push(additionalUserAgentInfo); + } + } + + getPackageJsonInfo(managementClientDir) { + + // algorithm: + // package.json is placed next to the lib directory. So we try to find the lib directory first. + // In most packages we generate via autorest, the management client directly lives in the lib directory + // so, package.json could be found just one level above where management client lives. + // In some packages (azure-arm-resource), management client lives at one level deeper in the lib directory + // so, we have to traverse at least two levels higher to locate package.json. + // The algorithm for locating package.json would then be, start at the current directory where management client lives + // and keep searching up until the file is located. We also limit the search depth to 2, since we know the structure of + // the clients we generate. + + let packageJsonInfo = { + name: 'NO_NAME', + version: '0.0.0' + }; + + // private helper + function _getLibPath(currentDir, searchDepth) { + if (searchDepth < 1) { + return; + } + + // if current directory is lib, return current dir, otherwise search one level up. + return (currentDir.endsWith('lib') || currentDir.endsWith('lib' + path.sep)) ? + currentDir : + _getLibPath(path.join(currentDir, '..'), searchDepth - 1); + } + + let libPath = _getLibPath(managementClientDir, 2); + if (libPath) { + let packageJsonPath = path.join(libPath, '..', 'package.json'); + if (fs.existsSync(packageJsonPath)) { + let data = require(packageJsonPath); + packageJsonInfo.name = data.name; + packageJsonInfo.version = data.version; + } + } + + return packageJsonInfo; + } + } module.exports = ResourceManagementClient; diff --git a/yarn.lock b/yarn.lock index b463b1b274..d394354d40 100644 --- a/yarn.lock +++ b/yarn.lock @@ -39,15 +39,15 @@ tslib "^2.2.0" "@azure/core-client@^1.4.0": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@azure/core-client/-/core-client-1.5.0.tgz#7aabb87d20e08db3683a117191c844bc19adb74e" - integrity sha512-YNk8i9LT6YcFdFO+RRU0E4Ef+A8Y5lhXo6lz61rwbG8Uo7kSqh0YqK04OexiilM43xd6n3Y9yBhLnb1NFNI9dA== + version "1.7.3" + resolved "https://registry.yarnpkg.com/@azure/core-client/-/core-client-1.7.3.tgz#f8cb2a1f91e8bc4921fa2e745cfdfda3e6e491a3" + integrity sha512-kleJ1iUTxcO32Y06dH9Pfi9K4U+Tlb111WXEnbt7R/ne+NLRwppZiTGJuTD5VVoxTMK5NTbEtm5t2vcdNCFe2g== dependencies: "@azure/abort-controller" "^1.0.0" - "@azure/core-asynciterator-polyfill" "^1.0.0" - "@azure/core-auth" "^1.3.0" - "@azure/core-rest-pipeline" "^1.5.0" - "@azure/core-tracing" "1.0.0-preview.13" + "@azure/core-auth" "^1.4.0" + "@azure/core-rest-pipeline" "^1.9.1" + "@azure/core-tracing" "^1.0.0" + "@azure/core-util" "^1.0.0" "@azure/logger" "^1.0.0" tslib "^2.2.0" @@ -88,35 +88,20 @@ dependencies: "@azure/core-asynciterator-polyfill" "^1.0.0" -"@azure/core-rest-pipeline@^1.1.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@azure/core-rest-pipeline/-/core-rest-pipeline-1.3.0.tgz#cce1623383f2ed622f0b13ef53a7ed5239acfd23" - integrity sha512-XdGCm4sVfLvFbd3x17Aw6XNA8SK+sWFvVlOnNSSL2OJGJ4g10LspCpGnIqB+V6OZAaVwOx/eQQN2rOfZzf4Q5w== - dependencies: - "@azure/abort-controller" "^1.0.0" - "@azure/core-auth" "^1.3.0" - "@azure/core-tracing" "1.0.0-preview.13" - "@azure/logger" "^1.0.0" - form-data "^4.0.0" - http-proxy-agent "^4.0.1" - https-proxy-agent "^5.0.0" - tslib "^2.2.0" - uuid "^8.3.0" - -"@azure/core-rest-pipeline@^1.5.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@azure/core-rest-pipeline/-/core-rest-pipeline-1.6.0.tgz#f833a0836779a40300a3633fa73ad8a63186ca73" - integrity sha512-9Euoat1TPR97Q1l5aylxhDyKbtp2hv15AoFeOwC5frQAFNJegtDDf6BUBr7OiAggzjGAYidxkyhL0T6Yu05XWQ== +"@azure/core-rest-pipeline@^1.1.0", "@azure/core-rest-pipeline@^1.9.1": + version "1.12.0" + resolved "https://registry.yarnpkg.com/@azure/core-rest-pipeline/-/core-rest-pipeline-1.12.0.tgz#a36dd361807494845522824532c076daa27c2786" + integrity sha512-+MnSB0vGZjszSzr5AW8z93/9fkDu2RLtWmAN8gskURq7EW2sSwqy8jZa0V26rjuBVkwhdA3Hw8z3VWoeBUOw+A== dependencies: "@azure/abort-controller" "^1.0.0" - "@azure/core-auth" "^1.3.0" - "@azure/core-tracing" "1.0.0-preview.13" + "@azure/core-auth" "^1.4.0" + "@azure/core-tracing" "^1.0.1" + "@azure/core-util" "^1.3.0" "@azure/logger" "^1.0.0" form-data "^4.0.0" - http-proxy-agent "^4.0.1" + http-proxy-agent "^5.0.0" https-proxy-agent "^5.0.0" tslib "^2.2.0" - uuid "^8.3.0" "@azure/core-tracing@1.0.0-preview.13": version "1.0.0-preview.13" @@ -135,12 +120,20 @@ "@opentelemetry/api" "^0.10.2" tslib "^2.0.0" -"@azure/core-util@^1.0.0-beta.1": - version "1.0.0-beta.1" - resolved "https://registry.yarnpkg.com/@azure/core-util/-/core-util-1.0.0-beta.1.tgz#2efd2c74b4b0a38180369f50fe274a3c4cd36e98" - integrity sha512-pS6cup979/qyuyNP9chIybK2qVkJ3MarbY/bx3JcGKE6An6dRweLnsfJfU2ydqUI/B51Rjnn59ajHIhCUTwWZw== +"@azure/core-tracing@^1.0.0", "@azure/core-tracing@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@azure/core-tracing/-/core-tracing-1.0.1.tgz#352a38cbea438c4a83c86b314f48017d70ba9503" + integrity sha512-I5CGMoLtX+pI17ZdiFJZgxMJApsK6jjfm85hpgp3oazCdq5Wxgh4wMr7ge/TTWW1B5WBuvIOI1fMU/FrOAMKrw== + dependencies: + tslib "^2.2.0" + +"@azure/core-util@^1.0.0", "@azure/core-util@^1.3.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@azure/core-util/-/core-util-1.4.0.tgz#c120a56b3e48a9e4d20619a0b00268ae9de891c7" + integrity sha512-eGAyJpm3skVQoLiRqm/xPa+SXi/NPDdSHMxbRAz2lSprd+Zs+qrpQGQQ2VQ3Nttu+nSZR4XoYQC71LbEI7jsig== dependencies: - tslib "^2.0.0" + "@azure/abort-controller" "^1.0.0" + tslib "^2.2.0" "@azure/core-util@^1.1.1", "@azure/core-util@^1.2.0": version "1.3.2" @@ -174,20 +167,20 @@ integrity sha512-dZITbYPNg6ay6ngcCOjRUh1wDhlFITS0zIkqplyH5KfKEAVPooaoaye5mUFnR+WP9WdGRjlNXyl/y2tgWKHcRg== "@azure/identity@^2.0.4": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@azure/identity/-/identity-2.0.4.tgz#f5cfde0daf1b9ebaaff3ed6c504f50d7d7c939a5" - integrity sha512-ZgFubAsmo7dji63NLPaot6O7pmDfceAUPY57uphSCr0hmRj+Cakqb4SUz5SohCHFtscrhcmejRU903Fowz6iXg== + version "2.1.0" + resolved "https://registry.yarnpkg.com/@azure/identity/-/identity-2.1.0.tgz#89f0bfc1d1264dfd3d0cb19837c33a9c6706d548" + integrity sha512-BPDz1sK7Ul9t0l9YKLEa8PHqWU4iCfhGJ+ELJl6c8CP3TpJt2urNCbm0ZHsthmxRsYoMPbz2Dvzj30zXZVmAFw== dependencies: "@azure/abort-controller" "^1.0.0" "@azure/core-auth" "^1.3.0" "@azure/core-client" "^1.4.0" "@azure/core-rest-pipeline" "^1.1.0" - "@azure/core-tracing" "1.0.0-preview.13" - "@azure/core-util" "^1.0.0-beta.1" + "@azure/core-tracing" "^1.0.0" + "@azure/core-util" "^1.0.0" "@azure/logger" "^1.0.0" - "@azure/msal-browser" "^2.16.0" - "@azure/msal-common" "^4.5.1" - "@azure/msal-node" "^1.3.0" + "@azure/msal-browser" "^2.26.0" + "@azure/msal-common" "^7.0.0" + "@azure/msal-node" "^1.10.0" events "^3.0.0" jws "^4.0.0" open "^8.0.0" @@ -209,7 +202,21 @@ dependencies: tslib "^2.0.0" -"@azure/ms-rest-js@^1.6.0", "@azure/ms-rest-js@^2.7.0": +"@azure/ms-rest-azure-env@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@azure/ms-rest-azure-env/-/ms-rest-azure-env-2.0.0.tgz#45809f89763a480924e21d3c620cd40866771625" + integrity sha512-dG76W7ElfLi+fbTjnZVGj+M9e0BIEJmRxU6fHaUQ12bZBe8EJKYb2GV50YWNaP2uJiVQ5+7nXEVj1VN1UQtaEw== + +"@azure/ms-rest-azure-js@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@azure/ms-rest-azure-js/-/ms-rest-azure-js-2.1.0.tgz#8c90b31468aeca3146b06c7144b386fd4827f64c" + integrity sha512-CjZjB8apvXl5h97Ck6SbeeCmU0sk56YPozPtTyGudPp1RGoHXNjFNtoOvwOG76EdpmMpxbK10DqcygI16Lu60Q== + dependencies: + "@azure/core-auth" "^1.1.4" + "@azure/ms-rest-js" "^2.2.0" + tslib "^1.10.0" + +"@azure/ms-rest-js@^1.6.0", "@azure/ms-rest-js@^2.0.4", "@azure/ms-rest-js@^2.2.0", "@azure/ms-rest-js@^2.7.0": version "2.7.0" resolved "https://registry.yarnpkg.com/@azure/ms-rest-js/-/ms-rest-js-2.7.0.tgz#8639065577ffdf4946951e1d246334ebfd72d537" integrity sha512-ngbzWbqF+NmztDOpLBVDxYM+XLcUj7nKhxGbSU9WtIsXfRB//cf2ZbAG5HkOrhU9/wd/ORRB6lM/d69RKVjiyA== @@ -223,35 +230,39 @@ uuid "^8.3.2" xml2js "^0.5.0" -"@azure/msal-browser@^2.16.0": - version "2.17.0" - resolved "https://registry.yarnpkg.com/@azure/msal-browser/-/msal-browser-2.17.0.tgz#beb7d91e6123534b42c0d2ce85eda42a136a8555" - integrity sha512-NDK0NfsiRkjUU4V4jTt++aUPVg3JnRF4zV3B6WEOXDMH3OCbSJyqdO1WhdUWgMNQZz6Dk9bO/c6Bf4vUEgg+WA== +"@azure/ms-rest-nodeauth@^3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@azure/ms-rest-nodeauth/-/ms-rest-nodeauth-3.1.1.tgz#2624222f0685ae580801d6f1abeab20923814693" + integrity sha512-UA/8dgLy3+ZiwJjAZHxL4MUB14fFQPkaAOZ94jsTW/Z6WmoOeny2+cLk0+dyIX/iH6qSrEWKwbStEeB970B9pA== dependencies: - "@azure/msal-common" "^5.0.0" + "@azure/ms-rest-azure-env" "^2.0.0" + "@azure/ms-rest-js" "^2.0.4" + adal-node "^0.2.2" -"@azure/msal-common@^4.5.1": - version "4.5.1" - resolved "https://registry.yarnpkg.com/@azure/msal-common/-/msal-common-4.5.1.tgz#f35af8b634ae24aebd0906deb237c0db1afa5826" - integrity sha512-/i5dXM+QAtO+6atYd5oHGBAx48EGSISkXNXViheliOQe+SIFMDo3gSq3lL54W0suOSAsVPws3XnTaIHlla0PIQ== +"@azure/msal-browser@^2.26.0": + version "2.38.1" + resolved "https://registry.yarnpkg.com/@azure/msal-browser/-/msal-browser-2.38.1.tgz#4bdc2c4820dedd569c2a203e0167815a541c04fa" + integrity sha512-NROo7mLpw7aWtj8tWy9ZPz3WWiudwVAOIDZ1K3PPrjDAA4kFYayWlbZiJl1T1sD5Oqwa6FOtwzFSvuUj1CWp6Q== dependencies: - debug "^4.1.1" + "@azure/msal-common" "13.2.1" -"@azure/msal-common@^5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@azure/msal-common/-/msal-common-5.0.0.tgz#4e927b9bdc3715e0b043ece01360c73739ef52c1" - integrity sha512-b3QXfW0BlGZs3mQ59rkVGcArzeMGd1RjHxyRez5bCB1F/F3jRmn2nY9jGamrILPBFz7weGpJiouW1VmDmAuk7Q== - dependencies: - debug "^4.1.1" +"@azure/msal-common@13.2.1": + version "13.2.1" + resolved "https://registry.yarnpkg.com/@azure/msal-common/-/msal-common-13.2.1.tgz#64f2c42d35df1c6ee0ea9ac03ba127482dd8692c" + integrity sha512-9CtyVdDtAOw+raemKg8gdBuE7gleObgSb7p4bzMIlUt8eM69/Gaow7uqr1gK3jLYINSrss32OZW8mBbdgVLiHg== -"@azure/msal-node@^1.3.0": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@azure/msal-node/-/msal-node-1.3.1.tgz#55c8915c9bc5222dbe152ffd67f9357b83461fde" - integrity sha512-c3bSdXUBpjUehx7mdI5iY+mwMF1mTz1qrVppH5LTD3SfbousRaFN9F2phAeaejVnCzbKzFPl4TTHxOJbkBVXHA== +"@azure/msal-common@^7.0.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@azure/msal-common/-/msal-common-7.6.0.tgz#b52e97ef540275f72611cff57937dfa0b34cdcca" + integrity sha512-XqfbglUTVLdkHQ8F9UQJtKseRr3sSnr9ysboxtoswvaMVaEfvyLtMoHv9XdKUfOc0qKGzNgRFd9yRjIWVepl6Q== + +"@azure/msal-node@^1.10.0": + version "1.18.1" + resolved "https://registry.yarnpkg.com/@azure/msal-node/-/msal-node-1.18.1.tgz#e301364f9ab74278617e87f0e08d6a334ae13886" + integrity sha512-B4kUOWJoN4vD8b3pGJ9Q9mIZhaDb8EnQM1aN0x1otlQgTfzDvEk6rWc6fy8uGdtXqcNddBtiXdc4oRiItroVkA== dependencies: - "@azure/msal-common" "^5.0.0" - axios "^0.21.1" - jsonwebtoken "^8.5.1" + "@azure/msal-common" "13.2.1" + jsonwebtoken "^9.0.0" uuid "^8.3.0" "@azure/storage-blob@^12.15.0": @@ -3131,7 +3142,7 @@ async-listener@^0.6.0: semver "^5.3.0" shimmer "^1.1.0" -async@3.2.3, async@^1.4.0, async@^1.5.2, async@^2.6.1, async@^2.6.3, async@^2.6.4, async@^3.2.3: +async@3.2.3, async@^1.4.0, async@^1.5.2, async@^2.6.1, async@^2.6.3, async@^3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/async/-/async-3.2.3.tgz#ac53dafd3f4720ee9e8a160628f18ea91df196c9" integrity sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g== @@ -8343,7 +8354,7 @@ jsonschema@^1.4.0: resolved "https://registry.yarnpkg.com/jsonschema/-/jsonschema-1.4.0.tgz#1afa34c4bc22190d8e42271ec17ac8b3404f87b2" integrity sha512-/YgW6pRMr6M7C+4o8kS+B/2myEpHCrxO4PEWnqJNBFMjn7EWXqlQ4tGwL6xTHeRplwuZmcAncdvfOad1nT2yMw== -jsonwebtoken@9.0.0, jsonwebtoken@^8.5.1, jsonwebtoken@^9.0.0: +jsonwebtoken@9.0.0, jsonwebtoken@^9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz#d0faf9ba1cc3a56255fe49c0961a67e520c1926d" integrity sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw== @@ -9534,18 +9545,7 @@ move-concurrently@^1.0.1: rimraf "^2.5.4" run-queue "^1.0.3" -ms-rest-azure@2.6.2, ms-rest-azure@^2.5.7, ms-rest-azure@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/ms-rest-azure/-/ms-rest-azure-2.6.2.tgz#65a08799adb417678ce5722669bc15ca740b429e" - integrity sha512-h74ezkiMQ1y8tD0kf0MK2kdCONAP70i032Dt8kBrFsvj3ZqGRj+DHHNRCGLDfkBkSXhILGMeiF8Ji/iSCUJLJg== - dependencies: - adal-node "^0.2.2" - async "^2.6.4" - ms-rest "^2.3.2" - request "^2.88.0" - uuid "^3.2.1" - -ms-rest@^2.3.2, ms-rest@^2.3.6: +ms-rest@^2.3.6: version "2.5.4" resolved "https://registry.yarnpkg.com/ms-rest/-/ms-rest-2.5.4.tgz#57b42299cf302e45d5e1a734220bf7d4a110167a" integrity sha512-VeqCbawxRM6nhw0RKNfj7TWL7SL8PB6MypqwgylXCi+u412uvYoyY/kSmO8n06wyd8nIcnTbYToCmSKFMI1mCg== @@ -10199,7 +10199,7 @@ onetime@^5.1.0: dependencies: mimic-fn "^2.1.0" -open@8.4.0, open@^8.0.0: +open@8.4.0: version "8.4.0" resolved "https://registry.yarnpkg.com/open/-/open-8.4.0.tgz#345321ae18f8138f82565a910fdc6b39e8c244f8" integrity sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q== @@ -10208,6 +10208,15 @@ open@8.4.0, open@^8.0.0: is-docker "^2.1.1" is-wsl "^2.2.0" +open@^8.0.0: + version "8.4.2" + resolved "https://registry.yarnpkg.com/open/-/open-8.4.2.tgz#5b5ffe2a8f793dcd2aad73e550cb87b59cb084f9" + integrity sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ== + dependencies: + define-lazy-prop "^2.0.0" + is-docker "^2.1.1" + is-wsl "^2.2.0" + optionator@^0.8.1: version "0.8.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" From 8dee289706c2ff96daa2445c06ee62e537e92c9d Mon Sep 17 00:00:00 2001 From: JhontSouth Date: Mon, 14 Aug 2023 13:06:51 -0500 Subject: [PATCH 2/7] replace node-auth with azure/identity --- tools/framework/suite-base.js | 74 ++------ tools/package.json | 4 +- .../lib/resource/models/baseResource.js | 5 +- .../lib/resource/operations/resources.js | 1 + .../lib/resource/resourceManagementClient.js | 2 +- tools/resourceManagement/package.json | 3 +- yarn.lock | 160 ++++++++---------- 7 files changed, 89 insertions(+), 160 deletions(-) diff --git a/tools/framework/suite-base.js b/tools/framework/suite-base.js index aa6c10783a..76318f2de2 100644 --- a/tools/framework/suite-base.js +++ b/tools/framework/suite-base.js @@ -7,7 +7,7 @@ // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS,ms-rest-azure +// distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // // See the License for the specific language governing permissions and @@ -23,8 +23,7 @@ var _ = require('underscore'); var util = require('util'); var uuid = require('uuid'); var msRest = require('ms-rest'); -var msRestAuth = require("@azure/ms-rest-nodeauth"); -var {Environment} = require("@azure/ms-rest-azure-env") +var identity = require("@azure/identity"); var MicrosoftAppCredentials = require('botframework-connector/lib/auth/microsoftAppCredentials'); var TokenApiClient = require('botframework-connector/lib/tokenApi/tokenApiClient'); var FileTokenCache = require('../util/fileTokenCache'); @@ -35,6 +34,7 @@ var async = require('async'); var adal = require('adal-node'); var DEFAULT_ADAL_CLIENT_ID = '04b07795-8ddb-461a-bbee-02f9e1bf7b46'; +var DEFAULT_ADAL_TENANT_ID = 'd4058e97-3782-4874-bc12-c975407af782'; /** * @class @@ -69,6 +69,7 @@ function SuiteBase(mochaSuiteObject, testPrefix, env, libraryPath) { //authentication info this.subscriptionId = process.env['AZURE_SUBSCRIPTION_ID'] || 'subscription-id'; this.clientId = process.env['CLIENT_ID'] || DEFAULT_ADAL_CLIENT_ID; + this.tenantId = process.env['TENANT_ID'] || DEFAULT_ADAL_TENANT_ID; this.domain = process.env['DOMAIN'] || 'domain'; this.username = process.env['AZURE_USERNAME'] || 'username@example.com'; this.password = process.env['AZURE_PASSWORD'] || 'dummypassword'; @@ -124,52 +125,19 @@ _.extend(SuiteBase.prototype, { /** * Creates the UserTokenCredentials object. * - * @returns {@azure/ms-rest-nodeauth.UserTokenCredentials} The user token credentials object. + * @returns {@azure/identity.UsernamePasswordCredential} The user token credentials object. */ _createUserCredentials: function() { - if(process.env['AZURE_ENVIRONMENT'] && process.env['AZURE_ENVIRONMENT'].toUpperCase() === 'DOGFOOD') { - var df = { - name: 'Dogfood', - portalUrl: 'https://windows.azure-test.net/', - activeDirectoryEndpointUrl: 'https://login.windows-ppe.net/', - activeDirectoryResourceId: 'https://management.core.windows.net/', - managementEndpointUrl: 'https://management-preview.core.windows-int.net/', - resourceManagerEndpointUrl: 'https://api-dogfood.resources.windows-int.net/' - }; - var env = Environment.add(df); - return new msRestAuth.UserTokenCredentials(this.clientId, this.domain, this.username, - this.password, { 'tokenCache': this.tokenCache, 'environment': env }); - } - - return new msRestAuth.UserTokenCredentials(this.clientId, this.domain, this.username, - this.password, { 'tokenCache': this.tokenCache }); + return new identity.UsernamePasswordCredential(this.tenantId, this.clientId, this.username); }, /** * Creates the ApplicationTokenCredentials object. * - * @returns {@azure/ms-rest-nodeauth.ApplicationTokenCredentials} The application token credentials object. + * @returns {@azure/identity.ClientSecretCredential} The application token credentials object. */ _createApplicationCredentials: function() { - if(process.env['AZURE_ENVIRONMENT'] && process.env['AZURE_ENVIRONMENT'].toUpperCase() === 'DOGFOOD') { - var df = { - name: 'Dogfood', - portalUrl: 'https://windows.azure-test.net/', - activeDirectoryEndpointUrl: 'https://login.windows-ppe.net/', - activeDirectoryResourceId: 'https://management.core.windows.net/', - managementEndpointUrl: 'https://management-preview.core.windows-int.net/', - resourceManagerEndpointUrl: 'https://api-dogfood.resources.windows-int.net/' - }; - var env = Environment.add(df); - return new msRestAuth.ApplicationTokenCredentials(this.clientId, this.domain, this.secret, { - 'tokenCache': this.tokenCache, - 'environment': env - }); - } - - return new msRestAuth.ApplicationTokenCredentials(this.clientId, this.domain, this.secret, { - 'tokenCache': this.tokenCache - }); + return new identity.ClientSecretCredential(this.tenantId, this.clientId, this.secret); }, /** @@ -365,11 +333,11 @@ _.extend(SuiteBase.prototype, { secondCallback(null); } ], - function(err, results) { - if (err) { - throw err; - } - }); + function(err, results) { + if (err) { + throw err; + } + }); }, /** @@ -709,21 +677,7 @@ _.extend(SuiteBase.prototype, { * Stubs certain methods. */ _stubMethods: function() { - if (this.isPlayback) { - if (msRestAuth.UserTokenCredentials.prototype.signRequest.restore) { - msRestAuth.UserTokenCredentials.prototype.signRequest.restore(); - } - sinon.stub(msRestAuth.UserTokenCredentials.prototype, 'signRequest').callsFake(function (webResource, callback) { - return callback(null); - }); - - if (msRestAuth.ApplicationTokenCredentials.prototype.signRequest.restore) { - msRestAuth.ApplicationTokenCredentials.prototype.signRequest.restore(); - } - sinon.stub(msRestAuth.ApplicationTokenCredentials.prototype, 'signRequest').callsFake(function (webResource, callback) { - return callback(null); - }); - + if (this.isPlayback) { if (this.createResourcegroup.restore) { this.createResourcegroup.restore(); } diff --git a/tools/package.json b/tools/package.json index 3f94081a26..519ada8c02 100644 --- a/tools/package.json +++ b/tools/package.json @@ -29,9 +29,7 @@ "main": "./lib/azure.js", "license": "(MIT OR Apache-2.0)", "dependencies": { - "@azure/ms-rest-azure-js": "^2.1.0", - "@azure/ms-rest-nodeauth": "^3.1.1", - "@azure/ms-rest-azure-env":"^2.0.0", + "@azure/identity": "^2.0.4", "@types/request": "^2.47.1", "botframework-connector": "4.1.6", "dotenv": "^4.0.0", diff --git a/tools/resourceManagement/lib/resource/models/baseResource.js b/tools/resourceManagement/lib/resource/models/baseResource.js index 7162642092..178d50596e 100644 --- a/tools/resourceManagement/lib/resource/models/baseResource.js +++ b/tools/resourceManagement/lib/resource/models/baseResource.js @@ -9,8 +9,6 @@ * @constructor */ class BaseResource { - constructor() { } - /** * Defines the metadata of BaseResource * @@ -24,8 +22,7 @@ class BaseResource { type: { name: 'Composite', className: 'BaseResource', - modelProperties: { - } + modelProperties: {} } }; } diff --git a/tools/resourceManagement/lib/resource/operations/resources.js b/tools/resourceManagement/lib/resource/operations/resources.js index 1334376fb3..7b85d2a5d8 100644 --- a/tools/resourceManagement/lib/resource/operations/resources.js +++ b/tools/resourceManagement/lib/resource/operations/resources.js @@ -9,6 +9,7 @@ */ 'use strict'; + const uuid = require('uuid'); const msRest = require('ms-rest'); diff --git a/tools/resourceManagement/lib/resource/resourceManagementClient.js b/tools/resourceManagement/lib/resource/resourceManagementClient.js index 4d10fc867e..c39aabef91 100644 --- a/tools/resourceManagement/lib/resource/resourceManagementClient.js +++ b/tools/resourceManagement/lib/resource/resourceManagementClient.js @@ -62,7 +62,7 @@ class ResourceManagementClient extends ServiceClient { this.credentials = credentials; this.subscriptionId = subscriptionId; - //property to store various pieces of information we would finally concat to produce a user-agent header. + //Property to store various pieces of information we would finally concat to produce a user-agent header. this.userAgentInfo = { value: [] }; let packageInfo = this.getPackageJsonInfo(__dirname); diff --git a/tools/resourceManagement/package.json b/tools/resourceManagement/package.json index 6dd7eb7994..eb98438b53 100644 --- a/tools/resourceManagement/package.json +++ b/tools/resourceManagement/package.json @@ -20,8 +20,7 @@ "types": "./lib/resource.d.ts", "license": "MIT", "dependencies": { - "ms-rest": "^2.0.0", - "ms-rest-azure": "^2.0.0" + "ms-rest": "^2.0.0" }, "homepage": "http://github.com/Azure/azure-sdk-for-node", "repository": { diff --git a/yarn.lock b/yarn.lock index d394354d40..a4ff88bf35 100644 --- a/yarn.lock +++ b/yarn.lock @@ -39,15 +39,15 @@ tslib "^2.2.0" "@azure/core-client@^1.4.0": - version "1.7.3" - resolved "https://registry.yarnpkg.com/@azure/core-client/-/core-client-1.7.3.tgz#f8cb2a1f91e8bc4921fa2e745cfdfda3e6e491a3" - integrity sha512-kleJ1iUTxcO32Y06dH9Pfi9K4U+Tlb111WXEnbt7R/ne+NLRwppZiTGJuTD5VVoxTMK5NTbEtm5t2vcdNCFe2g== + version "1.5.0" + resolved "https://registry.yarnpkg.com/@azure/core-client/-/core-client-1.5.0.tgz#7aabb87d20e08db3683a117191c844bc19adb74e" + integrity sha512-YNk8i9LT6YcFdFO+RRU0E4Ef+A8Y5lhXo6lz61rwbG8Uo7kSqh0YqK04OexiilM43xd6n3Y9yBhLnb1NFNI9dA== dependencies: "@azure/abort-controller" "^1.0.0" - "@azure/core-auth" "^1.4.0" - "@azure/core-rest-pipeline" "^1.9.1" - "@azure/core-tracing" "^1.0.0" - "@azure/core-util" "^1.0.0" + "@azure/core-asynciterator-polyfill" "^1.0.0" + "@azure/core-auth" "^1.3.0" + "@azure/core-rest-pipeline" "^1.5.0" + "@azure/core-tracing" "1.0.0-preview.13" "@azure/logger" "^1.0.0" tslib "^2.2.0" @@ -88,20 +88,35 @@ dependencies: "@azure/core-asynciterator-polyfill" "^1.0.0" -"@azure/core-rest-pipeline@^1.1.0", "@azure/core-rest-pipeline@^1.9.1": - version "1.12.0" - resolved "https://registry.yarnpkg.com/@azure/core-rest-pipeline/-/core-rest-pipeline-1.12.0.tgz#a36dd361807494845522824532c076daa27c2786" - integrity sha512-+MnSB0vGZjszSzr5AW8z93/9fkDu2RLtWmAN8gskURq7EW2sSwqy8jZa0V26rjuBVkwhdA3Hw8z3VWoeBUOw+A== +"@azure/core-rest-pipeline@^1.1.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@azure/core-rest-pipeline/-/core-rest-pipeline-1.3.0.tgz#cce1623383f2ed622f0b13ef53a7ed5239acfd23" + integrity sha512-XdGCm4sVfLvFbd3x17Aw6XNA8SK+sWFvVlOnNSSL2OJGJ4g10LspCpGnIqB+V6OZAaVwOx/eQQN2rOfZzf4Q5w== dependencies: "@azure/abort-controller" "^1.0.0" - "@azure/core-auth" "^1.4.0" - "@azure/core-tracing" "^1.0.1" - "@azure/core-util" "^1.3.0" + "@azure/core-auth" "^1.3.0" + "@azure/core-tracing" "1.0.0-preview.13" "@azure/logger" "^1.0.0" form-data "^4.0.0" - http-proxy-agent "^5.0.0" + http-proxy-agent "^4.0.1" https-proxy-agent "^5.0.0" tslib "^2.2.0" + uuid "^8.3.0" + +"@azure/core-rest-pipeline@^1.5.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@azure/core-rest-pipeline/-/core-rest-pipeline-1.6.0.tgz#f833a0836779a40300a3633fa73ad8a63186ca73" + integrity sha512-9Euoat1TPR97Q1l5aylxhDyKbtp2hv15AoFeOwC5frQAFNJegtDDf6BUBr7OiAggzjGAYidxkyhL0T6Yu05XWQ== + dependencies: + "@azure/abort-controller" "^1.0.0" + "@azure/core-auth" "^1.3.0" + "@azure/core-tracing" "1.0.0-preview.13" + "@azure/logger" "^1.0.0" + form-data "^4.0.0" + http-proxy-agent "^4.0.1" + https-proxy-agent "^5.0.0" + tslib "^2.2.0" + uuid "^8.3.0" "@azure/core-tracing@1.0.0-preview.13": version "1.0.0-preview.13" @@ -120,20 +135,12 @@ "@opentelemetry/api" "^0.10.2" tslib "^2.0.0" -"@azure/core-tracing@^1.0.0", "@azure/core-tracing@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@azure/core-tracing/-/core-tracing-1.0.1.tgz#352a38cbea438c4a83c86b314f48017d70ba9503" - integrity sha512-I5CGMoLtX+pI17ZdiFJZgxMJApsK6jjfm85hpgp3oazCdq5Wxgh4wMr7ge/TTWW1B5WBuvIOI1fMU/FrOAMKrw== +"@azure/core-util@^1.0.0-beta.1": + version "1.0.0-beta.1" + resolved "https://registry.yarnpkg.com/@azure/core-util/-/core-util-1.0.0-beta.1.tgz#2efd2c74b4b0a38180369f50fe274a3c4cd36e98" + integrity sha512-pS6cup979/qyuyNP9chIybK2qVkJ3MarbY/bx3JcGKE6An6dRweLnsfJfU2ydqUI/B51Rjnn59ajHIhCUTwWZw== dependencies: - tslib "^2.2.0" - -"@azure/core-util@^1.0.0", "@azure/core-util@^1.3.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@azure/core-util/-/core-util-1.4.0.tgz#c120a56b3e48a9e4d20619a0b00268ae9de891c7" - integrity sha512-eGAyJpm3skVQoLiRqm/xPa+SXi/NPDdSHMxbRAz2lSprd+Zs+qrpQGQQ2VQ3Nttu+nSZR4XoYQC71LbEI7jsig== - dependencies: - "@azure/abort-controller" "^1.0.0" - tslib "^2.2.0" + tslib "^2.0.0" "@azure/core-util@^1.1.1", "@azure/core-util@^1.2.0": version "1.3.2" @@ -167,20 +174,20 @@ integrity sha512-dZITbYPNg6ay6ngcCOjRUh1wDhlFITS0zIkqplyH5KfKEAVPooaoaye5mUFnR+WP9WdGRjlNXyl/y2tgWKHcRg== "@azure/identity@^2.0.4": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@azure/identity/-/identity-2.1.0.tgz#89f0bfc1d1264dfd3d0cb19837c33a9c6706d548" - integrity sha512-BPDz1sK7Ul9t0l9YKLEa8PHqWU4iCfhGJ+ELJl6c8CP3TpJt2urNCbm0ZHsthmxRsYoMPbz2Dvzj30zXZVmAFw== + version "2.0.4" + resolved "https://registry.yarnpkg.com/@azure/identity/-/identity-2.0.4.tgz#f5cfde0daf1b9ebaaff3ed6c504f50d7d7c939a5" + integrity sha512-ZgFubAsmo7dji63NLPaot6O7pmDfceAUPY57uphSCr0hmRj+Cakqb4SUz5SohCHFtscrhcmejRU903Fowz6iXg== dependencies: "@azure/abort-controller" "^1.0.0" "@azure/core-auth" "^1.3.0" "@azure/core-client" "^1.4.0" "@azure/core-rest-pipeline" "^1.1.0" - "@azure/core-tracing" "^1.0.0" - "@azure/core-util" "^1.0.0" + "@azure/core-tracing" "1.0.0-preview.13" + "@azure/core-util" "^1.0.0-beta.1" "@azure/logger" "^1.0.0" - "@azure/msal-browser" "^2.26.0" - "@azure/msal-common" "^7.0.0" - "@azure/msal-node" "^1.10.0" + "@azure/msal-browser" "^2.16.0" + "@azure/msal-common" "^4.5.1" + "@azure/msal-node" "^1.3.0" events "^3.0.0" jws "^4.0.0" open "^8.0.0" @@ -202,21 +209,7 @@ dependencies: tslib "^2.0.0" -"@azure/ms-rest-azure-env@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@azure/ms-rest-azure-env/-/ms-rest-azure-env-2.0.0.tgz#45809f89763a480924e21d3c620cd40866771625" - integrity sha512-dG76W7ElfLi+fbTjnZVGj+M9e0BIEJmRxU6fHaUQ12bZBe8EJKYb2GV50YWNaP2uJiVQ5+7nXEVj1VN1UQtaEw== - -"@azure/ms-rest-azure-js@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@azure/ms-rest-azure-js/-/ms-rest-azure-js-2.1.0.tgz#8c90b31468aeca3146b06c7144b386fd4827f64c" - integrity sha512-CjZjB8apvXl5h97Ck6SbeeCmU0sk56YPozPtTyGudPp1RGoHXNjFNtoOvwOG76EdpmMpxbK10DqcygI16Lu60Q== - dependencies: - "@azure/core-auth" "^1.1.4" - "@azure/ms-rest-js" "^2.2.0" - tslib "^1.10.0" - -"@azure/ms-rest-js@^1.6.0", "@azure/ms-rest-js@^2.0.4", "@azure/ms-rest-js@^2.2.0", "@azure/ms-rest-js@^2.7.0": +"@azure/ms-rest-js@^1.6.0", "@azure/ms-rest-js@^2.7.0": version "2.7.0" resolved "https://registry.yarnpkg.com/@azure/ms-rest-js/-/ms-rest-js-2.7.0.tgz#8639065577ffdf4946951e1d246334ebfd72d537" integrity sha512-ngbzWbqF+NmztDOpLBVDxYM+XLcUj7nKhxGbSU9WtIsXfRB//cf2ZbAG5HkOrhU9/wd/ORRB6lM/d69RKVjiyA== @@ -230,39 +223,35 @@ uuid "^8.3.2" xml2js "^0.5.0" -"@azure/ms-rest-nodeauth@^3.1.1": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@azure/ms-rest-nodeauth/-/ms-rest-nodeauth-3.1.1.tgz#2624222f0685ae580801d6f1abeab20923814693" - integrity sha512-UA/8dgLy3+ZiwJjAZHxL4MUB14fFQPkaAOZ94jsTW/Z6WmoOeny2+cLk0+dyIX/iH6qSrEWKwbStEeB970B9pA== +"@azure/msal-browser@^2.16.0": + version "2.17.0" + resolved "https://registry.yarnpkg.com/@azure/msal-browser/-/msal-browser-2.17.0.tgz#beb7d91e6123534b42c0d2ce85eda42a136a8555" + integrity sha512-NDK0NfsiRkjUU4V4jTt++aUPVg3JnRF4zV3B6WEOXDMH3OCbSJyqdO1WhdUWgMNQZz6Dk9bO/c6Bf4vUEgg+WA== dependencies: - "@azure/ms-rest-azure-env" "^2.0.0" - "@azure/ms-rest-js" "^2.0.4" - adal-node "^0.2.2" + "@azure/msal-common" "^5.0.0" -"@azure/msal-browser@^2.26.0": - version "2.38.1" - resolved "https://registry.yarnpkg.com/@azure/msal-browser/-/msal-browser-2.38.1.tgz#4bdc2c4820dedd569c2a203e0167815a541c04fa" - integrity sha512-NROo7mLpw7aWtj8tWy9ZPz3WWiudwVAOIDZ1K3PPrjDAA4kFYayWlbZiJl1T1sD5Oqwa6FOtwzFSvuUj1CWp6Q== +"@azure/msal-common@^4.5.1": + version "4.5.1" + resolved "https://registry.yarnpkg.com/@azure/msal-common/-/msal-common-4.5.1.tgz#f35af8b634ae24aebd0906deb237c0db1afa5826" + integrity sha512-/i5dXM+QAtO+6atYd5oHGBAx48EGSISkXNXViheliOQe+SIFMDo3gSq3lL54W0suOSAsVPws3XnTaIHlla0PIQ== dependencies: - "@azure/msal-common" "13.2.1" - -"@azure/msal-common@13.2.1": - version "13.2.1" - resolved "https://registry.yarnpkg.com/@azure/msal-common/-/msal-common-13.2.1.tgz#64f2c42d35df1c6ee0ea9ac03ba127482dd8692c" - integrity sha512-9CtyVdDtAOw+raemKg8gdBuE7gleObgSb7p4bzMIlUt8eM69/Gaow7uqr1gK3jLYINSrss32OZW8mBbdgVLiHg== + debug "^4.1.1" -"@azure/msal-common@^7.0.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@azure/msal-common/-/msal-common-7.6.0.tgz#b52e97ef540275f72611cff57937dfa0b34cdcca" - integrity sha512-XqfbglUTVLdkHQ8F9UQJtKseRr3sSnr9ysboxtoswvaMVaEfvyLtMoHv9XdKUfOc0qKGzNgRFd9yRjIWVepl6Q== +"@azure/msal-common@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@azure/msal-common/-/msal-common-5.0.0.tgz#4e927b9bdc3715e0b043ece01360c73739ef52c1" + integrity sha512-b3QXfW0BlGZs3mQ59rkVGcArzeMGd1RjHxyRez5bCB1F/F3jRmn2nY9jGamrILPBFz7weGpJiouW1VmDmAuk7Q== + dependencies: + debug "^4.1.1" -"@azure/msal-node@^1.10.0": - version "1.18.1" - resolved "https://registry.yarnpkg.com/@azure/msal-node/-/msal-node-1.18.1.tgz#e301364f9ab74278617e87f0e08d6a334ae13886" - integrity sha512-B4kUOWJoN4vD8b3pGJ9Q9mIZhaDb8EnQM1aN0x1otlQgTfzDvEk6rWc6fy8uGdtXqcNddBtiXdc4oRiItroVkA== +"@azure/msal-node@^1.3.0": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@azure/msal-node/-/msal-node-1.3.1.tgz#55c8915c9bc5222dbe152ffd67f9357b83461fde" + integrity sha512-c3bSdXUBpjUehx7mdI5iY+mwMF1mTz1qrVppH5LTD3SfbousRaFN9F2phAeaejVnCzbKzFPl4TTHxOJbkBVXHA== dependencies: - "@azure/msal-common" "13.2.1" - jsonwebtoken "^9.0.0" + "@azure/msal-common" "^5.0.0" + axios "^0.21.1" + jsonwebtoken "^8.5.1" uuid "^8.3.0" "@azure/storage-blob@^12.15.0": @@ -2691,7 +2680,7 @@ acorn@^8.5.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== -adal-node@0.2.3, adal-node@^0.1.28, adal-node@^0.2.2: +adal-node@0.2.3, adal-node@^0.1.28: version "0.2.3" resolved "https://registry.yarnpkg.com/adal-node/-/adal-node-0.2.3.tgz#87ed3dbed344f6e114e36bf18fe1c4e7d3cc6069" integrity sha512-gMKr8RuYEYvsj7jyfCv/4BfKToQThz20SP71N3AtFn3ia3yAR8Qt2T3aVQhuJzunWs2b38ZsQV0qsZPdwZr7VQ== @@ -8354,7 +8343,7 @@ jsonschema@^1.4.0: resolved "https://registry.yarnpkg.com/jsonschema/-/jsonschema-1.4.0.tgz#1afa34c4bc22190d8e42271ec17ac8b3404f87b2" integrity sha512-/YgW6pRMr6M7C+4o8kS+B/2myEpHCrxO4PEWnqJNBFMjn7EWXqlQ4tGwL6xTHeRplwuZmcAncdvfOad1nT2yMw== -jsonwebtoken@9.0.0, jsonwebtoken@^9.0.0: +jsonwebtoken@9.0.0, jsonwebtoken@^8.5.1, jsonwebtoken@^9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz#d0faf9ba1cc3a56255fe49c0961a67e520c1926d" integrity sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw== @@ -10199,7 +10188,7 @@ onetime@^5.1.0: dependencies: mimic-fn "^2.1.0" -open@8.4.0: +open@8.4.0, open@^8.0.0: version "8.4.0" resolved "https://registry.yarnpkg.com/open/-/open-8.4.0.tgz#345321ae18f8138f82565a910fdc6b39e8c244f8" integrity sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q== @@ -10208,15 +10197,6 @@ open@8.4.0: is-docker "^2.1.1" is-wsl "^2.2.0" -open@^8.0.0: - version "8.4.2" - resolved "https://registry.yarnpkg.com/open/-/open-8.4.2.tgz#5b5ffe2a8f793dcd2aad73e550cb87b59cb084f9" - integrity sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ== - dependencies: - define-lazy-prop "^2.0.0" - is-docker "^2.1.1" - is-wsl "^2.2.0" - optionator@^0.8.1: version "0.8.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" From 4efa18cae831e560a44ce4ade00069ad57e30331 Mon Sep 17 00:00:00 2001 From: JhontSouth Date: Tue, 15 Aug 2023 08:03:51 -0500 Subject: [PATCH 3/7] fix unit tests --- tools/framework/suite-base.js | 38 +++++++++++++++++++++++++++++++++-- tools/package.json | 1 + yarn.lock | 5 +++++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/tools/framework/suite-base.js b/tools/framework/suite-base.js index 76318f2de2..4e1060a4e8 100644 --- a/tools/framework/suite-base.js +++ b/tools/framework/suite-base.js @@ -24,6 +24,7 @@ var util = require('util'); var uuid = require('uuid'); var msRest = require('ms-rest'); var identity = require("@azure/identity"); +var {Environment} = require("@azure/ms-rest-azure-env") var MicrosoftAppCredentials = require('botframework-connector/lib/auth/microsoftAppCredentials'); var TokenApiClient = require('botframework-connector/lib/tokenApi/tokenApiClient'); var FileTokenCache = require('../util/fileTokenCache'); @@ -128,7 +129,22 @@ _.extend(SuiteBase.prototype, { * @returns {@azure/identity.UsernamePasswordCredential} The user token credentials object. */ _createUserCredentials: function() { - return new identity.UsernamePasswordCredential(this.tenantId, this.clientId, this.username); + if(process.env['AZURE_ENVIRONMENT'] && process.env['AZURE_ENVIRONMENT'].toUpperCase() === 'DOGFOOD') { + var df = { + name: 'Dogfood', + portalUrl: 'https://windows.azure-test.net/', + activeDirectoryEndpointUrl: 'https://login.windows-ppe.net/', + activeDirectoryResourceId: 'https://management.core.windows.net/', + managementEndpointUrl: 'https://management-preview.core.windows-int.net/', + resourceManagerEndpointUrl: 'https://api-dogfood.resources.windows-int.net/' + }; + var env = Environment.add(df); + return new identity.UsernamePasswordCredential(this.tenantId, this.clientId, this.username, + this.password, { 'tokenCache': this.tokenCache, 'environment': env }); + } + + return new identity.UsernamePasswordCredential(this.tenantId, this.clientId, this.username, + this.password, { 'tokenCache': this.tokenCache }); }, /** @@ -137,7 +153,25 @@ _.extend(SuiteBase.prototype, { * @returns {@azure/identity.ClientSecretCredential} The application token credentials object. */ _createApplicationCredentials: function() { - return new identity.ClientSecretCredential(this.tenantId, this.clientId, this.secret); + if(process.env['AZURE_ENVIRONMENT'] && process.env['AZURE_ENVIRONMENT'].toUpperCase() === 'DOGFOOD') { + var df = { + name: 'Dogfood', + portalUrl: 'https://windows.azure-test.net/', + activeDirectoryEndpointUrl: 'https://login.windows-ppe.net/', + activeDirectoryResourceId: 'https://management.core.windows.net/', + managementEndpointUrl: 'https://management-preview.core.windows-int.net/', + resourceManagerEndpointUrl: 'https://api-dogfood.resources.windows-int.net/' + }; + var env = Environment.add(df); + return new identity.ClientSecretCredential(this.tenantId, this.clientId, this.secret, { + 'tokenCache': this.tokenCache, + 'environment': env + }); + } + + return new identity.ClientSecretCredential(this.tenantId, this.clientId, this.secret, { + 'tokenCache': this.tokenCache + }); }, /** diff --git a/tools/package.json b/tools/package.json index 519ada8c02..de5542c269 100644 --- a/tools/package.json +++ b/tools/package.json @@ -30,6 +30,7 @@ "license": "(MIT OR Apache-2.0)", "dependencies": { "@azure/identity": "^2.0.4", + "@azure/ms-rest-azure-env":"^2.0.0", "@types/request": "^2.47.1", "botframework-connector": "4.1.6", "dotenv": "^4.0.0", diff --git a/yarn.lock b/yarn.lock index a4ff88bf35..09bc110e34 100644 --- a/yarn.lock +++ b/yarn.lock @@ -209,6 +209,11 @@ dependencies: tslib "^2.0.0" +"@azure/ms-rest-azure-env@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@azure/ms-rest-azure-env/-/ms-rest-azure-env-2.0.0.tgz#45809f89763a480924e21d3c620cd40866771625" + integrity sha512-dG76W7ElfLi+fbTjnZVGj+M9e0BIEJmRxU6fHaUQ12bZBe8EJKYb2GV50YWNaP2uJiVQ5+7nXEVj1VN1UQtaEw== + "@azure/ms-rest-js@^1.6.0", "@azure/ms-rest-js@^2.7.0": version "2.7.0" resolved "https://registry.yarnpkg.com/@azure/ms-rest-js/-/ms-rest-js-2.7.0.tgz#8639065577ffdf4946951e1d246334ebfd72d537" From 357a2c0b2f0ff70af7dd7008461d7dea118d3907 Mon Sep 17 00:00:00 2001 From: JhontSouth Date: Tue, 15 Aug 2023 12:57:19 -0500 Subject: [PATCH 4/7] replace ms-rest with @azure/ms-rest-js --- tools/framework/suite-base.js | 2 +- .../resource/models/HttpOperationResponse.js | 37 +++++++++++++++++++ .../lib/resource/models/index.js | 1 + .../operations/deploymentOperations.js | 8 ++-- .../lib/resource/operations/deployments.js | 28 +++++++------- 5 files changed, 57 insertions(+), 19 deletions(-) create mode 100644 tools/resourceManagement/lib/resource/models/HttpOperationResponse.js diff --git a/tools/framework/suite-base.js b/tools/framework/suite-base.js index 4e1060a4e8..5d46aed4fb 100644 --- a/tools/framework/suite-base.js +++ b/tools/framework/suite-base.js @@ -22,7 +22,7 @@ var sinon = require('sinon'); var _ = require('underscore'); var util = require('util'); var uuid = require('uuid'); -var msRest = require('ms-rest'); +var msRest = require('@azure/ms-rest-js'); var identity = require("@azure/identity"); var {Environment} = require("@azure/ms-rest-azure-env") var MicrosoftAppCredentials = require('botframework-connector/lib/auth/microsoftAppCredentials'); diff --git a/tools/resourceManagement/lib/resource/models/HttpOperationResponse.js b/tools/resourceManagement/lib/resource/models/HttpOperationResponse.js new file mode 100644 index 0000000000..466aec4973 --- /dev/null +++ b/tools/resourceManagement/lib/resource/models/HttpOperationResponse.js @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +'use strict'; + +/** + * Wrapper object for http request and response. Deserialized object is stored in + * the `body` property. + * @class + * Initializes a new instance of the HttpOperationResponse class. + * @constructor + */ +class HttpOperationResponse { + constructor(request, response) { + /** + * Reference to the original request object. + * [WebResource] object. + * @type {object} + */ + this.request = request; + + /** + * Reference to the original response object. + * [ServerResponse] object. + * @type {object} + */ + this.response = response; + + /** + * The response object. + * @type {object} + */ + this.body = null; + } +} + +module.exports = HttpOperationResponse; diff --git a/tools/resourceManagement/lib/resource/models/index.js b/tools/resourceManagement/lib/resource/models/index.js index bd292d0bf8..3a6e6880e5 100644 --- a/tools/resourceManagement/lib/resource/models/index.js +++ b/tools/resourceManagement/lib/resource/models/index.js @@ -61,3 +61,4 @@ exports.ResourceListResult = require('./resourceListResult'); exports.ResourceGroupListResult = require('./resourceGroupListResult'); exports.TagsListResult = require('./tagsListResult'); exports.DeploymentOperationsListResult = require('./deploymentOperationsListResult'); +exports.HttpOperationResponse = require("./HttpOperationResponse"); diff --git a/tools/resourceManagement/lib/resource/operations/deploymentOperations.js b/tools/resourceManagement/lib/resource/operations/deploymentOperations.js index e5a2c637fb..25224f40d2 100644 --- a/tools/resourceManagement/lib/resource/operations/deploymentOperations.js +++ b/tools/resourceManagement/lib/resource/operations/deploymentOperations.js @@ -10,7 +10,7 @@ 'use strict'; -const msRest = require('ms-rest'); +const msRest = require('@azure/ms-rest-js'); const uuid = require('uuid'); const WebResource = msRest.WebResource; @@ -546,7 +546,7 @@ class DeploymentOperations { let self = this; return new Promise((resolve, reject) => { self._get(resourceGroupName, deploymentName, operationId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -639,7 +639,7 @@ class DeploymentOperations { let self = this; return new Promise((resolve, reject) => { self._list(resourceGroupName, deploymentName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -729,7 +729,7 @@ class DeploymentOperations { let self = this; return new Promise((resolve, reject) => { self._listNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } diff --git a/tools/resourceManagement/lib/resource/operations/deployments.js b/tools/resourceManagement/lib/resource/operations/deployments.js index 270b838671..d3547639ea 100644 --- a/tools/resourceManagement/lib/resource/operations/deployments.js +++ b/tools/resourceManagement/lib/resource/operations/deployments.js @@ -10,7 +10,7 @@ 'use strict'; -const msRest = require('ms-rest'); +const msRest = require('@azure/ms-rest-js'); const uuid = require('uuid'); const WebResource = msRest.WebResource; @@ -67,7 +67,7 @@ function _deleteMethod(resourceGroupName, deploymentName, options, callback) { this.beginDeleteMethod(resourceGroupName, deploymentName, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); - let initialResult = new msRest.HttpOperationResponse(); + let initialResult = new client.models['HttpOperationResponse'](); initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; @@ -351,7 +351,7 @@ function _createOrUpdate(resourceGroupName, deploymentName, parameters, options, this.beginCreateOrUpdate(resourceGroupName, deploymentName, parameters, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); - let initialResult = new msRest.HttpOperationResponse(); + let initialResult = new client.models['HttpOperationResponse'](); initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; @@ -1960,7 +1960,7 @@ class Deployments { let self = this; return new Promise((resolve, reject) => { self._deleteMethod(resourceGroupName, deploymentName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -2058,7 +2058,7 @@ class Deployments { let self = this; return new Promise((resolve, reject) => { self._checkExistence(resourceGroupName, deploymentName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -2207,7 +2207,7 @@ class Deployments { let self = this; return new Promise((resolve, reject) => { self._createOrUpdate(resourceGroupName, deploymentName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -2357,7 +2357,7 @@ class Deployments { let self = this; return new Promise((resolve, reject) => { self._get(resourceGroupName, deploymentName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -2450,7 +2450,7 @@ class Deployments { let self = this; return new Promise((resolve, reject) => { self._cancel(resourceGroupName, deploymentName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -2601,7 +2601,7 @@ class Deployments { let self = this; return new Promise((resolve, reject) => { self._validate(resourceGroupName, deploymentName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -2750,7 +2750,7 @@ class Deployments { let self = this; return new Promise((resolve, reject) => { self._exportTemplate(resourceGroupName, deploymentName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -2844,7 +2844,7 @@ class Deployments { let self = this; return new Promise((resolve, reject) => { self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -2947,7 +2947,7 @@ class Deployments { let self = this; return new Promise((resolve, reject) => { self._beginDeleteMethod(resourceGroupName, deploymentName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -3107,7 +3107,7 @@ class Deployments { let self = this; return new Promise((resolve, reject) => { self._beginCreateOrUpdate(resourceGroupName, deploymentName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -3255,7 +3255,7 @@ class Deployments { let self = this; return new Promise((resolve, reject) => { self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } From 0a3643fbc30e47c6059fcfe49a7a1dd68f49a2e0 Mon Sep 17 00:00:00 2001 From: JhontSouth Date: Wed, 16 Aug 2023 11:06:37 -0500 Subject: [PATCH 5/7] replace ms-rest uses --- tools/package.json | 1 - .../lib/resource/operations/providers.js | 12 +- .../lib/resource/operations/resourceGroups.js | 22 +-- .../lib/resource/operations/resources.js | 54 +++---- .../lib/resource/operations/tags.js | 14 +- .../lib/resource/resourceManagementClient.js | 11 +- tools/resourceManagement/package.json | 3 - yarn.lock | 149 ++---------------- 8 files changed, 73 insertions(+), 193 deletions(-) diff --git a/tools/package.json b/tools/package.json index de5542c269..6c152a12c1 100644 --- a/tools/package.json +++ b/tools/package.json @@ -35,7 +35,6 @@ "botframework-connector": "4.1.6", "dotenv": "^4.0.0", "mime": "^1.4.1", - "ms-rest": "^2.3.6", "underscore": "^1.13.1", "uuid": "^3.3.2" }, diff --git a/tools/resourceManagement/lib/resource/operations/providers.js b/tools/resourceManagement/lib/resource/operations/providers.js index 10c0b8f9ec..253b915471 100644 --- a/tools/resourceManagement/lib/resource/operations/providers.js +++ b/tools/resourceManagement/lib/resource/operations/providers.js @@ -10,7 +10,7 @@ 'use strict'; -const msRest = require('ms-rest'); +const msRest = require('@azure/ms-rest-js'); const uuid = require('uuid'); const WebResource = msRest.WebResource; @@ -763,7 +763,7 @@ class Providers { let self = this; return new Promise((resolve, reject) => { self._unregister(resourceProviderNamespace, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -847,7 +847,7 @@ class Providers { let self = this; return new Promise((resolve, reject) => { self._register(resourceProviderNamespace, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -936,7 +936,7 @@ class Providers { let self = this; return new Promise((resolve, reject) => { self._list(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -1028,7 +1028,7 @@ class Providers { let self = this; return new Promise((resolve, reject) => { self._get(resourceProviderNamespace, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -1115,7 +1115,7 @@ class Providers { let self = this; return new Promise((resolve, reject) => { self._listNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } diff --git a/tools/resourceManagement/lib/resource/operations/resourceGroups.js b/tools/resourceManagement/lib/resource/operations/resourceGroups.js index 4f7248e29e..2923c7e597 100644 --- a/tools/resourceManagement/lib/resource/operations/resourceGroups.js +++ b/tools/resourceManagement/lib/resource/operations/resourceGroups.js @@ -10,7 +10,7 @@ 'use strict'; -const msRest = require('ms-rest'); +const msRest = require('@azure/ms-rest-js'); const uuid = require('uuid'); const WebResource = msRest.WebResource; @@ -399,7 +399,7 @@ function _deleteMethod(resourceGroupName, options, callback) { this.beginDeleteMethod(resourceGroupName, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); - let initialResult = new msRest.HttpOperationResponse(); + let initialResult = new client.models['HttpOperationResponse'](); initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; @@ -1405,7 +1405,7 @@ class ResourceGroups { let self = this; return new Promise((resolve, reject) => { self._checkExistence(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -1504,7 +1504,7 @@ class ResourceGroups { let self = this; return new Promise((resolve, reject) => { self._createOrUpdate(resourceGroupName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -1608,7 +1608,7 @@ class ResourceGroups { let self = this; return new Promise((resolve, reject) => { self._deleteMethod(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -1695,7 +1695,7 @@ class ResourceGroups { let self = this; return new Promise((resolve, reject) => { self._get(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -1794,7 +1794,7 @@ class ResourceGroups { let self = this; return new Promise((resolve, reject) => { self._update(resourceGroupName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -1903,7 +1903,7 @@ class ResourceGroups { let self = this; return new Promise((resolve, reject) => { self._exportTemplate(resourceGroupName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -2000,7 +2000,7 @@ class ResourceGroups { let self = this; return new Promise((resolve, reject) => { self._list(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -2091,7 +2091,7 @@ class ResourceGroups { let self = this; return new Promise((resolve, reject) => { self._beginDeleteMethod(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -2178,7 +2178,7 @@ class ResourceGroups { let self = this; return new Promise((resolve, reject) => { self._listNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } diff --git a/tools/resourceManagement/lib/resource/operations/resources.js b/tools/resourceManagement/lib/resource/operations/resources.js index 7b85d2a5d8..7f3c1b7f07 100644 --- a/tools/resourceManagement/lib/resource/operations/resources.js +++ b/tools/resourceManagement/lib/resource/operations/resources.js @@ -11,7 +11,7 @@ 'use strict'; const uuid = require('uuid'); -const msRest = require('ms-rest'); +const msRest = require('@azure/ms-rest-js'); const WebResource = msRest.WebResource; @@ -249,7 +249,7 @@ function _moveResources(sourceResourceGroupName, parameters, options, callback) this.beginMoveResources(sourceResourceGroupName, parameters, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); - let initialResult = new msRest.HttpOperationResponse(); + let initialResult = new client.models['HttpOperationResponse'](); initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; @@ -326,7 +326,7 @@ function _validateMoveResources(sourceResourceGroupName, parameters, options, ca this.beginValidateMoveResources(sourceResourceGroupName, parameters, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); - let initialResult = new msRest.HttpOperationResponse(); + let initialResult = new client.models['HttpOperationResponse'](); initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; @@ -725,7 +725,7 @@ function _deleteMethod(resourceGroupName, resourceProviderNamespace, parentResou this.beginDeleteMethod(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); - let initialResult = new msRest.HttpOperationResponse(); + let initialResult = new client.models['HttpOperationResponse'](); initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; @@ -841,7 +841,7 @@ function _createOrUpdate(resourceGroupName, resourceProviderNamespace, parentRes this.beginCreateOrUpdate(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); - let initialResult = new msRest.HttpOperationResponse(); + let initialResult = new client.models['HttpOperationResponse'](); initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; @@ -1223,7 +1223,7 @@ function _deleteById(resourceId, apiVersion, options, callback) { this.beginDeleteById(resourceId, apiVersion, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); - let initialResult = new msRest.HttpOperationResponse(); + let initialResult = new client.models['HttpOperationResponse'](); initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; @@ -1331,7 +1331,7 @@ function _createOrUpdateById(resourceId, apiVersion, parameters, options, callba this.beginCreateOrUpdateById(resourceId, apiVersion, parameters, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); - let initialResult = new msRest.HttpOperationResponse(); + let initialResult = new client.models['HttpOperationResponse'](); initialResult.request = httpRequest; initialResult.response = response; initialResult.body = response.body; @@ -2908,7 +2908,7 @@ class Resources { let self = this; return new Promise((resolve, reject) => { self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -3011,7 +3011,7 @@ class Resources { let self = this; return new Promise((resolve, reject) => { self._moveResources(sourceResourceGroupName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -3121,7 +3121,7 @@ class Resources { let self = this; return new Promise((resolve, reject) => { self._validateMoveResources(sourceResourceGroupName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -3223,7 +3223,7 @@ class Resources { let self = this; return new Promise((resolve, reject) => { self._list(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -3323,7 +3323,7 @@ class Resources { let self = this; return new Promise((resolve, reject) => { self._checkExistence(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -3429,7 +3429,7 @@ class Resources { let self = this; return new Promise((resolve, reject) => { self._deleteMethod(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -3576,7 +3576,7 @@ class Resources { let self = this; return new Promise((resolve, reject) => { self._createOrUpdate(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -3724,7 +3724,7 @@ class Resources { let self = this; return new Promise((resolve, reject) => { self._get(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -3822,7 +3822,7 @@ class Resources { let self = this; return new Promise((resolve, reject) => { self._checkExistenceById(resourceId, apiVersion, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -3911,7 +3911,7 @@ class Resources { let self = this; return new Promise((resolve, reject) => { self._deleteById(resourceId, apiVersion, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -4042,7 +4042,7 @@ class Resources { let self = this; return new Promise((resolve, reject) => { self._createOrUpdateById(resourceId, apiVersion, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -4174,7 +4174,7 @@ class Resources { let self = this; return new Promise((resolve, reject) => { self._getById(resourceId, apiVersion, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -4273,7 +4273,7 @@ class Resources { let self = this; return new Promise((resolve, reject) => { self._beginMoveResources(sourceResourceGroupName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -4383,7 +4383,7 @@ class Resources { let self = this; return new Promise((resolve, reject) => { self._beginValidateMoveResources(sourceResourceGroupName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -4492,7 +4492,7 @@ class Resources { let self = this; return new Promise((resolve, reject) => { self._beginDeleteMethod(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -4639,7 +4639,7 @@ class Resources { let self = this; return new Promise((resolve, reject) => { self._beginCreateOrUpdate(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -4779,7 +4779,7 @@ class Resources { let self = this; return new Promise((resolve, reject) => { self._beginDeleteById(resourceId, apiVersion, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -4910,7 +4910,7 @@ class Resources { let self = this; return new Promise((resolve, reject) => { self._beginCreateOrUpdateById(resourceId, apiVersion, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -5039,7 +5039,7 @@ class Resources { let self = this; return new Promise((resolve, reject) => { self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -5123,7 +5123,7 @@ class Resources { let self = this; return new Promise((resolve, reject) => { self._listNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } diff --git a/tools/resourceManagement/lib/resource/operations/tags.js b/tools/resourceManagement/lib/resource/operations/tags.js index 46b3d53fcb..e1e0c57402 100644 --- a/tools/resourceManagement/lib/resource/operations/tags.js +++ b/tools/resourceManagement/lib/resource/operations/tags.js @@ -10,7 +10,7 @@ 'use strict'; -const msRest = require('ms-rest'); +const msRest = require('@azure/ms-rest-js'); const uuid = require('uuid'); const WebResource = msRest.WebResource; @@ -887,7 +887,7 @@ class Tags { let self = this; return new Promise((resolve, reject) => { self._deleteValue(tagName, tagValue, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -972,7 +972,7 @@ class Tags { let self = this; return new Promise((resolve, reject) => { self._createOrUpdateValue(tagName, tagValue, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -1060,7 +1060,7 @@ class Tags { let self = this; return new Promise((resolve, reject) => { self._createOrUpdate(tagName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -1148,7 +1148,7 @@ class Tags { let self = this; return new Promise((resolve, reject) => { self._deleteMethod(tagName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -1230,7 +1230,7 @@ class Tags { let self = this; return new Promise((resolve, reject) => { self._list(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } @@ -1313,7 +1313,7 @@ class Tags { let self = this; return new Promise((resolve, reject) => { self._listNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + let httpOperationResponse = new client.models['HttpOperationResponse'](request, response); httpOperationResponse.body = result; if (err) { reject(err); } else { resolve(httpOperationResponse); } diff --git a/tools/resourceManagement/lib/resource/resourceManagementClient.js b/tools/resourceManagement/lib/resource/resourceManagementClient.js index c39aabef91..159f378545 100644 --- a/tools/resourceManagement/lib/resource/resourceManagementClient.js +++ b/tools/resourceManagement/lib/resource/resourceManagementClient.js @@ -14,7 +14,7 @@ 'use strict'; -const msRest = require('ms-rest'); +const msRest = require('@azure/ms-rest-js'); const fs = require('fs'); const path = require('path'); const ServiceClient = msRest.ServiceClient; @@ -83,9 +83,16 @@ class ResourceManagementClient extends ServiceClient { this.tags = new operations.Tags(this); this.deploymentOperations = new operations.DeploymentOperations(this); this.models = models; - msRest.addSerializationMixin(this); + this.addSerializationMixin(this); } + addSerializationMixin(destObject) { + ['serialize', 'serializeObject', 'deserialize'].forEach((property) => { + destObject[property] = serialization[property]; + }); + }; + + addUserAgentInfo(additionalUserAgentInfo) { if (this.userAgentInfo.value.indexOf(additionalUserAgentInfo) === -1) { this.userAgentInfo.value.push(additionalUserAgentInfo); diff --git a/tools/resourceManagement/package.json b/tools/resourceManagement/package.json index eb98438b53..e7e3744279 100644 --- a/tools/resourceManagement/package.json +++ b/tools/resourceManagement/package.json @@ -19,9 +19,6 @@ "main": "./lib/resource.js", "types": "./lib/resource.d.ts", "license": "MIT", - "dependencies": { - "ms-rest": "^2.0.0" - }, "homepage": "http://github.com/Azure/azure-sdk-for-node", "repository": { "type": "git", diff --git a/yarn.lock b/yarn.lock index 09bc110e34..5f78d41006 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2738,7 +2738,7 @@ ajv-keywords@^3.1.0, ajv-keywords@^3.4.1, ajv-keywords@^3.5.2: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== -ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5, ajv@~6.12.6: +ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.4, ajv@^6.12.5, ajv@~6.12.6: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -3173,16 +3173,6 @@ available-typed-arrays@^1.0.0, available-typed-arrays@^1.0.2: dependencies: array-filter "^1.0.0" -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= - -aws4@^1.8.0: - version "1.10.1" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.10.1.tgz#e1e82e4f3e999e2cfd61b161280d16a111f86428" - integrity sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA== - axe-core@^4.7.2: version "4.7.2" resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.7.2.tgz#040a7342b20765cb18bb50b628394c21bccc17a0" @@ -3886,11 +3876,6 @@ cardinal@^2.1.1: ansicolors "~0.3.2" redeyed "~2.1.0" -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= - chai-nightwatch@0.5.3: version "0.5.3" resolved "https://registry.yarnpkg.com/chai-nightwatch/-/chai-nightwatch-0.5.3.tgz#980ecf63dde5a04e7f3524370682c7ff01178ffb" @@ -4329,7 +4314,7 @@ combine-source-map@^0.8.0, combine-source-map@~0.8.0: lodash.memoize "~3.0.3" source-map "~0.5.3" -combined-stream@^1.0.5, combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: +combined-stream@^1.0.5, combined-stream@^1.0.6, combined-stream@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== @@ -5243,7 +5228,7 @@ duplexer3@^0.1.4: resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= -duplexer@^0.1.1, duplexer@~0.1.1: +duplexer@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== @@ -5984,7 +5969,7 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@^3.0.0, extend@~3.0.2: +extend@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== @@ -6357,11 +6342,6 @@ foreground-child@^2.0.0: cross-spawn "^7.0.0" signal-exit "^3.0.2" -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= - form-data@1.0.0-rc4: version "1.0.0-rc4" resolved "https://registry.yarnpkg.com/form-data/-/form-data-1.0.0-rc4.tgz#05ac6bc22227b43e4461f488161554699d4f8b5e" @@ -6398,15 +6378,6 @@ form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - formatio@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/formatio/-/formatio-1.2.0.tgz#f3b2167d9068c4698a8d51f4f760a39a54d818eb" @@ -7092,19 +7063,6 @@ handlebars@^4.7.6: optionalDependencies: uglify-js "^3.1.4" -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= - -har-validator@~5.1.3: - version "5.1.5" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" - integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== - dependencies: - ajv "^6.12.3" - har-schema "^2.0.0" - has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" @@ -7394,15 +7352,6 @@ http-signature@^1.2.0: jsprim "^1.2.2" sshpk "^1.14.1" -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - https-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" @@ -7691,7 +7640,7 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" -is-buffer@^1.1.0, is-buffer@^1.1.5, is-buffer@^1.1.6, is-buffer@~1.1.6: +is-buffer@^1.1.0, is-buffer@^1.1.5, is-buffer@~1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== @@ -7963,7 +7912,7 @@ is-typed-array@^1.1.3: foreach "^2.0.5" has-symbols "^1.0.1" -is-typedarray@^1.0.0, is-typedarray@~1.0.0: +is-typedarray@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= @@ -8048,11 +7997,6 @@ isobject@^3.0.0, isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= - istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.0.0-alpha.1: version "3.0.0" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz#f5944a37c70b550b02a78a5c3b2055b280cec8ec" @@ -8303,7 +8247,7 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= -json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: +json-stringify-safe@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= @@ -9143,7 +9087,7 @@ mime-db@1.52.0: resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@^2.1.10, mime-types@^2.1.12, mime-types@^2.1.18, mime-types@~2.1.19, mime-types@~2.1.24: +mime-types@^2.1.10, mime-types@^2.1.12, mime-types@^2.1.18, mime-types@~2.1.24: version "2.1.27" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== @@ -9522,7 +9466,7 @@ mold-source-map@~0.4.0: convert-source-map "^1.1.0" through "~2.2.7" -moment@^2.19.3, moment@^2.21.0: +moment@^2.19.3: version "2.29.4" resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108" integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w== @@ -9539,20 +9483,6 @@ move-concurrently@^1.0.1: rimraf "^2.5.4" run-queue "^1.0.3" -ms-rest@^2.3.6: - version "2.5.4" - resolved "https://registry.yarnpkg.com/ms-rest/-/ms-rest-2.5.4.tgz#57b42299cf302e45d5e1a734220bf7d4a110167a" - integrity sha512-VeqCbawxRM6nhw0RKNfj7TWL7SL8PB6MypqwgylXCi+u412uvYoyY/kSmO8n06wyd8nIcnTbYToCmSKFMI1mCg== - dependencies: - duplexer "^0.1.1" - is-buffer "^1.1.6" - is-stream "^1.1.0" - moment "^2.21.0" - request "^2.88.0" - through "^2.3.8" - tunnel "0.0.5" - uuid "^3.2.1" - ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -10036,11 +9966,6 @@ nyc@^15.1.0: test-exclude "^6.0.0" yargs "^15.0.2" -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - object-assign@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2" @@ -10617,11 +10542,6 @@ pend@~1.2.0: resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA= -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= - picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1: version "2.2.2" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" @@ -10949,11 +10869,6 @@ qs@6.9.7: resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.7.tgz#4610846871485e1e048f44ae3b94033f0e675afe" integrity sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw== -qs@~6.5.2: - version "6.5.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" - integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== - query-ast@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/query-ast/-/query-ast-1.0.3.tgz#4a18374950fa80cbf9b03d7b945bbac8bb4250bf" @@ -11318,32 +11233,6 @@ replace-in-file@^4.1.0: glob "^7.1.6" yargs "^15.0.2" -request@^2.88.0: - version "2.88.2" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" - integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -12274,7 +12163,7 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= -sshpk@^1.14.1, sshpk@^1.7.0: +sshpk@^1.14.1: version "1.16.1" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== @@ -12894,7 +12783,7 @@ through2@^3.0.1: inherits "^2.0.4" readable-stream "2 || 3" -through@2, "through@>=2.2.7 <3", through@^2.3.7, through@^2.3.8, through@~2.3.4: +through@2, "through@>=2.2.7 <3", through@^2.3.7, through@~2.3.4: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= @@ -13016,7 +12905,7 @@ toidentifier@1.0.1: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== -tough-cookie@^4.0.0, tough-cookie@^4.1.3, tough-cookie@~2.5.0: +tough-cookie@^4.0.0, tough-cookie@^4.1.3: version "4.1.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.3.tgz#97b9adb0728b42280aa3d814b6b999b2ff0318bf" integrity sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw== @@ -13156,18 +13045,6 @@ tty-browserify@0.0.1: resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811" integrity sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw== -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= - dependencies: - safe-buffer "^5.0.1" - -tunnel@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.5.tgz#d1532254749ed36620fcd1010865495a1fa9d0ae" - integrity sha512-gj5sdqherx4VZKMcBA4vewER7zdK25Td+z1npBqpbDys4eJrLx+SlYjJvq1bDXs2irkuJM5pf8ktaEQVipkrbA== - tunnel@0.0.6, tunnel@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c" @@ -13603,7 +13480,7 @@ uuid@8.3.2, uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -uuid@^3.1.0, uuid@^3.2.1, uuid@^3.3.2, uuid@^3.3.3: +uuid@^3.1.0, uuid@^3.3.2, uuid@^3.3.3: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== From 68bbe7c91054e18512157cc696f55c38ee4b53b0 Mon Sep 17 00:00:00 2001 From: JhontSouth Date: Wed, 16 Aug 2023 11:46:11 -0500 Subject: [PATCH 6/7] include serializer class --- .../resourceManagement/lib/resource/resourceManagementClient.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/resourceManagement/lib/resource/resourceManagementClient.js b/tools/resourceManagement/lib/resource/resourceManagementClient.js index 159f378545..b70efba070 100644 --- a/tools/resourceManagement/lib/resource/resourceManagementClient.js +++ b/tools/resourceManagement/lib/resource/resourceManagementClient.js @@ -88,7 +88,7 @@ class ResourceManagementClient extends ServiceClient { addSerializationMixin(destObject) { ['serialize', 'serializeObject', 'deserialize'].forEach((property) => { - destObject[property] = serialization[property]; + destObject[property] = msRest.Serializer[property]; }); }; From 1304bcb2305608bad911ee676a5b65f3c04f811d Mon Sep 17 00:00:00 2001 From: JhontSouth Date: Thu, 17 Aug 2023 09:38:35 -0500 Subject: [PATCH 7/7] remove useless files --- .../lib/resource/operations/index.d.ts | 4385 ----------------- .../resource/resourceManagementClient.d.ts | 66 - 2 files changed, 4451 deletions(-) delete mode 100644 tools/resourceManagement/lib/resource/operations/index.d.ts delete mode 100644 tools/resourceManagement/lib/resource/resourceManagementClient.d.ts diff --git a/tools/resourceManagement/lib/resource/operations/index.d.ts b/tools/resourceManagement/lib/resource/operations/index.d.ts deleted file mode 100644 index bf819b72cc..0000000000 --- a/tools/resourceManagement/lib/resource/operations/index.d.ts +++ /dev/null @@ -1,4385 +0,0 @@ -/* - * 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. -*/ - -import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationResponse } from 'ms-rest'; -import * as models from '../models'; - - -/** - * @class - * Deployments - * __NOTE__: An instance of this class is automatically created for an - * instance of the ResourceManagementClient. - */ -export interface Deployments { - - - /** - * @summary Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting - * a template deployment removes the associated deployment operations. Deleting - * a template deployment does not affect the state of the resource group. This - * is an asynchronous operation that returns a status of 202 until the template - * deployment is successfully deleted. The Location response header contains - * the URI that is used to obtain the status of the process. While the process - * is running, a call to the URI in the Location header returns a status of - * 202. When the process finishes, the URI in the Location header returns a - * status of 204 on success. If the asynchronous request failed, the URI in the - * Location header returns an error-level status code. - * - * @param {string} resourceGroupName The name of the resource group with the - * deployment to delete. The name is case insensitive. - * - * @param {string} deploymentName The name of the deployment to delete. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting - * a template deployment removes the associated deployment operations. Deleting - * a template deployment does not affect the state of the resource group. This - * is an asynchronous operation that returns a status of 202 until the template - * deployment is successfully deleted. The Location response header contains - * the URI that is used to obtain the status of the process. While the process - * is running, a call to the URI in the Location header returns a status of - * 202. When the process finishes, the URI in the Location header returns a - * status of 204 on success. If the asynchronous request failed, the URI in the - * Location header returns an error-level status code. - * - * @param {string} resourceGroupName The name of the resource group with the - * deployment to delete. The name is case insensitive. - * - * @param {string} deploymentName The name of the deployment to delete. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, deploymentName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Checks whether the deployment exists. - * - * @param {string} resourceGroupName The name of the resource group with the - * deployment to check. The name is case insensitive. - * - * @param {string} deploymentName The name of the deployment to check. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - checkExistenceWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Checks whether the deployment exists. - * - * @param {string} resourceGroupName The name of the resource group with the - * deployment to check. The name is case insensitive. - * - * @param {string} deploymentName The name of the deployment to check. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {Boolean} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {Boolean} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - checkExistence(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - checkExistence(resourceGroupName: string, deploymentName: string, callback: ServiceCallback): void; - checkExistence(resourceGroupName: string, deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Deploys resources to a resource group. - * - * You can provide the template and parameters directly in the request or link - * to JSON files. - * - * @param {string} resourceGroupName The name of the resource group to deploy - * the resources to. The name is case insensitive. The resource group must - * already exist. - * - * @param {string} deploymentName The name of the deployment. - * - * @param {object} parameters Additional parameters supplied to the operation. - * - * @param {object} parameters.properties The deployment properties. - * - * @param {object} [parameters.properties.template] The template content. You - * use this element when you want to pass the template syntax directly in the - * request rather than link to an existing template. It can be a JObject or - * well-formed JSON string. Use either the templateLink property or the - * template property, but not both. - * - * @param {object} [parameters.properties.templateLink] The URI of the - * template. Use either the templateLink property or the template property, but - * not both. - * - * @param {string} parameters.properties.templateLink.uri The URI of the - * template to deploy. - * - * @param {string} [parameters.properties.templateLink.contentVersion] If - * included, must match the ContentVersion in the template. - * - * @param {object} [parameters.properties.parameters] Name and value pairs that - * define the deployment parameters for the template. You use this element when - * you want to provide the parameter values directly in the request rather than - * link to an existing parameter file. Use either the parametersLink property - * or the parameters property, but not both. It can be a JObject or a well - * formed JSON string. - * - * @param {object} [parameters.properties.parametersLink] The URI of parameters - * file. You use this element to link to an existing parameters file. Use - * either the parametersLink property or the parameters property, but not both. - * - * @param {string} parameters.properties.parametersLink.uri The URI of the - * parameters file. - * - * @param {string} [parameters.properties.parametersLink.contentVersion] If - * included, must match the ContentVersion in the template. - * - * @param {string} parameters.properties.mode The mode that is used to deploy - * resources. This value can be either Incremental or Complete. In Incremental - * mode, resources are deployed without deleting existing resources that are - * not included in the template. In Complete mode, resources are deployed and - * existing resources in the resource group that are not included in the - * template are deleted. Be careful when using Complete mode as you may - * unintentionally delete resources. Possible values include: 'Incremental', - * 'Complete' - * - * @param {object} [parameters.properties.debugSetting] The debug setting of - * the deployment. - * - * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies - * the type of information to log for debugging. The permitted values are none, - * requestContent, responseContent, or both requestContent and responseContent - * separated by a comma. The default is none. When setting this value, - * carefully consider the type of information you are passing in during - * deployment. By logging information about the request or response, you could - * potentially expose sensitive data that is retrieved through the deployment - * operations. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Deploys resources to a resource group. - * - * You can provide the template and parameters directly in the request or link - * to JSON files. - * - * @param {string} resourceGroupName The name of the resource group to deploy - * the resources to. The name is case insensitive. The resource group must - * already exist. - * - * @param {string} deploymentName The name of the deployment. - * - * @param {object} parameters Additional parameters supplied to the operation. - * - * @param {object} parameters.properties The deployment properties. - * - * @param {object} [parameters.properties.template] The template content. You - * use this element when you want to pass the template syntax directly in the - * request rather than link to an existing template. It can be a JObject or - * well-formed JSON string. Use either the templateLink property or the - * template property, but not both. - * - * @param {object} [parameters.properties.templateLink] The URI of the - * template. Use either the templateLink property or the template property, but - * not both. - * - * @param {string} parameters.properties.templateLink.uri The URI of the - * template to deploy. - * - * @param {string} [parameters.properties.templateLink.contentVersion] If - * included, must match the ContentVersion in the template. - * - * @param {object} [parameters.properties.parameters] Name and value pairs that - * define the deployment parameters for the template. You use this element when - * you want to provide the parameter values directly in the request rather than - * link to an existing parameter file. Use either the parametersLink property - * or the parameters property, but not both. It can be a JObject or a well - * formed JSON string. - * - * @param {object} [parameters.properties.parametersLink] The URI of parameters - * file. You use this element to link to an existing parameters file. Use - * either the parametersLink property or the parameters property, but not both. - * - * @param {string} parameters.properties.parametersLink.uri The URI of the - * parameters file. - * - * @param {string} [parameters.properties.parametersLink.contentVersion] If - * included, must match the ContentVersion in the template. - * - * @param {string} parameters.properties.mode The mode that is used to deploy - * resources. This value can be either Incremental or Complete. In Incremental - * mode, resources are deployed without deleting existing resources that are - * not included in the template. In Complete mode, resources are deployed and - * existing resources in the resource group that are not included in the - * template are deleted. Be careful when using Complete mode as you may - * unintentionally delete resources. Possible values include: 'Incremental', - * 'Complete' - * - * @param {object} [parameters.properties.debugSetting] The debug setting of - * the deployment. - * - * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies - * the type of information to log for debugging. The permitted values are none, - * requestContent, responseContent, or both requestContent and responseContent - * separated by a comma. The default is none. When setting this value, - * carefully consider the type of information you are passing in during - * deployment. By logging information about the request or response, you could - * potentially expose sensitive data that is retrieved through the deployment - * operations. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {DeploymentExtended} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {DeploymentExtended} [result] - The deserialized result object if an error did not occur. - * See {@link DeploymentExtended} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdate(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets a deployment. - * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. - * - * @param {string} deploymentName The name of the deployment to get. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a deployment. - * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. - * - * @param {string} deploymentName The name of the deployment to get. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {DeploymentExtended} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {DeploymentExtended} [result] - The deserialized result object if an error did not occur. - * See {@link DeploymentExtended} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - get(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, deploymentName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Cancels a currently running template deployment. - * - * You can cancel a deployment only if the provisioningState is Accepted or - * Running. After the deployment is canceled, the provisioningState is set to - * Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resource group partially deployed. - * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. - * - * @param {string} deploymentName The name of the deployment to cancel. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - cancelWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Cancels a currently running template deployment. - * - * You can cancel a deployment only if the provisioningState is Accepted or - * Running. After the deployment is canceled, the provisioningState is set to - * Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resource group partially deployed. - * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. - * - * @param {string} deploymentName The name of the deployment to cancel. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - cancel(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - cancel(resourceGroupName: string, deploymentName: string, callback: ServiceCallback): void; - cancel(resourceGroupName: string, deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Validates whether the specified template is syntactically correct and will - * be accepted by Azure Resource Manager.. - * - * @param {string} resourceGroupName The name of the resource group the - * template will be deployed to. The name is case insensitive. - * - * @param {string} deploymentName The name of the deployment. - * - * @param {object} parameters Parameters to validate. - * - * @param {object} parameters.properties The deployment properties. - * - * @param {object} [parameters.properties.template] The template content. You - * use this element when you want to pass the template syntax directly in the - * request rather than link to an existing template. It can be a JObject or - * well-formed JSON string. Use either the templateLink property or the - * template property, but not both. - * - * @param {object} [parameters.properties.templateLink] The URI of the - * template. Use either the templateLink property or the template property, but - * not both. - * - * @param {string} parameters.properties.templateLink.uri The URI of the - * template to deploy. - * - * @param {string} [parameters.properties.templateLink.contentVersion] If - * included, must match the ContentVersion in the template. - * - * @param {object} [parameters.properties.parameters] Name and value pairs that - * define the deployment parameters for the template. You use this element when - * you want to provide the parameter values directly in the request rather than - * link to an existing parameter file. Use either the parametersLink property - * or the parameters property, but not both. It can be a JObject or a well - * formed JSON string. - * - * @param {object} [parameters.properties.parametersLink] The URI of parameters - * file. You use this element to link to an existing parameters file. Use - * either the parametersLink property or the parameters property, but not both. - * - * @param {string} parameters.properties.parametersLink.uri The URI of the - * parameters file. - * - * @param {string} [parameters.properties.parametersLink.contentVersion] If - * included, must match the ContentVersion in the template. - * - * @param {string} parameters.properties.mode The mode that is used to deploy - * resources. This value can be either Incremental or Complete. In Incremental - * mode, resources are deployed without deleting existing resources that are - * not included in the template. In Complete mode, resources are deployed and - * existing resources in the resource group that are not included in the - * template are deleted. Be careful when using Complete mode as you may - * unintentionally delete resources. Possible values include: 'Incremental', - * 'Complete' - * - * @param {object} [parameters.properties.debugSetting] The debug setting of - * the deployment. - * - * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies - * the type of information to log for debugging. The permitted values are none, - * requestContent, responseContent, or both requestContent and responseContent - * separated by a comma. The default is none. When setting this value, - * carefully consider the type of information you are passing in during - * deployment. By logging information about the request or response, you could - * potentially expose sensitive data that is retrieved through the deployment - * operations. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - validateWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Validates whether the specified template is syntactically correct and will - * be accepted by Azure Resource Manager.. - * - * @param {string} resourceGroupName The name of the resource group the - * template will be deployed to. The name is case insensitive. - * - * @param {string} deploymentName The name of the deployment. - * - * @param {object} parameters Parameters to validate. - * - * @param {object} parameters.properties The deployment properties. - * - * @param {object} [parameters.properties.template] The template content. You - * use this element when you want to pass the template syntax directly in the - * request rather than link to an existing template. It can be a JObject or - * well-formed JSON string. Use either the templateLink property or the - * template property, but not both. - * - * @param {object} [parameters.properties.templateLink] The URI of the - * template. Use either the templateLink property or the template property, but - * not both. - * - * @param {string} parameters.properties.templateLink.uri The URI of the - * template to deploy. - * - * @param {string} [parameters.properties.templateLink.contentVersion] If - * included, must match the ContentVersion in the template. - * - * @param {object} [parameters.properties.parameters] Name and value pairs that - * define the deployment parameters for the template. You use this element when - * you want to provide the parameter values directly in the request rather than - * link to an existing parameter file. Use either the parametersLink property - * or the parameters property, but not both. It can be a JObject or a well - * formed JSON string. - * - * @param {object} [parameters.properties.parametersLink] The URI of parameters - * file. You use this element to link to an existing parameters file. Use - * either the parametersLink property or the parameters property, but not both. - * - * @param {string} parameters.properties.parametersLink.uri The URI of the - * parameters file. - * - * @param {string} [parameters.properties.parametersLink.contentVersion] If - * included, must match the ContentVersion in the template. - * - * @param {string} parameters.properties.mode The mode that is used to deploy - * resources. This value can be either Incremental or Complete. In Incremental - * mode, resources are deployed without deleting existing resources that are - * not included in the template. In Complete mode, resources are deployed and - * existing resources in the resource group that are not included in the - * template are deleted. Be careful when using Complete mode as you may - * unintentionally delete resources. Possible values include: 'Incremental', - * 'Complete' - * - * @param {object} [parameters.properties.debugSetting] The debug setting of - * the deployment. - * - * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies - * the type of information to log for debugging. The permitted values are none, - * requestContent, responseContent, or both requestContent and responseContent - * separated by a comma. The default is none. When setting this value, - * carefully consider the type of information you are passing in during - * deployment. By logging information about the request or response, you could - * potentially expose sensitive data that is retrieved through the deployment - * operations. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {DeploymentValidateResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {DeploymentValidateResult} [result] - The deserialized result object if an error did not occur. - * See {@link DeploymentValidateResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - validate(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - validate(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, callback: ServiceCallback): void; - validate(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Exports the template used for specified deployment. - * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. - * - * @param {string} deploymentName The name of the deployment from which to get - * the template. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - exportTemplateWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Exports the template used for specified deployment. - * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. - * - * @param {string} deploymentName The name of the deployment from which to get - * the template. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {DeploymentExportResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {DeploymentExportResult} [result] - The deserialized result object if an error did not occur. - * See {@link DeploymentExportResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - exportTemplate(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - exportTemplate(resourceGroupName: string, deploymentName: string, callback: ServiceCallback): void; - exportTemplate(resourceGroupName: string, deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get all the deployments for a resource group. - * - * @param {string} resourceGroupName The name of the resource group with the - * deployments to get. The name is case insensitive. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] The filter to apply on the operation. For - * example, you can use $filter=provisioningState eq '{state}'. - * - * @param {number} [options.top] The number of results to get. If null is - * passed, returns all deployments. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get all the deployments for a resource group. - * - * @param {string} resourceGroupName The name of the resource group with the - * deployments to get. The name is case insensitive. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] The filter to apply on the operation. For - * example, you can use $filter=provisioningState eq '{state}'. - * - * @param {number} [options.top] The number of results to get. If null is - * passed, returns all deployments. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {DeploymentListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {DeploymentListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DeploymentListResult} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByResourceGroup(resourceGroupName: string, options?: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting - * a template deployment removes the associated deployment operations. Deleting - * a template deployment does not affect the state of the resource group. This - * is an asynchronous operation that returns a status of 202 until the template - * deployment is successfully deleted. The Location response header contains - * the URI that is used to obtain the status of the process. While the process - * is running, a call to the URI in the Location header returns a status of - * 202. When the process finishes, the URI in the Location header returns a - * status of 204 on success. If the asynchronous request failed, the URI in the - * Location header returns an error-level status code. - * - * @param {string} resourceGroupName The name of the resource group with the - * deployment to delete. The name is case insensitive. - * - * @param {string} deploymentName The name of the deployment to delete. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting - * a template deployment removes the associated deployment operations. Deleting - * a template deployment does not affect the state of the resource group. This - * is an asynchronous operation that returns a status of 202 until the template - * deployment is successfully deleted. The Location response header contains - * the URI that is used to obtain the status of the process. While the process - * is running, a call to the URI in the Location header returns a status of - * 202. When the process finishes, the URI in the Location header returns a - * status of 204 on success. If the asynchronous request failed, the URI in the - * Location header returns an error-level status code. - * - * @param {string} resourceGroupName The name of the resource group with the - * deployment to delete. The name is case insensitive. - * - * @param {string} deploymentName The name of the deployment to delete. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName: string, deploymentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, deploymentName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, deploymentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Deploys resources to a resource group. - * - * You can provide the template and parameters directly in the request or link - * to JSON files. - * - * @param {string} resourceGroupName The name of the resource group to deploy - * the resources to. The name is case insensitive. The resource group must - * already exist. - * - * @param {string} deploymentName The name of the deployment. - * - * @param {object} parameters Additional parameters supplied to the operation. - * - * @param {object} parameters.properties The deployment properties. - * - * @param {object} [parameters.properties.template] The template content. You - * use this element when you want to pass the template syntax directly in the - * request rather than link to an existing template. It can be a JObject or - * well-formed JSON string. Use either the templateLink property or the - * template property, but not both. - * - * @param {object} [parameters.properties.templateLink] The URI of the - * template. Use either the templateLink property or the template property, but - * not both. - * - * @param {string} parameters.properties.templateLink.uri The URI of the - * template to deploy. - * - * @param {string} [parameters.properties.templateLink.contentVersion] If - * included, must match the ContentVersion in the template. - * - * @param {object} [parameters.properties.parameters] Name and value pairs that - * define the deployment parameters for the template. You use this element when - * you want to provide the parameter values directly in the request rather than - * link to an existing parameter file. Use either the parametersLink property - * or the parameters property, but not both. It can be a JObject or a well - * formed JSON string. - * - * @param {object} [parameters.properties.parametersLink] The URI of parameters - * file. You use this element to link to an existing parameters file. Use - * either the parametersLink property or the parameters property, but not both. - * - * @param {string} parameters.properties.parametersLink.uri The URI of the - * parameters file. - * - * @param {string} [parameters.properties.parametersLink.contentVersion] If - * included, must match the ContentVersion in the template. - * - * @param {string} parameters.properties.mode The mode that is used to deploy - * resources. This value can be either Incremental or Complete. In Incremental - * mode, resources are deployed without deleting existing resources that are - * not included in the template. In Complete mode, resources are deployed and - * existing resources in the resource group that are not included in the - * template are deleted. Be careful when using Complete mode as you may - * unintentionally delete resources. Possible values include: 'Incremental', - * 'Complete' - * - * @param {object} [parameters.properties.debugSetting] The debug setting of - * the deployment. - * - * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies - * the type of information to log for debugging. The permitted values are none, - * requestContent, responseContent, or both requestContent and responseContent - * separated by a comma. The default is none. When setting this value, - * carefully consider the type of information you are passing in during - * deployment. By logging information about the request or response, you could - * potentially expose sensitive data that is retrieved through the deployment - * operations. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Deploys resources to a resource group. - * - * You can provide the template and parameters directly in the request or link - * to JSON files. - * - * @param {string} resourceGroupName The name of the resource group to deploy - * the resources to. The name is case insensitive. The resource group must - * already exist. - * - * @param {string} deploymentName The name of the deployment. - * - * @param {object} parameters Additional parameters supplied to the operation. - * - * @param {object} parameters.properties The deployment properties. - * - * @param {object} [parameters.properties.template] The template content. You - * use this element when you want to pass the template syntax directly in the - * request rather than link to an existing template. It can be a JObject or - * well-formed JSON string. Use either the templateLink property or the - * template property, but not both. - * - * @param {object} [parameters.properties.templateLink] The URI of the - * template. Use either the templateLink property or the template property, but - * not both. - * - * @param {string} parameters.properties.templateLink.uri The URI of the - * template to deploy. - * - * @param {string} [parameters.properties.templateLink.contentVersion] If - * included, must match the ContentVersion in the template. - * - * @param {object} [parameters.properties.parameters] Name and value pairs that - * define the deployment parameters for the template. You use this element when - * you want to provide the parameter values directly in the request rather than - * link to an existing parameter file. Use either the parametersLink property - * or the parameters property, but not both. It can be a JObject or a well - * formed JSON string. - * - * @param {object} [parameters.properties.parametersLink] The URI of parameters - * file. You use this element to link to an existing parameters file. Use - * either the parametersLink property or the parameters property, but not both. - * - * @param {string} parameters.properties.parametersLink.uri The URI of the - * parameters file. - * - * @param {string} [parameters.properties.parametersLink.contentVersion] If - * included, must match the ContentVersion in the template. - * - * @param {string} parameters.properties.mode The mode that is used to deploy - * resources. This value can be either Incremental or Complete. In Incremental - * mode, resources are deployed without deleting existing resources that are - * not included in the template. In Complete mode, resources are deployed and - * existing resources in the resource group that are not included in the - * template are deleted. Be careful when using Complete mode as you may - * unintentionally delete resources. Possible values include: 'Incremental', - * 'Complete' - * - * @param {object} [parameters.properties.debugSetting] The debug setting of - * the deployment. - * - * @param {string} [parameters.properties.debugSetting.detailLevel] Specifies - * the type of information to log for debugging. The permitted values are none, - * requestContent, responseContent, or both requestContent and responseContent - * separated by a comma. The default is none. When setting this value, - * carefully consider the type of information you are passing in during - * deployment. By logging information about the request or response, you could - * potentially expose sensitive data that is retrieved through the deployment - * operations. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {DeploymentExtended} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {DeploymentExtended} [result] - The deserialized result object if an error did not occur. - * See {@link DeploymentExtended} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginCreateOrUpdate(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, deploymentName: string, parameters: models.Deployment, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get all the deployments for a resource group. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get all the deployments for a resource group. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {DeploymentListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {DeploymentListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DeploymentListResult} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Providers - * __NOTE__: An instance of this class is automatically created for an - * instance of the ResourceManagementClient. - */ -export interface Providers { - - - /** - * Unregisters a subscription from a resource provider. - * - * @param {string} resourceProviderNamespace The namespace of the resource - * provider to unregister. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - unregisterWithHttpOperationResponse(resourceProviderNamespace: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Unregisters a subscription from a resource provider. - * - * @param {string} resourceProviderNamespace The namespace of the resource - * provider to unregister. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {Provider} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {Provider} [result] - The deserialized result object if an error did not occur. - * See {@link Provider} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - unregister(resourceProviderNamespace: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - unregister(resourceProviderNamespace: string, callback: ServiceCallback): void; - unregister(resourceProviderNamespace: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Registers a subscription with a resource provider. - * - * @param {string} resourceProviderNamespace The namespace of the resource - * provider to register. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - registerWithHttpOperationResponse(resourceProviderNamespace: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Registers a subscription with a resource provider. - * - * @param {string} resourceProviderNamespace The namespace of the resource - * provider to register. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {Provider} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {Provider} [result] - The deserialized result object if an error did not occur. - * See {@link Provider} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - register(resourceProviderNamespace: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - register(resourceProviderNamespace: string, callback: ServiceCallback): void; - register(resourceProviderNamespace: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all resource providers for a subscription. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.top] The number of results to return. If null is - * passed returns all deployments. - * - * @param {string} [options.expand] The properties to include in the results. - * For example, use &$expand=metadata in the query string to retrieve resource - * provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listWithHttpOperationResponse(options?: { top? : number, expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all resource providers for a subscription. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.top] The number of results to return. If null is - * passed returns all deployments. - * - * @param {string} [options.expand] The properties to include in the results. - * For example, use &$expand=metadata in the query string to retrieve resource - * provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ProviderListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ProviderListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ProviderListResult} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(options?: { top? : number, expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { top? : number, expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified resource provider. - * - * @param {string} resourceProviderNamespace The namespace of the resource - * provider. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] The $expand query parameter. For example, - * to include property aliases in response, use $expand=resourceTypes/aliases. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceProviderNamespace: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified resource provider. - * - * @param {string} resourceProviderNamespace The namespace of the resource - * provider. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] The $expand query parameter. For example, - * to include property aliases in response, use $expand=resourceTypes/aliases. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {Provider} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {Provider} [result] - The deserialized result object if an error did not occur. - * See {@link Provider} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - get(resourceProviderNamespace: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceProviderNamespace: string, callback: ServiceCallback): void; - get(resourceProviderNamespace: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all resource providers for a subscription. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all resource providers for a subscription. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ProviderListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ProviderListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ProviderListResult} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Resources - * __NOTE__: An instance of this class is automatically created for an - * instance of the ResourceManagementClient. - */ -export interface Resources { - - - /** - * Get all the resources for a resource group. - * - * @param {string} resourceGroupName The resource group with the resources to - * get. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] The filter to apply on the operation. - * - * @param {string} [options.expand] The $expand query parameter - * - * @param {number} [options.top] The number of results to return. If null is - * passed, returns all resources. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { filter? : string, expand? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get all the resources for a resource group. - * - * @param {string} resourceGroupName The resource group with the resources to - * get. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] The filter to apply on the operation. - * - * @param {string} [options.expand] The $expand query parameter - * - * @param {number} [options.top] The number of results to return. If null is - * passed, returns all resources. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ResourceListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ResourceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceListResult} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByResourceGroup(resourceGroupName: string, options?: { filter? : string, expand? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { filter? : string, expand? : string, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Moves resources from one resource group to another resource group. - * - * The resources to move must be in the same source resource group. The target - * resource group may be in a different subscription. When moving resources, - * both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until - * the move completes. - * - * @param {string} sourceResourceGroupName The name of the resource group - * containing the resources to move. - * - * @param {object} parameters Parameters for moving resources. - * - * @param {array} [parameters.resources] The IDs of the resources. - * - * @param {string} [parameters.targetResourceGroup] The target resource group. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - moveResourcesWithHttpOperationResponse(sourceResourceGroupName: string, parameters: models.ResourcesMoveInfo, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Moves resources from one resource group to another resource group. - * - * The resources to move must be in the same source resource group. The target - * resource group may be in a different subscription. When moving resources, - * both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until - * the move completes. - * - * @param {string} sourceResourceGroupName The name of the resource group - * containing the resources to move. - * - * @param {object} parameters Parameters for moving resources. - * - * @param {array} [parameters.resources] The IDs of the resources. - * - * @param {string} [parameters.targetResourceGroup] The target resource group. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - moveResources(sourceResourceGroupName: string, parameters: models.ResourcesMoveInfo, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - moveResources(sourceResourceGroupName: string, parameters: models.ResourcesMoveInfo, callback: ServiceCallback): void; - moveResources(sourceResourceGroupName: string, parameters: models.ResourcesMoveInfo, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Validates whether resources can be moved from one resource group to - * another resource group. - * - * This operation checks whether the specified resources can be moved to the - * target. The resources to move must be in the same source resource group. The - * target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation - * fails, it returns HTTP response code 409 (Conflict) with an error message. - * Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param {string} sourceResourceGroupName The name of the resource group - * containing the resources to validate for move. - * - * @param {object} parameters Parameters for moving resources. - * - * @param {array} [parameters.resources] The IDs of the resources. - * - * @param {string} [parameters.targetResourceGroup] The target resource group. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - validateMoveResourcesWithHttpOperationResponse(sourceResourceGroupName: string, parameters: models.ResourcesMoveInfo, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Validates whether resources can be moved from one resource group to - * another resource group. - * - * This operation checks whether the specified resources can be moved to the - * target. The resources to move must be in the same source resource group. The - * target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation - * fails, it returns HTTP response code 409 (Conflict) with an error message. - * Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param {string} sourceResourceGroupName The name of the resource group - * containing the resources to validate for move. - * - * @param {object} parameters Parameters for moving resources. - * - * @param {array} [parameters.resources] The IDs of the resources. - * - * @param {string} [parameters.targetResourceGroup] The target resource group. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - validateMoveResources(sourceResourceGroupName: string, parameters: models.ResourcesMoveInfo, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - validateMoveResources(sourceResourceGroupName: string, parameters: models.ResourcesMoveInfo, callback: ServiceCallback): void; - validateMoveResources(sourceResourceGroupName: string, parameters: models.ResourcesMoveInfo, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get all the resources in a subscription. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] The filter to apply on the operation. - * - * @param {string} [options.expand] The $expand query parameter. - * - * @param {number} [options.top] The number of results to return. If null is - * passed, returns all resource groups. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listWithHttpOperationResponse(options?: { filter? : string, expand? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get all the resources in a subscription. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] The filter to apply on the operation. - * - * @param {string} [options.expand] The $expand query parameter. - * - * @param {number} [options.top] The number of results to return. If null is - * passed, returns all resource groups. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ResourceListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ResourceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceListResult} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(options?: { filter? : string, expand? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { filter? : string, expand? : string, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Checks whether a resource exists. - * - * @param {string} resourceGroupName The name of the resource group containing - * the resource to check. The name is case insensitive. - * - * @param {string} resourceProviderNamespace The resource provider of the - * resource to check. - * - * @param {string} parentResourcePath The parent resource identity. - * - * @param {string} resourceType The resource type. - * - * @param {string} resourceName The name of the resource to check whether it - * exists. - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - checkExistenceWithHttpOperationResponse(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Checks whether a resource exists. - * - * @param {string} resourceGroupName The name of the resource group containing - * the resource to check. The name is case insensitive. - * - * @param {string} resourceProviderNamespace The resource provider of the - * resource to check. - * - * @param {string} parentResourcePath The parent resource identity. - * - * @param {string} resourceType The resource type. - * - * @param {string} resourceName The name of the resource to check whether it - * exists. - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {Boolean} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {Boolean} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - checkExistence(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - checkExistence(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, callback: ServiceCallback): void; - checkExistence(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a resource. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource to delete. The name is case insensitive. - * - * @param {string} resourceProviderNamespace The namespace of the resource - * provider. - * - * @param {string} parentResourcePath The parent resource identity. - * - * @param {string} resourceType The resource type. - * - * @param {string} resourceName The name of the resource to delete. - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a resource. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource to delete. The name is case insensitive. - * - * @param {string} resourceProviderNamespace The namespace of the resource - * provider. - * - * @param {string} parentResourcePath The parent resource identity. - * - * @param {string} resourceType The resource type. - * - * @param {string} resourceName The name of the resource to delete. - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a resource. - * - * @param {string} resourceGroupName The name of the resource group for the - * resource. The name is case insensitive. - * - * @param {string} resourceProviderNamespace The namespace of the resource - * provider. - * - * @param {string} parentResourcePath The parent resource identity. - * - * @param {string} resourceType The resource type of the resource to create. - * - * @param {string} resourceName The name of the resource to create. - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} parameters Parameters for creating or updating the resource. - * - * @param {object} [parameters.plan] The plan of the resource. - * - * @param {string} [parameters.plan.name] The plan ID. - * - * @param {string} [parameters.plan.publisher] The publisher ID. - * - * @param {string} [parameters.plan.product] The offer ID. - * - * @param {string} [parameters.plan.promotionCode] The promotion code. - * - * @param {object} [parameters.properties] The resource properties. - * - * @param {string} [parameters.kind] The kind of the resource. - * - * @param {string} [parameters.managedBy] ID of the resource that manages this - * resource. - * - * @param {object} [parameters.sku] The SKU of the resource. - * - * @param {string} [parameters.sku.name] The SKU name. - * - * @param {string} [parameters.sku.tier] The SKU tier. - * - * @param {string} [parameters.sku.size] The SKU size. - * - * @param {string} [parameters.sku.family] The SKU family. - * - * @param {string} [parameters.sku.model] The SKU model. - * - * @param {number} [parameters.sku.capacity] The SKU capacity. - * - * @param {object} [parameters.identity] The identity of the resource. - * - * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' - * - * @param {string} [parameters.location] Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, parameters: models.GenericResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a resource. - * - * @param {string} resourceGroupName The name of the resource group for the - * resource. The name is case insensitive. - * - * @param {string} resourceProviderNamespace The namespace of the resource - * provider. - * - * @param {string} parentResourcePath The parent resource identity. - * - * @param {string} resourceType The resource type of the resource to create. - * - * @param {string} resourceName The name of the resource to create. - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} parameters Parameters for creating or updating the resource. - * - * @param {object} [parameters.plan] The plan of the resource. - * - * @param {string} [parameters.plan.name] The plan ID. - * - * @param {string} [parameters.plan.publisher] The publisher ID. - * - * @param {string} [parameters.plan.product] The offer ID. - * - * @param {string} [parameters.plan.promotionCode] The promotion code. - * - * @param {object} [parameters.properties] The resource properties. - * - * @param {string} [parameters.kind] The kind of the resource. - * - * @param {string} [parameters.managedBy] ID of the resource that manages this - * resource. - * - * @param {object} [parameters.sku] The SKU of the resource. - * - * @param {string} [parameters.sku.name] The SKU name. - * - * @param {string} [parameters.sku.tier] The SKU tier. - * - * @param {string} [parameters.sku.size] The SKU size. - * - * @param {string} [parameters.sku.family] The SKU family. - * - * @param {string} [parameters.sku.model] The SKU model. - * - * @param {number} [parameters.sku.capacity] The SKU capacity. - * - * @param {object} [parameters.identity] The identity of the resource. - * - * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' - * - * @param {string} [parameters.location] Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {GenericResource} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {GenericResource} [result] - The deserialized result object if an error did not occur. - * See {@link GenericResource} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdate(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, parameters: models.GenericResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, parameters: models.GenericResource, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, parameters: models.GenericResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets a resource. - * - * @param {string} resourceGroupName The name of the resource group containing - * the resource to get. The name is case insensitive. - * - * @param {string} resourceProviderNamespace The namespace of the resource - * provider. - * - * @param {string} parentResourcePath The parent resource identity. - * - * @param {string} resourceType The resource type of the resource. - * - * @param {string} resourceName The name of the resource to get. - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a resource. - * - * @param {string} resourceGroupName The name of the resource group containing - * the resource to get. The name is case insensitive. - * - * @param {string} resourceProviderNamespace The namespace of the resource - * provider. - * - * @param {string} parentResourcePath The parent resource identity. - * - * @param {string} resourceType The resource type of the resource. - * - * @param {string} resourceName The name of the resource to get. - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {GenericResource} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {GenericResource} [result] - The deserialized result object if an error did not occur. - * See {@link GenericResource} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - get(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, callback: ServiceCallback): void; - get(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Checks by ID whether a resource exists. - * - * @param {string} resourceId The fully qualified ID of the resource, including - * the resource name and resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - checkExistenceByIdWithHttpOperationResponse(resourceId: string, apiVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Checks by ID whether a resource exists. - * - * @param {string} resourceId The fully qualified ID of the resource, including - * the resource name and resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {Boolean} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {Boolean} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - checkExistenceById(resourceId: string, apiVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - checkExistenceById(resourceId: string, apiVersion: string, callback: ServiceCallback): void; - checkExistenceById(resourceId: string, apiVersion: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a resource by ID. - * - * @param {string} resourceId The fully qualified ID of the resource, including - * the resource name and resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - deleteByIdWithHttpOperationResponse(resourceId: string, apiVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a resource by ID. - * - * @param {string} resourceId The fully qualified ID of the resource, including - * the resource name and resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteById(resourceId: string, apiVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteById(resourceId: string, apiVersion: string, callback: ServiceCallback): void; - deleteById(resourceId: string, apiVersion: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Create a resource by ID. - * - * @param {string} resourceId The fully qualified ID of the resource, including - * the resource name and resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} parameters Create or update resource parameters. - * - * @param {object} [parameters.plan] The plan of the resource. - * - * @param {string} [parameters.plan.name] The plan ID. - * - * @param {string} [parameters.plan.publisher] The publisher ID. - * - * @param {string} [parameters.plan.product] The offer ID. - * - * @param {string} [parameters.plan.promotionCode] The promotion code. - * - * @param {object} [parameters.properties] The resource properties. - * - * @param {string} [parameters.kind] The kind of the resource. - * - * @param {string} [parameters.managedBy] ID of the resource that manages this - * resource. - * - * @param {object} [parameters.sku] The SKU of the resource. - * - * @param {string} [parameters.sku.name] The SKU name. - * - * @param {string} [parameters.sku.tier] The SKU tier. - * - * @param {string} [parameters.sku.size] The SKU size. - * - * @param {string} [parameters.sku.family] The SKU family. - * - * @param {string} [parameters.sku.model] The SKU model. - * - * @param {number} [parameters.sku.capacity] The SKU capacity. - * - * @param {object} [parameters.identity] The identity of the resource. - * - * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' - * - * @param {string} [parameters.location] Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateByIdWithHttpOperationResponse(resourceId: string, apiVersion: string, parameters: models.GenericResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Create a resource by ID. - * - * @param {string} resourceId The fully qualified ID of the resource, including - * the resource name and resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} parameters Create or update resource parameters. - * - * @param {object} [parameters.plan] The plan of the resource. - * - * @param {string} [parameters.plan.name] The plan ID. - * - * @param {string} [parameters.plan.publisher] The publisher ID. - * - * @param {string} [parameters.plan.product] The offer ID. - * - * @param {string} [parameters.plan.promotionCode] The promotion code. - * - * @param {object} [parameters.properties] The resource properties. - * - * @param {string} [parameters.kind] The kind of the resource. - * - * @param {string} [parameters.managedBy] ID of the resource that manages this - * resource. - * - * @param {object} [parameters.sku] The SKU of the resource. - * - * @param {string} [parameters.sku.name] The SKU name. - * - * @param {string} [parameters.sku.tier] The SKU tier. - * - * @param {string} [parameters.sku.size] The SKU size. - * - * @param {string} [parameters.sku.family] The SKU family. - * - * @param {string} [parameters.sku.model] The SKU model. - * - * @param {number} [parameters.sku.capacity] The SKU capacity. - * - * @param {object} [parameters.identity] The identity of the resource. - * - * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' - * - * @param {string} [parameters.location] Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {GenericResource} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {GenericResource} [result] - The deserialized result object if an error did not occur. - * See {@link GenericResource} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdateById(resourceId: string, apiVersion: string, parameters: models.GenericResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdateById(resourceId: string, apiVersion: string, parameters: models.GenericResource, callback: ServiceCallback): void; - createOrUpdateById(resourceId: string, apiVersion: string, parameters: models.GenericResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets a resource by ID. - * - * @param {string} resourceId The fully qualified ID of the resource, including - * the resource name and resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getByIdWithHttpOperationResponse(resourceId: string, apiVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a resource by ID. - * - * @param {string} resourceId The fully qualified ID of the resource, including - * the resource name and resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {GenericResource} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {GenericResource} [result] - The deserialized result object if an error did not occur. - * See {@link GenericResource} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getById(resourceId: string, apiVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getById(resourceId: string, apiVersion: string, callback: ServiceCallback): void; - getById(resourceId: string, apiVersion: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Moves resources from one resource group to another resource group. - * - * The resources to move must be in the same source resource group. The target - * resource group may be in a different subscription. When moving resources, - * both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until - * the move completes. - * - * @param {string} sourceResourceGroupName The name of the resource group - * containing the resources to move. - * - * @param {object} parameters Parameters for moving resources. - * - * @param {array} [parameters.resources] The IDs of the resources. - * - * @param {string} [parameters.targetResourceGroup] The target resource group. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginMoveResourcesWithHttpOperationResponse(sourceResourceGroupName: string, parameters: models.ResourcesMoveInfo, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Moves resources from one resource group to another resource group. - * - * The resources to move must be in the same source resource group. The target - * resource group may be in a different subscription. When moving resources, - * both the source group and the target group are locked for the duration of - * the operation. Write and delete operations are blocked on the groups until - * the move completes. - * - * @param {string} sourceResourceGroupName The name of the resource group - * containing the resources to move. - * - * @param {object} parameters Parameters for moving resources. - * - * @param {array} [parameters.resources] The IDs of the resources. - * - * @param {string} [parameters.targetResourceGroup] The target resource group. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginMoveResources(sourceResourceGroupName: string, parameters: models.ResourcesMoveInfo, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginMoveResources(sourceResourceGroupName: string, parameters: models.ResourcesMoveInfo, callback: ServiceCallback): void; - beginMoveResources(sourceResourceGroupName: string, parameters: models.ResourcesMoveInfo, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Validates whether resources can be moved from one resource group to - * another resource group. - * - * This operation checks whether the specified resources can be moved to the - * target. The resources to move must be in the same source resource group. The - * target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation - * fails, it returns HTTP response code 409 (Conflict) with an error message. - * Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param {string} sourceResourceGroupName The name of the resource group - * containing the resources to validate for move. - * - * @param {object} parameters Parameters for moving resources. - * - * @param {array} [parameters.resources] The IDs of the resources. - * - * @param {string} [parameters.targetResourceGroup] The target resource group. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginValidateMoveResourcesWithHttpOperationResponse(sourceResourceGroupName: string, parameters: models.ResourcesMoveInfo, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Validates whether resources can be moved from one resource group to - * another resource group. - * - * This operation checks whether the specified resources can be moved to the - * target. The resources to move must be in the same source resource group. The - * target resource group may be in a different subscription. If validation - * succeeds, it returns HTTP response code 204 (no content). If validation - * fails, it returns HTTP response code 409 (Conflict) with an error message. - * Retrieve the URL in the Location header value to check the result of the - * long-running operation. - * - * @param {string} sourceResourceGroupName The name of the resource group - * containing the resources to validate for move. - * - * @param {object} parameters Parameters for moving resources. - * - * @param {array} [parameters.resources] The IDs of the resources. - * - * @param {string} [parameters.targetResourceGroup] The target resource group. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginValidateMoveResources(sourceResourceGroupName: string, parameters: models.ResourcesMoveInfo, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginValidateMoveResources(sourceResourceGroupName: string, parameters: models.ResourcesMoveInfo, callback: ServiceCallback): void; - beginValidateMoveResources(sourceResourceGroupName: string, parameters: models.ResourcesMoveInfo, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a resource. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource to delete. The name is case insensitive. - * - * @param {string} resourceProviderNamespace The namespace of the resource - * provider. - * - * @param {string} parentResourcePath The parent resource identity. - * - * @param {string} resourceType The resource type. - * - * @param {string} resourceName The name of the resource to delete. - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a resource. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource to delete. The name is case insensitive. - * - * @param {string} resourceProviderNamespace The namespace of the resource - * provider. - * - * @param {string} parentResourcePath The parent resource identity. - * - * @param {string} resourceType The resource type. - * - * @param {string} resourceName The name of the resource to delete. - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a resource. - * - * @param {string} resourceGroupName The name of the resource group for the - * resource. The name is case insensitive. - * - * @param {string} resourceProviderNamespace The namespace of the resource - * provider. - * - * @param {string} parentResourcePath The parent resource identity. - * - * @param {string} resourceType The resource type of the resource to create. - * - * @param {string} resourceName The name of the resource to create. - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} parameters Parameters for creating or updating the resource. - * - * @param {object} [parameters.plan] The plan of the resource. - * - * @param {string} [parameters.plan.name] The plan ID. - * - * @param {string} [parameters.plan.publisher] The publisher ID. - * - * @param {string} [parameters.plan.product] The offer ID. - * - * @param {string} [parameters.plan.promotionCode] The promotion code. - * - * @param {object} [parameters.properties] The resource properties. - * - * @param {string} [parameters.kind] The kind of the resource. - * - * @param {string} [parameters.managedBy] ID of the resource that manages this - * resource. - * - * @param {object} [parameters.sku] The SKU of the resource. - * - * @param {string} [parameters.sku.name] The SKU name. - * - * @param {string} [parameters.sku.tier] The SKU tier. - * - * @param {string} [parameters.sku.size] The SKU size. - * - * @param {string} [parameters.sku.family] The SKU family. - * - * @param {string} [parameters.sku.model] The SKU model. - * - * @param {number} [parameters.sku.capacity] The SKU capacity. - * - * @param {object} [parameters.identity] The identity of the resource. - * - * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' - * - * @param {string} [parameters.location] Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, parameters: models.GenericResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a resource. - * - * @param {string} resourceGroupName The name of the resource group for the - * resource. The name is case insensitive. - * - * @param {string} resourceProviderNamespace The namespace of the resource - * provider. - * - * @param {string} parentResourcePath The parent resource identity. - * - * @param {string} resourceType The resource type of the resource to create. - * - * @param {string} resourceName The name of the resource to create. - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} parameters Parameters for creating or updating the resource. - * - * @param {object} [parameters.plan] The plan of the resource. - * - * @param {string} [parameters.plan.name] The plan ID. - * - * @param {string} [parameters.plan.publisher] The publisher ID. - * - * @param {string} [parameters.plan.product] The offer ID. - * - * @param {string} [parameters.plan.promotionCode] The promotion code. - * - * @param {object} [parameters.properties] The resource properties. - * - * @param {string} [parameters.kind] The kind of the resource. - * - * @param {string} [parameters.managedBy] ID of the resource that manages this - * resource. - * - * @param {object} [parameters.sku] The SKU of the resource. - * - * @param {string} [parameters.sku.name] The SKU name. - * - * @param {string} [parameters.sku.tier] The SKU tier. - * - * @param {string} [parameters.sku.size] The SKU size. - * - * @param {string} [parameters.sku.family] The SKU family. - * - * @param {string} [parameters.sku.model] The SKU model. - * - * @param {number} [parameters.sku.capacity] The SKU capacity. - * - * @param {object} [parameters.identity] The identity of the resource. - * - * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' - * - * @param {string} [parameters.location] Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {GenericResource} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {GenericResource} [result] - The deserialized result object if an error did not occur. - * See {@link GenericResource} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginCreateOrUpdate(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, parameters: models.GenericResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, parameters: models.GenericResource, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, resourceProviderNamespace: string, parentResourcePath: string, resourceType: string, resourceName: string, apiVersion: string, parameters: models.GenericResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a resource by ID. - * - * @param {string} resourceId The fully qualified ID of the resource, including - * the resource name and resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginDeleteByIdWithHttpOperationResponse(resourceId: string, apiVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a resource by ID. - * - * @param {string} resourceId The fully qualified ID of the resource, including - * the resource name and resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteById(resourceId: string, apiVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteById(resourceId: string, apiVersion: string, callback: ServiceCallback): void; - beginDeleteById(resourceId: string, apiVersion: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Create a resource by ID. - * - * @param {string} resourceId The fully qualified ID of the resource, including - * the resource name and resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} parameters Create or update resource parameters. - * - * @param {object} [parameters.plan] The plan of the resource. - * - * @param {string} [parameters.plan.name] The plan ID. - * - * @param {string} [parameters.plan.publisher] The publisher ID. - * - * @param {string} [parameters.plan.product] The offer ID. - * - * @param {string} [parameters.plan.promotionCode] The promotion code. - * - * @param {object} [parameters.properties] The resource properties. - * - * @param {string} [parameters.kind] The kind of the resource. - * - * @param {string} [parameters.managedBy] ID of the resource that manages this - * resource. - * - * @param {object} [parameters.sku] The SKU of the resource. - * - * @param {string} [parameters.sku.name] The SKU name. - * - * @param {string} [parameters.sku.tier] The SKU tier. - * - * @param {string} [parameters.sku.size] The SKU size. - * - * @param {string} [parameters.sku.family] The SKU family. - * - * @param {string} [parameters.sku.model] The SKU model. - * - * @param {number} [parameters.sku.capacity] The SKU capacity. - * - * @param {object} [parameters.identity] The identity of the resource. - * - * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' - * - * @param {string} [parameters.location] Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginCreateOrUpdateByIdWithHttpOperationResponse(resourceId: string, apiVersion: string, parameters: models.GenericResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Create a resource by ID. - * - * @param {string} resourceId The fully qualified ID of the resource, including - * the resource name and resource type. Use the format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} - * - * @param {string} apiVersion The API version to use for the operation. - * - * @param {object} parameters Create or update resource parameters. - * - * @param {object} [parameters.plan] The plan of the resource. - * - * @param {string} [parameters.plan.name] The plan ID. - * - * @param {string} [parameters.plan.publisher] The publisher ID. - * - * @param {string} [parameters.plan.product] The offer ID. - * - * @param {string} [parameters.plan.promotionCode] The promotion code. - * - * @param {object} [parameters.properties] The resource properties. - * - * @param {string} [parameters.kind] The kind of the resource. - * - * @param {string} [parameters.managedBy] ID of the resource that manages this - * resource. - * - * @param {object} [parameters.sku] The SKU of the resource. - * - * @param {string} [parameters.sku.name] The SKU name. - * - * @param {string} [parameters.sku.tier] The SKU tier. - * - * @param {string} [parameters.sku.size] The SKU size. - * - * @param {string} [parameters.sku.family] The SKU family. - * - * @param {string} [parameters.sku.model] The SKU model. - * - * @param {number} [parameters.sku.capacity] The SKU capacity. - * - * @param {object} [parameters.identity] The identity of the resource. - * - * @param {string} [parameters.identity.type] The identity type. Possible - * values include: 'SystemAssigned' - * - * @param {string} [parameters.location] Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {GenericResource} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {GenericResource} [result] - The deserialized result object if an error did not occur. - * See {@link GenericResource} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginCreateOrUpdateById(resourceId: string, apiVersion: string, parameters: models.GenericResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdateById(resourceId: string, apiVersion: string, parameters: models.GenericResource, callback: ServiceCallback): void; - beginCreateOrUpdateById(resourceId: string, apiVersion: string, parameters: models.GenericResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get all the resources for a resource group. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get all the resources for a resource group. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ResourceListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ResourceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceListResult} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get all the resources in a subscription. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get all the resources in a subscription. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ResourceListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ResourceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceListResult} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ResourceGroups - * __NOTE__: An instance of this class is automatically created for an - * instance of the ResourceManagementClient. - */ -export interface ResourceGroups { - - - /** - * Checks whether a resource group exists. - * - * @param {string} resourceGroupName The name of the resource group to check. - * The name is case insensitive. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - checkExistenceWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Checks whether a resource group exists. - * - * @param {string} resourceGroupName The name of the resource group to check. - * The name is case insensitive. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {Boolean} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {Boolean} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - checkExistence(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - checkExistence(resourceGroupName: string, callback: ServiceCallback): void; - checkExistence(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a resource group. - * - * @param {string} resourceGroupName The name of the resource group to create - * or update. - * - * @param {object} parameters Parameters supplied to the create or update a - * resource group. - * - * @param {string} [parameters.name] The name of the resource group. - * - * @param {object} [parameters.properties] - * - * @param {string} parameters.location The location of the resource group. It - * cannot be changed after the resource group has been created. It muct be one - * of the supported Azure locations. - * - * @param {string} [parameters.managedBy] The ID of the resource that manages - * this resource group. - * - * @param {object} [parameters.tags] The tags attached to the resource group. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, parameters: models.ResourceGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a resource group. - * - * @param {string} resourceGroupName The name of the resource group to create - * or update. - * - * @param {object} parameters Parameters supplied to the create or update a - * resource group. - * - * @param {string} [parameters.name] The name of the resource group. - * - * @param {object} [parameters.properties] - * - * @param {string} parameters.location The location of the resource group. It - * cannot be changed after the resource group has been created. It muct be one - * of the supported Azure locations. - * - * @param {string} [parameters.managedBy] The ID of the resource that manages - * this resource group. - * - * @param {object} [parameters.tags] The tags attached to the resource group. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ResourceGroup} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ResourceGroup} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceGroup} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdate(resourceGroupName: string, parameters: models.ResourceGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, parameters: models.ResourceGroup, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, parameters: models.ResourceGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Deletes a resource group. - * - * When you delete a resource group, all of its resources are also deleted. - * Deleting a resource group deletes all of its template deployments and - * currently stored operations. - * - * @param {string} resourceGroupName The name of the resource group to delete. - * The name is case insensitive. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Deletes a resource group. - * - * When you delete a resource group, all of its resources are also deleted. - * Deleting a resource group deletes all of its template deployments and - * currently stored operations. - * - * @param {string} resourceGroupName The name of the resource group to delete. - * The name is case insensitive. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets a resource group. - * - * @param {string} resourceGroupName The name of the resource group to get. The - * name is case insensitive. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a resource group. - * - * @param {string} resourceGroupName The name of the resource group to get. The - * name is case insensitive. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ResourceGroup} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ResourceGroup} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceGroup} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - get(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Updates a resource group. - * - * Resource groups can be updated through a simple PATCH operation to a group - * address. The format of the request is the same as that for creating a - * resource group. If a field is unspecified, the current value is retained. - * - * @param {string} resourceGroupName The name of the resource group to update. - * The name is case insensitive. - * - * @param {object} parameters Parameters supplied to update a resource group. - * - * @param {string} [parameters.name] The name of the resource group. - * - * @param {object} [parameters.properties] - * - * @param {string} [parameters.managedBy] The ID of the resource that manages - * this resource group. - * - * @param {object} [parameters.tags] The tags attached to the resource group. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - updateWithHttpOperationResponse(resourceGroupName: string, parameters: models.ResourceGroupPatchable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Updates a resource group. - * - * Resource groups can be updated through a simple PATCH operation to a group - * address. The format of the request is the same as that for creating a - * resource group. If a field is unspecified, the current value is retained. - * - * @param {string} resourceGroupName The name of the resource group to update. - * The name is case insensitive. - * - * @param {object} parameters Parameters supplied to update a resource group. - * - * @param {string} [parameters.name] The name of the resource group. - * - * @param {object} [parameters.properties] - * - * @param {string} [parameters.managedBy] The ID of the resource that manages - * this resource group. - * - * @param {object} [parameters.tags] The tags attached to the resource group. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ResourceGroup} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ResourceGroup} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceGroup} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - update(resourceGroupName: string, parameters: models.ResourceGroupPatchable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, parameters: models.ResourceGroupPatchable, callback: ServiceCallback): void; - update(resourceGroupName: string, parameters: models.ResourceGroupPatchable, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Captures the specified resource group as a template. - * - * @param {string} resourceGroupName The name of the resource group to export - * as a template. - * - * @param {object} parameters Parameters for exporting the template. - * - * @param {array} [parameters.resources] The IDs of the resources. The only - * supported string currently is '*' (all resources). Future updates will - * support exporting specific resources. - * - * @param {string} [parameters.options] The export template options. Supported - * values include 'IncludeParameterDefaultValue', 'IncludeComments' or - * 'IncludeParameterDefaultValue, IncludeComments - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - exportTemplateWithHttpOperationResponse(resourceGroupName: string, parameters: models.ExportTemplateRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Captures the specified resource group as a template. - * - * @param {string} resourceGroupName The name of the resource group to export - * as a template. - * - * @param {object} parameters Parameters for exporting the template. - * - * @param {array} [parameters.resources] The IDs of the resources. The only - * supported string currently is '*' (all resources). Future updates will - * support exporting specific resources. - * - * @param {string} [parameters.options] The export template options. Supported - * values include 'IncludeParameterDefaultValue', 'IncludeComments' or - * 'IncludeParameterDefaultValue, IncludeComments - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ResourceGroupExportResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ResourceGroupExportResult} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceGroupExportResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - exportTemplate(resourceGroupName: string, parameters: models.ExportTemplateRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - exportTemplate(resourceGroupName: string, parameters: models.ExportTemplateRequest, callback: ServiceCallback): void; - exportTemplate(resourceGroupName: string, parameters: models.ExportTemplateRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the resource groups for a subscription. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] The filter to apply on the operation. - * - * @param {number} [options.top] The number of results to return. If null is - * passed, returns all resource groups. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listWithHttpOperationResponse(options?: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the resource groups for a subscription. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] The filter to apply on the operation. - * - * @param {number} [options.top] The number of results to return. If null is - * passed, returns all resource groups. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ResourceGroupListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ResourceGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceGroupListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(options?: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Deletes a resource group. - * - * When you delete a resource group, all of its resources are also deleted. - * Deleting a resource group deletes all of its template deployments and - * currently stored operations. - * - * @param {string} resourceGroupName The name of the resource group to delete. - * The name is case insensitive. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Deletes a resource group. - * - * When you delete a resource group, all of its resources are also deleted. - * Deleting a resource group deletes all of its template deployments and - * currently stored operations. - * - * @param {string} resourceGroupName The name of the resource group to delete. - * The name is case insensitive. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the resource groups for a subscription. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the resource groups for a subscription. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ResourceGroupListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ResourceGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceGroupListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Tags - * __NOTE__: An instance of this class is automatically created for an - * instance of the ResourceManagementClient. - */ -export interface Tags { - - - /** - * Deletes a tag value. - * - * @param {string} tagName The name of the tag. - * - * @param {string} tagValue The value of the tag to delete. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - deleteValueWithHttpOperationResponse(tagName: string, tagValue: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a tag value. - * - * @param {string} tagName The name of the tag. - * - * @param {string} tagValue The value of the tag to delete. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteValue(tagName: string, tagValue: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteValue(tagName: string, tagValue: string, callback: ServiceCallback): void; - deleteValue(tagName: string, tagValue: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a tag value. The name of the tag must already exist. - * - * @param {string} tagName The name of the tag. - * - * @param {string} tagValue The value of the tag to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateValueWithHttpOperationResponse(tagName: string, tagValue: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a tag value. The name of the tag must already exist. - * - * @param {string} tagName The name of the tag. - * - * @param {string} tagValue The value of the tag to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {TagValue} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {TagValue} [result] - The deserialized result object if an error did not occur. - * See {@link TagValue} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdateValue(tagName: string, tagValue: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdateValue(tagName: string, tagValue: string, callback: ServiceCallback): void; - createOrUpdateValue(tagName: string, tagValue: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Creates a tag in the subscription. - * - * The tag name can have a maximum of 512 characters and is case insensitive. - * Tag names created by Azure have prefixes of microsoft, azure, or windows. - * You cannot create tags with one of these prefixes. - * - * @param {string} tagName The name of the tag to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(tagName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Creates a tag in the subscription. - * - * The tag name can have a maximum of 512 characters and is case insensitive. - * Tag names created by Azure have prefixes of microsoft, azure, or windows. - * You cannot create tags with one of these prefixes. - * - * @param {string} tagName The name of the tag to create. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {TagDetails} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {TagDetails} [result] - The deserialized result object if an error did not occur. - * See {@link TagDetails} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdate(tagName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(tagName: string, callback: ServiceCallback): void; - createOrUpdate(tagName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Deletes a tag from the subscription. - * - * You must remove all values from a resource tag before you can delete it. - * - * @param {string} tagName The name of the tag. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - deleteMethodWithHttpOperationResponse(tagName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Deletes a tag from the subscription. - * - * You must remove all values from a resource tag before you can delete it. - * - * @param {string} tagName The name of the tag. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(tagName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(tagName: string, callback: ServiceCallback): void; - deleteMethod(tagName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the names and values of all resource tags that are defined in a - * subscription. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the names and values of all resource tags that are defined in a - * subscription. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {TagsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {TagsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link TagsListResult} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the names and values of all resource tags that are defined in a - * subscription. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the names and values of all resource tags that are defined in a - * subscription. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {TagsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {TagsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link TagsListResult} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * DeploymentOperations - * __NOTE__: An instance of this class is automatically created for an - * instance of the ResourceManagementClient. - */ -export interface DeploymentOperations { - - - /** - * Gets a deployments operation. - * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. - * - * @param {string} deploymentName The name of the deployment. - * - * @param {string} operationId The ID of the operation to get. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a deployments operation. - * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. - * - * @param {string} deploymentName The name of the deployment. - * - * @param {string} operationId The ID of the operation to get. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {DeploymentOperation} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {DeploymentOperation} [result] - The deserialized result object if an error did not occur. - * See {@link DeploymentOperation} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - get(resourceGroupName: string, deploymentName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, deploymentName: string, operationId: string, callback: ServiceCallback): void; - get(resourceGroupName: string, deploymentName: string, operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all deployments operations for a deployment. - * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. - * - * @param {string} deploymentName The name of the deployment with the operation - * to get. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.top] The number of results to return. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listWithHttpOperationResponse(resourceGroupName: string, deploymentName: string, options?: { top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all deployments operations for a deployment. - * - * @param {string} resourceGroupName The name of the resource group. The name - * is case insensitive. - * - * @param {string} deploymentName The name of the deployment with the operation - * to get. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.top] The number of results to return. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {DeploymentOperationsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {DeploymentOperationsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DeploymentOperationsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(resourceGroupName: string, deploymentName: string, options?: { top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, deploymentName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, deploymentName: string, options: { top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all deployments operations for a deployment. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all deployments operations for a deployment. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {DeploymentOperationsListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {DeploymentOperationsListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DeploymentOperationsListResult} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} diff --git a/tools/resourceManagement/lib/resource/resourceManagementClient.d.ts b/tools/resourceManagement/lib/resource/resourceManagementClient.d.ts deleted file mode 100644 index 402b3e7334..0000000000 --- a/tools/resourceManagement/lib/resource/resourceManagementClient.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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. - */ - -import { ServiceClientCredentials } from 'ms-rest'; -import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; -import * as operations from "./operations"; - -declare class ResourceManagementClient extends AzureServiceClient { - /** - * Initializes a new instance of the ResourceManagementClient class. - * @constructor - * - * @class - * @param {credentials} credentials - Credentials needed for the client to connect to Azure. - * - * @param {string} subscriptionId - The ID of the target subscription. - * - * @param {string} [baseUri] - The base URI of the service. - * - * @param {object} [options] - The parameter options - * - * @param {Array} [options.filters] - Filters to be added to the request pipeline - * - * @param {object} [options.requestOptions] - Options for the underlying request object - * {@link https://github.com/request/request#requestoptions-callback Options doc} - * - * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. - * - */ - constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); - - credentials: ServiceClientCredentials; - - subscriptionId: string; - - apiVersion: string; - - acceptLanguage: string; - - longRunningOperationRetryTimeout: number; - - generateClientRequestId: boolean; - - // Operation groups - deployments: operations.Deployments; - providers: operations.Providers; - resources: operations.Resources; - resourceGroups: operations.ResourceGroups; - tags: operations.Tags; - deploymentOperations: operations.DeploymentOperations; -} - -export = ResourceManagementClient;