From 3da957e43c29add94965edaf47a0720482549467 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 19 Oct 2018 00:23:28 +0000 Subject: [PATCH 1/2] Generated from c0b2862c0002fa73fe7b3e70cb1bac9435719186 Snapshots API for DR stamps --- .../lib/models/deletedAppRestoreRequest.js | 9 + .../websiteManagement2/lib/models/index.d.ts | 6 + .../lib/models/snapshotRestoreRequest.js | 9 + .../lib/operations/index.d.ts | 304 + .../lib/operations/webApps.js | 5386 ++++++++++------- 5 files changed, 3537 insertions(+), 2177 deletions(-) diff --git a/lib/services/websiteManagement2/lib/models/deletedAppRestoreRequest.js b/lib/services/websiteManagement2/lib/models/deletedAppRestoreRequest.js index 715d8d3e51..4d5d895f02 100644 --- a/lib/services/websiteManagement2/lib/models/deletedAppRestoreRequest.js +++ b/lib/services/websiteManagement2/lib/models/deletedAppRestoreRequest.js @@ -28,6 +28,8 @@ class DeletedAppRestoreRequest extends models['ProxyOnlyResource'] { * @member {string} [snapshotTime] Point in time to restore the deleted app * from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. + * @member {boolean} [useDRSecondary] If true, the snapshot is retrieved from + * DRSecondary endpoint. */ constructor() { super(); @@ -98,6 +100,13 @@ class DeletedAppRestoreRequest extends models['ProxyOnlyResource'] { type: { name: 'String' } + }, + useDRSecondary: { + required: false, + serializedName: 'properties.useDRSecondary', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/index.d.ts b/lib/services/websiteManagement2/lib/models/index.d.ts index 0e4d9b0de5..357c9a0ecd 100644 --- a/lib/services/websiteManagement2/lib/models/index.d.ts +++ b/lib/services/websiteManagement2/lib/models/index.d.ts @@ -4540,11 +4540,14 @@ export interface CustomHostnameAnalysisResult extends ProxyOnlyResource { * @member {string} [snapshotTime] Point in time to restore the deleted app * from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. + * @member {boolean} [useDRSecondary] If true, the snapshot is retrieved from + * DRSecondary endpoint. */ export interface DeletedAppRestoreRequest extends ProxyOnlyResource { deletedSiteId?: string; recoverConfiguration?: boolean; snapshotTime?: string; + useDRSecondary?: boolean; } /** @@ -6247,6 +6250,8 @@ export interface SnapshotRecoverySource { * @member {boolean} [ignoreConflictingHostNames] If true, custom hostname * conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. + * @member {boolean} [useDRSecondary] If true, the snapshot is retrieved from + * DRSecondary endpoint. */ export interface SnapshotRestoreRequest extends ProxyOnlyResource { snapshotTime?: string; @@ -6254,6 +6259,7 @@ export interface SnapshotRestoreRequest extends ProxyOnlyResource { overwrite: boolean; recoverConfiguration?: boolean; ignoreConflictingHostNames?: boolean; + useDRSecondary?: boolean; } /** diff --git a/lib/services/websiteManagement2/lib/models/snapshotRestoreRequest.js b/lib/services/websiteManagement2/lib/models/snapshotRestoreRequest.js index ad5d840c8a..657a34f217 100644 --- a/lib/services/websiteManagement2/lib/models/snapshotRestoreRequest.js +++ b/lib/services/websiteManagement2/lib/models/snapshotRestoreRequest.js @@ -39,6 +39,8 @@ class SnapshotRestoreRequest extends models['ProxyOnlyResource'] { * @member {boolean} [ignoreConflictingHostNames] If true, custom hostname * conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. + * @member {boolean} [useDRSecondary] If true, the snapshot is retrieved from + * DRSecondary endpoint. */ constructor() { super(); @@ -124,6 +126,13 @@ class SnapshotRestoreRequest extends models['ProxyOnlyResource'] { type: { name: 'Boolean' } + }, + useDRSecondary: { + required: false, + serializedName: 'properties.useDRSecondary', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/websiteManagement2/lib/operations/index.d.ts b/lib/services/websiteManagement2/lib/operations/index.d.ts index e793a9fa19..d317be06da 100644 --- a/lib/services/websiteManagement2/lib/operations/index.d.ts +++ b/lib/services/websiteManagement2/lib/operations/index.d.ts @@ -22513,6 +22513,9 @@ export interface WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -22551,6 +22554,9 @@ export interface WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -22625,6 +22631,9 @@ export interface WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -22681,6 +22690,9 @@ export interface WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -37126,6 +37138,9 @@ export interface WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -37167,6 +37182,9 @@ export interface WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -37244,6 +37262,9 @@ export interface WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -37303,6 +37324,9 @@ export interface WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -37888,6 +37912,75 @@ export interface WebApps { listSnapshotsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @param {string} slot Website Slot. + * + * @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. + */ + listSnapshotsFromDRSecondarySlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @param {string} slot Website Slot. + * + * @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 {SnapshotCollection} - 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. + * + * {SnapshotCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} 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. + */ + listSnapshotsFromDRSecondarySlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSnapshotsFromDRSecondarySlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listSnapshotsFromDRSecondarySlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Gets the source control configuration of an app. * @@ -40216,6 +40309,71 @@ export interface WebApps { listSnapshots(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @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. + */ + listSnapshotsFromDRSecondaryWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @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 {SnapshotCollection} - 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. + * + * {SnapshotCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} 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. + */ + listSnapshotsFromDRSecondary(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSnapshotsFromDRSecondary(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listSnapshotsFromDRSecondary(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Gets the source control configuration of an app. * @@ -43950,6 +44108,9 @@ export interface WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -43988,6 +44149,9 @@ export interface WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -44062,6 +44226,9 @@ export interface WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -44118,6 +44285,9 @@ export interface WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -45882,6 +46052,9 @@ export interface WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -45923,6 +46096,9 @@ export interface WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -46000,6 +46176,9 @@ export interface WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -46059,6 +46238,9 @@ export interface WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -49408,6 +49590,67 @@ export interface WebApps { listSnapshotsSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @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. + */ + listSnapshotsFromDRSecondarySlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @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 {SnapshotCollection} - 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. + * + * {SnapshotCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} 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. + */ + listSnapshotsFromDRSecondarySlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSnapshotsFromDRSecondarySlotNext(nextPageLink: string, callback: ServiceCallback): void; + listSnapshotsFromDRSecondarySlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary List triggered web jobs for an app, or a deployment slot. * @@ -49786,6 +50029,67 @@ export interface WebApps { listSnapshotsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @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. + */ + listSnapshotsFromDRSecondaryNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @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 {SnapshotCollection} - 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. + * + * {SnapshotCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} 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. + */ + listSnapshotsFromDRSecondaryNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSnapshotsFromDRSecondaryNext(nextPageLink: string, callback: ServiceCallback): void; + listSnapshotsFromDRSecondaryNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary List triggered web jobs for an app, or a deployment slot. * diff --git a/lib/services/websiteManagement2/lib/operations/webApps.js b/lib/services/websiteManagement2/lib/operations/webApps.js index d9aff806fe..c3e8f814b0 100644 --- a/lib/services/websiteManagement2/lib/operations/webApps.js +++ b/lib/services/websiteManagement2/lib/operations/webApps.js @@ -24510,6 +24510,9 @@ function _restoreFromBackupBlob(resourceGroupName, name, request, options, callb * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -24609,6 +24612,9 @@ function _restoreFromDeletedApp(resourceGroupName, name, restoreRequest, options * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -49925,6 +49931,9 @@ function _restoreFromBackupBlobSlot(resourceGroupName, name, request, slot, opti * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -50027,6 +50036,9 @@ function _restoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slo * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -51123,18 +51135,16 @@ function _listSnapshotsSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Gets the source control configuration of an app. + * @summary Returns all Snapshots to the user from DRSecondary endpoint. * - * Gets the source control configuration of an app. + * Returns all Snapshots to the user from DRSecondary endpoint. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Website Name. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the source control configuration for the - * production slot. + * @param {string} slot Website Slot. * * @param {object} [options] Optional Parameters. * @@ -51148,13 +51158,13 @@ function _listSnapshotsSlot(resourceGroupName, name, slot, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteSourceControl} for more information. + * See {@link SnapshotCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) { +function _listSnapshotsFromDRSecondarySlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -51204,7 +51214,7 @@ function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshotsdr'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); @@ -51242,7 +51252,7 @@ function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -51278,7 +51288,7 @@ function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteSourceControl']().mapper(); + let resultMapper = new client.models['SnapshotCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -51288,80 +51298,23 @@ function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) return callback(deserializationError); } } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteSourceControl']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - // Deserialize Response - if (statusCode === 202) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteSourceControl']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError2 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError2.request = msRest.stripRequest(httpRequest); - deserializationError2.response = msRest.stripResponse(response); - return callback(deserializationError2); - } - } return callback(null, result, httpRequest, response); }); } - /** - * @summary Updates the source control configuration of an app. + * @summary Gets the source control configuration of an app. * - * Updates the source control configuration of an app. + * Gets the source control configuration of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {object} siteSourceControl JSON representation of a SiteSourceControl - * object. See example. - * - * @param {string} [siteSourceControl.repoUrl] Repository or source control - * URL. - * - * @param {string} [siteSourceControl.branch] Name of branch to use for - * deployment. - * - * @param {boolean} [siteSourceControl.isManualIntegration] true - * to limit to manual integration; false to enable continuous - * integration (which configures webhooks into online repos like GitHub). - * - * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] - * true to enable deployment rollback; otherwise, - * false. - * - * @param {boolean} [siteSourceControl.isMercurial] true for a - * Mercurial repository; false for a Git repository. - * - * @param {string} [siteSourceControl.kind] Kind of resource. - * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will update the source control configuration for the + * specified, the API will get the source control configuration for the * production slot. * * @param {object} [options] Optional Parameters. @@ -51382,90 +51335,7 @@ function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteSourceControl']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * @summary Deletes the source control configuration of an app. - * - * Deletes the source control configuration of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete the source control configuration for the - * production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callback) { +function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -51528,7 +51398,7 @@ function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callba // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -51553,7 +51423,7 @@ function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callba return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -51563,12 +51433,13 @@ function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callba try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -51581,11 +51452,63 @@ function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callba // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError2 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError2.request = msRest.stripRequest(httpRequest); + deserializationError2.response = msRest.stripResponse(response); + return callback(deserializationError2); + } + } return callback(null, result, httpRequest, response); }); } + /** * @summary Updates the source control configuration of an app. * @@ -51640,7 +51563,90 @@ function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callba * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, callback) { +function _createOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary Deletes the source control configuration of an app. + * + * Deletes the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the source control configuration for the + * production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -51672,9 +51678,6 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (siteSourceControl === null || siteSourceControl === undefined) { - throw new Error('siteSourceControl cannot be null or undefined.'); - } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -51706,7 +51709,7 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -51724,28 +51727,14 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (siteSourceControl !== null && siteSourceControl !== undefined) { - let requestModelMapper = new client.models['SiteSourceControl']().mapper(); - requestModel = client.serialize(requestModelMapper, siteSourceControl, 'siteSourceControl'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(siteSourceControl, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -51755,13 +51744,12 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -51774,74 +51762,46 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteSourceControl']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteSourceControl']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - // Deserialize Response - if (statusCode === 202) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteSourceControl']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError2 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError2.request = msRest.stripRequest(httpRequest); - deserializationError2.response = msRest.stripResponse(response); - return callback(deserializationError2); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Starts an app (or deployment slot, if specified). + * @summary Updates the source control configuration of an app. * - * Starts an app (or deployment slot, if specified). + * Updates the source control configuration of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will start the production slot. + * specified, the API will update the source control configuration for the + * production slot. * * @param {object} [options] Optional Parameters. * @@ -51854,13 +51814,14 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SiteSourceControl} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _startSlot(resourceGroupName, name, slot, options, callback) { +function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -51892,6 +51853,9 @@ function _startSlot(resourceGroupName, name, slot, options, callback) { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } + if (siteSourceControl === null || siteSourceControl === undefined) { + throw new Error('siteSourceControl cannot be null or undefined.'); + } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -51910,7 +51874,7 @@ function _startSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); @@ -51923,7 +51887,7 @@ function _startSlot(resourceGroupName, name, slot, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -51941,14 +51905,28 @@ function _startSlot(resourceGroupName, name, slot, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteSourceControl !== null && siteSourceControl !== undefined) { + let requestModelMapper = new client.models['SiteSourceControl']().mapper(); + requestModel = client.serialize(requestModelMapper, siteSourceControl, 'siteSourceControl'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteSourceControl, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -51958,12 +51936,13 @@ function _startSlot(resourceGroupName, name, slot, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -51976,15 +51955,66 @@ function _startSlot(resourceGroupName, name, slot, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError2 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError2.request = msRest.stripRequest(httpRequest); + deserializationError2.response = msRest.stripResponse(response); + return callback(deserializationError2); + } + } return callback(null, result, httpRequest, response); }); } /** - * @summary Stops an app (or deployment slot, if specified). + * @summary Starts an app (or deployment slot, if specified). * - * Stops an app (or deployment slot, if specified). + * Starts an app (or deployment slot, if specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -51992,7 +52022,7 @@ function _startSlot(resourceGroupName, name, slot, options, callback) { * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will stop the production slot. + * specified, the API will start the production slot. * * @param {object} [options] Optional Parameters. * @@ -52011,7 +52041,7 @@ function _startSlot(resourceGroupName, name, slot, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _stopSlot(resourceGroupName, name, slot, options, callback) { +function _startSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52061,7 +52091,7 @@ function _stopSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); @@ -52133,17 +52163,17 @@ function _stopSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Sync web app repository. + * @summary Stops an app (or deployment slot, if specified). * - * Sync web app repository. + * Stops an app (or deployment slot, if specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will stop the production slot. * * @param {object} [options] Optional Parameters. * @@ -52162,7 +52192,7 @@ function _stopSlot(resourceGroupName, name, slot, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { +function _stopSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52212,7 +52242,7 @@ function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); @@ -52284,17 +52314,17 @@ function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Syncs function trigger metadata to the scale controller + * @summary Sync web app repository. * - * Syncs function trigger metadata to the scale controller + * Sync web app repository. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Name of web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will restore a backup of the production slot. + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -52313,7 +52343,7 @@ function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callback) { +function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52363,7 +52393,7 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); @@ -52401,7 +52431,7 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callb return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -52435,17 +52465,17 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callb } /** - * @summary List triggered web jobs for an app, or a deployment slot. + * @summary Syncs function trigger metadata to the scale controller * - * List triggered web jobs for an app, or a deployment slot. + * Syncs function trigger metadata to the scale controller * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * specified, the API will restore a backup of the production slot. * * @param {object} [options] Optional Parameters. * @@ -52458,15 +52488,13 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callb * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TriggeredWebJobCollection} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callback) { +function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52516,7 +52544,7 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); @@ -52529,7 +52557,7 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -52554,7 +52582,7 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -52564,13 +52592,12 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -52583,41 +52610,21 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredWebJobCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Gets a triggered web job by its ID for an app, or a deployment - * slot. + * @summary List triggered web jobs for an app, or a deployment slot. * - * Gets a triggered web job by its ID for an app, or a deployment slot. + * List triggered web jobs for an app, or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Site name. * - * @param {string} webJobName Name of Web Job. - * * @param {string} slot Name of the deployment slot. If a slot is not * specified, the API deletes a deployment for the production slot. * @@ -52633,13 +52640,14 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TriggeredWebJob} for more information. + * See {@link TriggeredWebJobCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52671,9 +52679,6 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { - throw new Error('webJobName cannot be null or undefined and it must be of type string.'); - } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -52692,10 +52697,9 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -52731,7 +52735,7 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -52741,12 +52745,13 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -52766,7 +52771,7 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredWebJob']().mapper(); + let resultMapper = new client.models['TriggeredWebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -52782,10 +52787,10 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti } /** - * @summary Delete a triggered web job by its ID for an app, or a deployment + * @summary Gets a triggered web job by its ID for an app, or a deployment * slot. * - * Delete a triggered web job by its ID for an app, or a deployment slot. + * Gets a triggered web job by its ID for an app, or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -52808,13 +52813,14 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link TriggeredWebJob} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52881,7 +52887,7 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, o // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -52906,7 +52912,7 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, o return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -52934,16 +52940,33 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, o // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['TriggeredWebJob']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * @summary List a triggered web job's history for an app, or a deployment + * @summary Delete a triggered web job by its ID for an app, or a deployment * slot. * - * List a triggered web job's history for an app, or a deployment slot. + * Delete a triggered web job by its ID for an app, or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -52966,15 +52989,13 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, o * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TriggeredJobHistoryCollection} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53027,7 +53048,7 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); @@ -53041,7 +53062,7 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -53066,7 +53087,7 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -53094,35 +53115,17 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredJobHistoryCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Gets a triggered web job's history by its ID for an app, , or a - * deployment slot. - * - * Gets a triggered web job's history by its ID for an app, , or a deployment + * @summary List a triggered web job's history for an app, or a deployment * slot. * + * List a triggered web job's history for an app, or a deployment slot. + * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * @@ -53130,8 +53133,6 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl * * @param {string} webJobName Name of Web Job. * - * @param {string} id History ID. - * * @param {string} slot Name of the deployment slot. If a slot is not * specified, the API deletes a deployment for the production slot. * @@ -53147,13 +53148,14 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TriggeredJobHistory} for more information. + * See {@link TriggeredJobHistoryCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, slot, options, callback) { +function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53188,9 +53190,6 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { throw new Error('webJobName cannot be null or undefined and it must be of type string.'); } - if (id === null || id === undefined || typeof id.valueOf() !== 'string') { - throw new Error('id cannot be null or undefined and it must be of type string.'); - } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -53209,11 +53208,10 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); - requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -53284,7 +53282,7 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredJobHistory']().mapper(); + let resultMapper = new client.models['TriggeredJobHistoryCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -53300,9 +53298,11 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, } /** - * @summary Run a triggered web job for an app, or a deployment slot. + * @summary Gets a triggered web job's history by its ID for an app, , or a + * deployment slot. * - * Run a triggered web job for an app, or a deployment slot. + * Gets a triggered web job's history by its ID for an app, , or a deployment + * slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -53311,6 +53311,8 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, * * @param {string} webJobName Name of Web Job. * + * @param {string} id History ID. + * * @param {string} slot Name of the deployment slot. If a slot is not * specified, the API deletes a deployment for the production slot. * @@ -53325,13 +53327,14 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link TriggeredJobHistory} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53366,6 +53369,9 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { throw new Error('webJobName cannot be null or undefined and it must be of type string.'); } + if (id === null || id === undefined || typeof id.valueOf() !== 'string') { + throw new Error('id cannot be null or undefined and it must be of type string.'); + } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -53384,10 +53390,11 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/run'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -53398,7 +53405,7 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -53451,34 +53458,45 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['TriggeredJobHistory']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * @summary Gets the quota usage information of an app (or deployment slot, if - * specified). + * @summary Run a triggered web job for an app, or a deployment slot. * - * Gets the quota usage information of an app (or deployment slot, if - * specified). + * Run a triggered web job for an app, or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get quota information of the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] Return only information specified in the - * filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' - * or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -53488,15 +53506,13 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CsmUsageQuotaCollection} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { +function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53506,7 +53522,6 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53529,12 +53544,12 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } - if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -53550,15 +53565,13 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/run'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + filter); - } queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -53566,7 +53579,7 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -53591,7 +53604,7 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -53601,13 +53614,12 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -53620,33 +53632,17 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['CsmUsageQuotaCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Gets the virtual networks the app (or deployment slot) is connected - * to. + * @summary Gets the quota usage information of an app (or deployment slot, if + * specified). * - * Gets the virtual networks the app (or deployment slot) is connected to. + * Gets the quota usage information of an app (or deployment slot, if + * specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -53654,11 +53650,16 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get virtual network connections for the production - * slot. + * specified, the API will get quota information of the production slot. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] Return only information specified in the + * filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' + * or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and + * endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -53668,13 +53669,15 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CsmUsageQuotaCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callback) { +function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53684,6 +53687,7 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba if (!callback) { throw new Error('callback cannot be null.'); } + let filter = (options && options.filter !== undefined) ? options.filter : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53709,6 +53713,9 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -53724,12 +53731,15 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -53798,21 +53808,7 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VnetInfoElementType', - type: { - name: 'Composite', - className: 'VnetInfo' - } - } - } - }; + let resultMapper = new client.models['CsmUsageQuotaCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -53828,20 +53824,18 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba } /** - * @summary Gets a virtual network the app (or deployment slot) is connected to - * by name. + * @summary Gets the virtual networks the app (or deployment slot) is connected + * to. * - * Gets a virtual network the app (or deployment slot) is connected to by name. + * Gets the virtual networks the app (or deployment slot) is connected to. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} vnetName Name of the virtual network. - * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the named virtual network for the production + * specified, the API will get virtual network connections for the production * slot. * * @param {object} [options] Optional Parameters. @@ -53855,14 +53849,13 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link VnetInfo} for more information. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, callback) { +function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53894,9 +53887,6 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { - throw new Error('vnetName cannot be null or undefined and it must be of type string.'); - } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -53915,10 +53905,9 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -53990,7 +53979,21 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VnetInfo']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VnetInfoElementType', + type: { + name: 'Composite', + className: 'VnetInfo' + } + } + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -54006,36 +54009,21 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options } /** - * @summary Adds a Virtual Network connection to an app or slot (PUT) or - * updates the connection properties (PATCH). + * @summary Gets a virtual network the app (or deployment slot) is connected to + * by name. * - * Adds a Virtual Network connection to an app or slot (PUT) or updates the - * connection properties (PATCH). + * Gets a virtual network the app (or deployment slot) is connected to by name. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} vnetName Name of an existing Virtual Network. - * - * @param {object} connectionEnvelope Properties of the Virtual Network - * connection. See example. - * - * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's - * resource ID. - * - * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob - * containing the public key of the private key used to authenticate a - * Point-To-Site VPN connection. - * - * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by - * this Virtual Network. This should be a comma-separated list of IP addresses. - * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} vnetName Name of the virtual network. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will add or update connections for the production slot. + * specified, the API will get the named virtual network for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -54055,7 +54043,7 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, callback) { +function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -54090,9 +54078,6 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { throw new Error('vnetName cannot be null or undefined and it must be of type string.'); } - if (connectionEnvelope === null || connectionEnvelope === undefined) { - throw new Error('connectionEnvelope cannot be null or undefined.'); - } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -54125,7 +54110,7 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -54143,21 +54128,7 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (connectionEnvelope !== null && connectionEnvelope !== undefined) { - let requestModelMapper = new client.models['VnetInfo']().mapper(); - requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(connectionEnvelope, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -54215,165 +54186,6 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co }); } -/** - * @summary Deletes a connection from an app (or deployment slot to a named - * virtual network. - * - * Deletes a connection from an app (or deployment slot to a named virtual - * network. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} vnetName Name of the virtual network. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete the connection for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === null || name === undefined || typeof name.valueOf() !== 'string') { - throw new Error('name cannot be null or undefined and it must be of type string.'); - } - if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { - throw new Error('vnetName cannot be null or undefined and it must be of type string.'); - } - if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { - throw new Error('slot cannot be null or undefined and it must be of type string.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); - requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - - return callback(null, result, httpRequest, response); - }); -} - /** * @summary Adds a Virtual Network connection to an app or slot (PUT) or * updates the connection properties (PATCH). @@ -54424,7 +54236,7 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, opti * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, callback) { +function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -54494,7 +54306,7 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -54585,23 +54397,21 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection } /** - * @summary Gets an app's Virtual Network gateway. + * @summary Deletes a connection from an app (or deployment slot to a named + * virtual network. * - * Gets an app's Virtual Network gateway. + * Deletes a connection from an app (or deployment slot to a named virtual + * network. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} vnetName Name of the Virtual Network. - * - * @param {string} gatewayName Name of the gateway. Currently, the only - * supported string is "primary". + * @param {string} vnetName Name of the virtual network. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get a gateway for the production slot's Virtual - * Network. + * specified, the API will delete the connection for the production slot. * * @param {object} [options] Optional Parameters. * @@ -54614,14 +54424,13 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link VnetGateway} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, slot, options, callback) { +function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -54656,9 +54465,6 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { throw new Error('vnetName cannot be null or undefined and it must be of type string.'); } - if (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { - throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); - } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -54677,11 +54483,10 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); - requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -54692,7 +54497,7 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -54745,57 +54550,42 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VnetGateway']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it - * (PATCH). + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). * - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} vnetName Name of the Virtual Network. + * @param {string} vnetName Name of an existing Virtual Network. * - * @param {string} gatewayName Name of the gateway. Currently, the only - * supported string is "primary". + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. * - * @param {object} connectionEnvelope The properties to update this gateway - * with. + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. * - * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. * - * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN - * package can be downloaded. + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. * * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will add or update a gateway for the production slot's - * Virtual Network. + * specified, the API will add or update connections for the production slot. * * @param {object} [options] Optional Parameters. * @@ -54809,13 +54599,13 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link VnetGateway} for more information. + * See {@link VnetInfo} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options, callback) { +function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -54850,9 +54640,6 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { throw new Error('vnetName cannot be null or undefined and it must be of type string.'); } - if (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { - throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); - } if (connectionEnvelope === null || connectionEnvelope === undefined) { throw new Error('connectionEnvelope cannot be null or undefined.'); } @@ -54874,11 +54661,10 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); - requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -54889,7 +54675,7 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -54912,7 +54698,7 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN let requestModel = null; try { if (connectionEnvelope !== null && connectionEnvelope !== undefined) { - let requestModelMapper = new client.models['VnetGateway']().mapper(); + let requestModelMapper = new client.models['VnetInfo']().mapper(); requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); requestContent = JSON.stringify(requestModel); } @@ -54964,7 +54750,7 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VnetGateway']().mapper(); + let resultMapper = new client.models['VnetInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -54980,10 +54766,9 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN } /** - * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it - * (PATCH). + * @summary Gets an app's Virtual Network gateway. * - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * Gets an app's Virtual Network gateway. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -54995,19 +54780,9 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN * @param {string} gatewayName Name of the gateway. Currently, the only * supported string is "primary". * - * @param {object} connectionEnvelope The properties to update this gateway - * with. - * - * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. - * - * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN - * package can be downloaded. - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will add or update a gateway for the production slot's - * Virtual Network. + * specified, the API will get a gateway for the production slot's Virtual + * Network. * * @param {object} [options] Optional Parameters. * @@ -55027,7 +54802,7 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options, callback) { +function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -55065,9 +54840,6 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat if (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); } - if (connectionEnvelope === null || connectionEnvelope === undefined) { - throw new Error('connectionEnvelope cannot be null or undefined.'); - } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -55101,7 +54873,7 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -55119,28 +54891,14 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (connectionEnvelope !== null && connectionEnvelope !== undefined) { - let requestModelMapper = new client.models['VnetGateway']().mapper(); - requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(connectionEnvelope, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -55150,13 +54908,12 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -55192,17 +54949,34 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat } /** - * @summary List webjobs for an app, or a deployment slot. + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). * - * List webjobs for an app, or a deployment slot. + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. + * specified, the API will add or update a gateway for the production slot's + * Virtual Network. * * @param {object} [options] Optional Parameters. * @@ -55216,13 +54990,13 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link WebJobCollection} for more information. + * See {@link VnetGateway} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { +function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -55254,6 +55028,15 @@ function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { + throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -55272,9 +55055,11 @@ function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -55285,7 +55070,7 @@ function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -55303,7 +55088,21 @@ function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['VnetGateway']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -55346,7 +55145,7 @@ function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebJobCollection']().mapper(); + let resultMapper = new client.models['VnetGateway']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -55362,19 +55161,34 @@ function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Get webjob information for an app, or a deployment slot. + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). * - * Get webjob information for an app, or a deployment slot. + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of the web job. + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. + * specified, the API will add or update a gateway for the production slot's + * Virtual Network. * * @param {object} [options] Optional Parameters. * @@ -55388,13 +55202,13 @@ function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link WebJob} for more information. + * See {@link VnetGateway} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -55426,8 +55240,14 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { - throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { + throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); @@ -55447,10 +55267,11 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -55461,7 +55282,7 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -55479,7 +55300,21 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['VnetGateway']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -55522,7 +55357,7 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebJob']().mapper(); + let resultMapper = new client.models['VnetGateway']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -55538,24 +55373,17 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call } /** - * @summary Get the difference in configuration settings between two web app - * slots. + * @summary List webjobs for an app, or a deployment slot. * - * Get the difference in configuration settings between two web app slots. + * List webjobs for an app, or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {object} slotSwapEntity JSON object that contains the target slot - * name. See example. - * - * @param {string} slotSwapEntity.targetSlot Destination deployment slot during - * swap operation. + * @param {string} name Site name. * - * @param {boolean} slotSwapEntity.preserveVnet true to preserve - * Virtual Network to the slot during swap; otherwise, false. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -55569,14 +55397,13 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SlotDifferenceCollection} for more - * information. + * See {@link WebJobCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, options, callback) { +function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -55608,8 +55435,8 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (slotSwapEntity === null || slotSwapEntity === undefined) { - throw new Error('slotSwapEntity cannot be null or undefined.'); + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); @@ -55626,9 +55453,10 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -55638,7 +55466,7 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -55656,21 +55484,7 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (slotSwapEntity !== null && slotSwapEntity !== undefined) { - let requestModelMapper = new client.models['CsmSlotEntity']().mapper(); - requestModel = client.serialize(requestModelMapper, slotSwapEntity, 'slotSwapEntity'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(slotSwapEntity, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -55713,7 +55527,7 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SlotDifferenceCollection']().mapper(); + let resultMapper = new client.models['WebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -55728,90 +55542,20 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt }); } - /** - * @summary Swaps two deployment slots of an app. + * @summary Get webjob information for an app, or a deployment slot. * - * Swaps two deployment slots of an app. + * Get webjob information for an app, or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {object} slotSwapEntity JSON object that contains the target slot - * name. See example. - * - * @param {string} slotSwapEntity.targetSlot Destination deployment slot during - * swap operation. - * - * @param {boolean} slotSwapEntity.preserveVnet true to preserve - * Virtual Network to the slot during swap; otherwise, false. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _swapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * @summary Returns all Snapshots to the user. - * - * Returns all Snapshots to the user. + * @param {string} name Site name. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {string} webJobName Name of the web job. * - * @param {string} name Website Name. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -55825,13 +55569,13 @@ function _swapSlotWithProduction(resourceGroupName, name, slotSwapEntity, option * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SnapshotCollection} for more information. + * See {@link WebJob} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listSnapshots(resourceGroupName, name, options, callback) { +function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -55863,6 +55607,12 @@ function _listSnapshots(resourceGroupName, name, options, callback) { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -55878,9 +55628,11 @@ function _listSnapshots(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -55951,7 +55703,7 @@ function _listSnapshots(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SnapshotCollection']().mapper(); + let resultMapper = new client.models['WebJob']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -55967,15 +55719,25 @@ function _listSnapshots(resourceGroupName, name, options, callback) { } /** - * @summary Gets the source control configuration of an app. + * @summary Get the difference in configuration settings between two web app + * slots. * - * Gets the source control configuration of an app. + * Get the difference in configuration settings between two web app slots. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -55988,13 +55750,14 @@ function _listSnapshots(resourceGroupName, name, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteSourceControl} for more information. + * See {@link SlotDifferenceCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getSourceControl(resourceGroupName, name, options, callback) { +function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -56026,6 +55789,9 @@ function _getSourceControl(resourceGroupName, name, options, callback) { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } + if (slotSwapEntity === null || slotSwapEntity === undefined) { + throw new Error('slotSwapEntity cannot be null or undefined.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -56041,7 +55807,7 @@ function _getSourceControl(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); @@ -56053,7 +55819,7 @@ function _getSourceControl(resourceGroupName, name, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -56071,14 +55837,28 @@ function _getSourceControl(resourceGroupName, name, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (slotSwapEntity !== null && slotSwapEntity !== undefined) { + let requestModelMapper = new client.models['CsmSlotEntity']().mapper(); + requestModel = client.serialize(requestModelMapper, slotSwapEntity, 'slotSwapEntity'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(slotSwapEntity, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -56114,7 +55894,7 @@ function _getSourceControl(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteSourceControl']().mapper(); + let resultMapper = new client.models['SlotDifferenceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -56124,40 +55904,6 @@ function _getSourceControl(resourceGroupName, name, options, callback) { return callback(deserializationError); } } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteSourceControl']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - // Deserialize Response - if (statusCode === 202) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteSourceControl']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError2 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError2.request = msRest.stripRequest(httpRequest); - deserializationError2.response = msRest.stripResponse(response); - return callback(deserializationError2); - } - } return callback(null, result, httpRequest, response); }); @@ -56165,36 +55911,23 @@ function _getSourceControl(resourceGroupName, name, options, callback) { /** - * @summary Updates the source control configuration of an app. + * @summary Swaps two deployment slots of an app. * - * Updates the source control configuration of an app. + * Swaps two deployment slots of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {object} siteSourceControl JSON representation of a SiteSourceControl - * object. See example. - * - * @param {string} [siteSourceControl.repoUrl] Repository or source control - * URL. - * - * @param {string} [siteSourceControl.branch] Name of branch to use for - * deployment. - * - * @param {boolean} [siteSourceControl.isManualIntegration] true - * to limit to manual integration; false to enable continuous - * integration (which configures webhooks into online repos like GitHub). - * - * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] - * true to enable deployment rollback; otherwise, - * false. + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. * - * @param {boolean} [siteSourceControl.isMercurial] true for a - * Mercurial repository; false for a Git repository. + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. * - * @param {string} [siteSourceControl.kind] Kind of resource. + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. * * @param {object} [options] Optional Parameters. * @@ -56207,14 +55940,13 @@ function _getSourceControl(resourceGroupName, name, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteSourceControl} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdateSourceControl(resourceGroupName, name, siteSourceControl, options, callback) { +function _swapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -56227,7 +55959,7 @@ function _createOrUpdateSourceControl(resourceGroupName, name, siteSourceControl } // Send request - this.beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceControl, options, (err, parsedResult, httpRequest, response) => { + this.beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -56246,20 +55978,6 @@ function _createOrUpdateSourceControl(resourceGroupName, name, siteSourceControl if (responseBody === '') responseBody = null; // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteSourceControl']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -56267,14 +55985,14 @@ function _createOrUpdateSourceControl(resourceGroupName, name, siteSourceControl } /** - * @summary Deletes the source control configuration of an app. + * @summary Returns all Snapshots to the user. * - * Deletes the source control configuration of an app. + * Returns all Snapshots to the user. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Website Name. * * @param {object} [options] Optional Parameters. * @@ -56287,13 +56005,639 @@ function _createOrUpdateSourceControl(resourceGroupName, name, siteSourceControl * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteSourceControl(resourceGroupName, name, options, callback) { +function _listSnapshots(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SnapshotCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listSnapshotsFromDRSecondary(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshotsdr'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SnapshotCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets the source control configuration of an app. + * + * Gets the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SiteSourceControl} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getSourceControl(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError2 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError2.request = msRest.stripRequest(httpRequest); + deserializationError2.response = msRest.stripResponse(response); + return callback(deserializationError2); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SiteSourceControl} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdateSourceControl(resourceGroupName, name, siteSourceControl, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceControl, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary Deletes the source control configuration of an app. + * + * Deletes the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteSourceControl(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -62603,6 +62947,9 @@ function _beginRestoreFromBackupBlob(resourceGroupName, name, request, options, * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -62797,6 +63144,9 @@ function _beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, op * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -65068,8 +65418,398 @@ function _beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, slot, if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (request === null || request === undefined) { - throw new Error('request cannot be null or undefined.'); + if (request === null || request === undefined) { + throw new Error('request cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (request !== null && request !== undefined) { + let requestModelMapper = new client.models['RestoreRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, request, 'request'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(request, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (restoreRequest === null || restoreRequest === undefined) { + throw new Error('restoreRequest cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (restoreRequest !== null && restoreRequest !== undefined) { + let requestModelMapper = new client.models['DeletedAppRestoreRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, restoreRequest, 'restoreRequest'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(restoreRequest, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (restoreRequest === null || restoreRequest === undefined) { + throw new Error('restoreRequest cannot be null or undefined.'); } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); @@ -65089,7 +65829,7 @@ function _beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, slot, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); @@ -65124,14 +65864,14 @@ function _beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, slot, let requestContent = null; let requestModel = null; try { - if (request !== null && request !== undefined) { - let requestModelMapper = new client.models['RestoreRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, request, 'request'); + if (restoreRequest !== null && restoreRequest !== undefined) { + let requestModelMapper = new client.models['SnapshotRestoreRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, restoreRequest, 'restoreRequest'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(request, null, 2)}.`); + `payload - ${JSON.stringify(restoreRequest, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -65175,32 +65915,19 @@ function _beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, slot, } /** - * @summary Restores a deleted web app to this web app. + * @summary Install site extension on a web site, or a deployment slot. * - * Restores a deleted web app to this web app. + * Install site extension on a web site, or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. - * - * @param {object} restoreRequest Deleted web app restore information. - * - * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the - * deleted app. Example: - * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} - * - * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site - * configuration, in addition to content, will be restored. - * - * @param {string} [restoreRequest.snapshotTime] Point in time to restore the - * deleted app from, formatted as a DateTime string. - * If unspecified, default value is the time that the app was deleted. + * @param {string} name Site name. * - * @param {string} [restoreRequest.kind] Kind of resource. + * @param {string} siteExtensionId Site extension name. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -65213,13 +65940,14 @@ function _beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, slot, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SiteExtensionInfo} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, callback) { +function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -65251,8 +65979,8 @@ function _beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (restoreRequest === null || restoreRequest === undefined) { - throw new Error('restoreRequest cannot be null or undefined.'); + if (siteExtensionId === null || siteExtensionId === undefined || typeof siteExtensionId.valueOf() !== 'string') { + throw new Error('siteExtensionId cannot be null or undefined and it must be of type string.'); } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); @@ -65272,9 +66000,10 @@ function _beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{siteExtensionId}', encodeURIComponent(siteExtensionId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -65285,7 +66014,7 @@ function _beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -65303,28 +66032,14 @@ function _beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (restoreRequest !== null && restoreRequest !== undefined) { - let requestModelMapper = new client.models['DeletedAppRestoreRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, restoreRequest, 'restoreRequest'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(restoreRequest, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 429) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -65352,56 +66067,66 @@ function _beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteExtensionInfo']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteExtensionInfo']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } return callback(null, result, httpRequest, response); }); } /** - * @summary Restores a web app from a snapshot. + * @summary Swaps two deployment slots of an app. * - * Restores a web app from a snapshot. + * Swaps two deployment slots of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. - * - * @param {object} restoreRequest Snapshot restore settings. Snapshot - * information can be obtained by calling GetDeletedSites or GetSiteSnapshots - * API. - * - * @param {string} [restoreRequest.snapshotTime] Point in time in which the app - * restore should be done, formatted as a DateTime string. - * - * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web - * app that snapshot contents will be retrieved from. - * If empty, the targeted web app will be used as the source. - * - * @param {string} [restoreRequest.recoverySource.location] Geographical - * location of the source web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the - * source app. - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} - * for production slots and - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} - * for other slots. - * - * @param {boolean} restoreRequest.overwrite If true the restore - * operation can overwrite source app; otherwise, false. + * @param {string} name Name of the app. * - * @param {boolean} [restoreRequest.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. * - * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom - * hostname conflicts will be ignored when recovering to a target web app. - * This setting is only necessary when RecoverConfiguration is enabled. + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. * - * @param {string} [restoreRequest.kind] Kind of resource. + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. * * @param {object} [options] Optional Parameters. * @@ -65420,7 +66145,7 @@ function _beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, callback) { +function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -65452,8 +66177,8 @@ function _beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (restoreRequest === null || restoreRequest === undefined) { - throw new Error('restoreRequest cannot be null or undefined.'); + if (slotSwapEntity === null || slotSwapEntity === undefined) { + throw new Error('slotSwapEntity cannot be null or undefined.'); } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); @@ -65473,7 +66198,7 @@ function _beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); @@ -65508,14 +66233,14 @@ function _beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot let requestContent = null; let requestModel = null; try { - if (restoreRequest !== null && restoreRequest !== undefined) { - let requestModelMapper = new client.models['SnapshotRestoreRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, restoreRequest, 'restoreRequest'); + if (slotSwapEntity !== null && slotSwapEntity !== undefined) { + let requestModelMapper = new client.models['CsmSlotEntity']().mapper(); + requestModel = client.serialize(requestModelMapper, slotSwapEntity, 'slotSwapEntity'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(restoreRequest, null, 2)}.`); + `payload - ${JSON.stringify(slotSwapEntity, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -65559,19 +66284,40 @@ function _beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot } /** - * @summary Install site extension on a web site, or a deployment slot. + * @summary Updates the source control configuration of an app. * - * Install site extension on a web site, or a deployment slot. + * Updates the source control configuration of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of the app. * - * @param {string} siteExtensionId Site extension name. + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * specified, the API will update the source control configuration for the + * production slot. * * @param {object} [options] Optional Parameters. * @@ -65585,13 +66331,13 @@ function _beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteExtensionInfo} for more information. + * See {@link SiteSourceControl} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { +function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -65623,8 +66369,8 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (siteExtensionId === null || siteExtensionId === undefined || typeof siteExtensionId.valueOf() !== 'string') { - throw new Error('siteExtensionId cannot be null or undefined and it must be of type string.'); + if (siteSourceControl === null || siteSourceControl === undefined) { + throw new Error('siteSourceControl cannot be null or undefined.'); } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); @@ -65644,10 +66390,9 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{siteExtensionId}', encodeURIComponent(siteExtensionId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -65676,14 +66421,28 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteSourceControl !== null && siteSourceControl !== undefined) { + let requestModelMapper = new client.models['SiteSourceControl']().mapper(); + requestModel = client.serialize(requestModelMapper, siteSourceControl, 'siteSourceControl'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteSourceControl, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 429) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -65693,12 +66452,13 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -65718,7 +66478,7 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteExtensionInfo']().mapper(); + let resultMapper = new client.models['SiteSourceControl']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -65735,7 +66495,7 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteExtensionInfo']().mapper(); + let resultMapper = new client.models['SiteSourceControl']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -65745,6 +66505,23 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId return callback(deserializationError1); } } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError2 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError2.request = msRest.stripRequest(httpRequest); + deserializationError2.response = msRest.stripResponse(response); + return callback(deserializationError2); + } + } return callback(null, result, httpRequest, response); }); @@ -65769,9 +66546,6 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId * @param {boolean} slotSwapEntity.preserveVnet true to preserve * Virtual Network to the slot during swap; otherwise, false. * - * @param {string} slot Name of the source slot. If a slot is not specified, - * the production slot is used as the source slot. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -65789,7 +66563,7 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, callback) { +function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -65824,9 +66598,6 @@ function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, optio if (slotSwapEntity === null || slotSwapEntity === undefined) { throw new Error('slotSwapEntity cannot be null or undefined.'); } - if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { - throw new Error('slot cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -65842,10 +66613,9 @@ function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, optio // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -65959,10 +66729,6 @@ function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, optio * * @param {string} [siteSourceControl.kind] Kind of resource. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will update the source control configuration for the - * production slot. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -65981,7 +66747,7 @@ function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, optio * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, callback) { +function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceControl, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -66016,9 +66782,6 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour if (siteSourceControl === null || siteSourceControl === undefined) { throw new Error('siteSourceControl cannot be null or undefined.'); } - if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { - throw new Error('slot cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -66034,10 +66797,9 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -66172,23 +66934,12 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour } /** - * @summary Swaps two deployment slots of an app. - * - * Swaps two deployment slots of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} slotSwapEntity JSON object that contains the target slot - * name. See example. + * @summary Get all apps for a subscription. * - * @param {string} slotSwapEntity.targetSlot Destination deployment slot during - * swap operation. + * Get all apps for a subscription. * - * @param {boolean} slotSwapEntity.preserveVnet true to preserve - * Virtual Network to the slot during swap; otherwise, false. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -66201,13 +66952,14 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, callback) { +function _listNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -66219,34 +66971,8 @@ function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, o } // Validate try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === null || name === undefined || typeof name.valueOf() !== 'string') { - throw new Error('name cannot be null or undefined and it must be of type string.'); - } - if (slotSwapEntity === null || slotSwapEntity === undefined) { - throw new Error('slotSwapEntity cannot be null or undefined.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -66256,20 +66982,12 @@ function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, o } // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -66287,28 +67005,14 @@ function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, o } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (slotSwapEntity !== null && slotSwapEntity !== undefined) { - let requestModelMapper = new client.models['CsmSlotEntity']().mapper(); - requestModel = client.serialize(requestModelMapper, slotSwapEntity, 'slotSwapEntity'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(slotSwapEntity, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -66318,12 +67022,13 @@ function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, o try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -66336,42 +67041,165 @@ function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, o // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebAppCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * @summary Updates the source control configuration of an app. + * @summary Gets all web, mobile, and API apps in the specified resource group. * - * Updates the source control configuration of an app. + * Gets all web, mobile, and API apps in the specified resource group. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} name Name of the app. + * @param {object} [options] Optional Parameters. * - * @param {object} siteSourceControl JSON representation of a SiteSourceControl - * object. See example. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [siteSourceControl.repoUrl] Repository or source control - * URL. + * @param {function} callback - The callback. * - * @param {string} [siteSourceControl.branch] Name of branch to use for - * deployment. + * @returns {function} callback(err, result, request, response) * - * @param {boolean} [siteSourceControl.isManualIntegration] true - * to limit to manual integration; false to enable continuous - * integration (which configures webhooks into online repos like GitHub). + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] - * true to enable deployment rollback; otherwise, - * false. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} for more information. * - * @param {boolean} [siteSourceControl.isMercurial] true for a - * Mercurial repository; false for a Git repository. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [siteSourceControl.kind] Kind of resource. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroupNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebAppCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets existing backups of an app. + * + * Gets existing backups of an app. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -66385,13 +67213,13 @@ function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, o * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteSourceControl} for more information. + * See {@link BackupItemCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceControl, options, callback) { +function _listBackupsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -66403,34 +67231,8 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo } // Validate try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === null || name === undefined || typeof name.valueOf() !== 'string') { - throw new Error('name cannot be null or undefined and it must be of type string.'); - } - if (siteSourceControl === null || siteSourceControl === undefined) { - throw new Error('siteSourceControl cannot be null or undefined.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -66440,20 +67242,12 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo } // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -66471,28 +67265,14 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (siteSourceControl !== null && siteSourceControl !== undefined) { - let requestModelMapper = new client.models['SiteSourceControl']().mapper(); - requestModel = client.serialize(requestModelMapper, siteSourceControl, 'siteSourceControl'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(siteSourceControl, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -66528,7 +67308,7 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteSourceControl']().mapper(); + let resultMapper = new client.models['BackupItemCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -66538,38 +67318,268 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo return callback(deserializationError); } } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List the configurations of an app + * + * List the configurations of an app + * + * @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 {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SiteConfigResourceCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listConfigurationsNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteSourceControl']().mapper(); + let resultMapper = new client.models['SiteConfigResourceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets a list of web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @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 {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SiteConfigurationSnapshotInfoCollection} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listConfigurationSnapshotInfoNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); } + return callback(error); } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 202) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteSourceControl']().mapper(); + let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { - let deserializationError2 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError2.request = msRest.stripRequest(httpRequest); - deserializationError2.response = msRest.stripResponse(response); - return callback(deserializationError2); + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); } } @@ -66578,9 +67588,9 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo } /** - * @summary Get all apps for a subscription. + * @summary List continuous web jobs for an app, or a deployment slot. * - * Get all apps for a subscription. + * List continuous web jobs for an app, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -66597,13 +67607,14 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link WebAppCollection} for more information. + * See {@link ContinuousWebJobCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listNext(nextPageLink, options, callback) { +function _listContinuousWebJobsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -66692,7 +67703,7 @@ function _listNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebAppCollection']().mapper(); + let resultMapper = new client.models['ContinuousWebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -66708,9 +67719,9 @@ function _listNext(nextPageLink, options, callback) { } /** - * @summary Gets all web, mobile, and API apps in the specified resource group. + * @summary List deployments for an app, or a deployment slot. * - * Gets all web, mobile, and API apps in the specified resource group. + * List deployments for an app, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -66727,13 +67738,13 @@ function _listNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link WebAppCollection} for more information. + * See {@link DeploymentCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByResourceGroupNext(nextPageLink, options, callback) { +function _listDeploymentsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -66822,7 +67833,7 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebAppCollection']().mapper(); + let resultMapper = new client.models['DeploymentCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -66838,9 +67849,9 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { } /** - * @summary Gets existing backups of an app. + * @summary Lists ownership identifiers for domain associated with web app. * - * Gets existing backups of an app. + * Lists ownership identifiers for domain associated with web app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -66857,13 +67868,13 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link BackupItemCollection} for more information. + * See {@link IdentifierCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listBackupsNext(nextPageLink, options, callback) { +function _listDomainOwnershipIdentifiersNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -66952,7 +67963,7 @@ function _listBackupsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupItemCollection']().mapper(); + let resultMapper = new client.models['IdentifierCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -66968,9 +67979,9 @@ function _listBackupsNext(nextPageLink, options, callback) { } /** - * @summary List the configurations of an app + * @summary List the functions for a web site, or a deployment slot. * - * List the configurations of an app + * List the functions for a web site, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -66987,14 +67998,14 @@ function _listBackupsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteConfigResourceCollection} for more + * See {@link FunctionEnvelopeCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listConfigurationsNext(nextPageLink, options, callback) { +function _listFunctionsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -67047,7 +68058,7 @@ function _listConfigurationsNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -67057,13 +68068,12 @@ function _listConfigurationsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -67083,7 +68093,7 @@ function _listConfigurationsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigResourceCollection']().mapper(); + let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -67099,11 +68109,9 @@ function _listConfigurationsNext(nextPageLink, options, callback) { } /** - * @summary Gets a list of web app configuration snapshots identifiers. Each - * element of the list contains a timestamp and the ID of the snapshot. + * @summary Get hostname bindings for an app or a deployment slot. * - * Gets a list of web app configuration snapshots identifiers. Each element of - * the list contains a timestamp and the ID of the snapshot. + * Get hostname bindings for an app or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -67120,14 +68128,14 @@ function _listConfigurationsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteConfigurationSnapshotInfoCollection} for - * more information. + * See {@link HostNameBindingCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listConfigurationSnapshotInfoNext(nextPageLink, options, callback) { +function _listHostNameBindingsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -67216,7 +68224,7 @@ function _listConfigurationSnapshotInfoNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); + let resultMapper = new client.models['HostNameBindingCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -67232,9 +68240,9 @@ function _listConfigurationSnapshotInfoNext(nextPageLink, options, callback) { } /** - * @summary List continuous web jobs for an app, or a deployment slot. + * @summary Gets all scale-out instances of an app. * - * List continuous web jobs for an app, or a deployment slot. + * Gets all scale-out instances of an app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -67251,14 +68259,14 @@ function _listConfigurationSnapshotInfoNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ContinuousWebJobCollection} for more + * See {@link WebAppInstanceCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listContinuousWebJobsNext(nextPageLink, options, callback) { +function _listInstanceIdentifiersNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -67347,7 +68355,7 @@ function _listContinuousWebJobsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ContinuousWebJobCollection']().mapper(); + let resultMapper = new client.models['WebAppInstanceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -67363,9 +68371,11 @@ function _listContinuousWebJobsNext(nextPageLink, options, callback) { } /** - * @summary List deployments for an app, or a deployment slot. + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. * - * List deployments for an app, or a deployment slot. + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -67382,13 +68392,13 @@ function _listContinuousWebJobsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeploymentCollection} for more information. + * See {@link ProcessInfoCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listDeploymentsNext(nextPageLink, options, callback) { +function _listInstanceProcessesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -67441,7 +68451,7 @@ function _listDeploymentsNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -67451,13 +68461,12 @@ function _listDeploymentsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -67477,7 +68486,7 @@ function _listDeploymentsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DeploymentCollection']().mapper(); + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -67493,9 +68502,11 @@ function _listDeploymentsNext(nextPageLink, options, callback) { } /** - * @summary Lists ownership identifiers for domain associated with web app. + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * Lists ownership identifiers for domain associated with web app. + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -67512,13 +68523,14 @@ function _listDeploymentsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link IdentifierCollection} for more information. + * See {@link ProcessModuleInfoCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listDomainOwnershipIdentifiersNext(nextPageLink, options, callback) { +function _listInstanceProcessModulesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -67571,7 +68583,7 @@ function _listDomainOwnershipIdentifiersNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -67581,13 +68593,12 @@ function _listDomainOwnershipIdentifiersNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -67607,7 +68618,7 @@ function _listDomainOwnershipIdentifiersNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['IdentifierCollection']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -67623,9 +68634,11 @@ function _listDomainOwnershipIdentifiersNext(nextPageLink, options, callback) { } /** - * @summary List the functions for a web site, or a deployment slot. + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. * - * List the functions for a web site, or a deployment slot. + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -67642,14 +68655,14 @@ function _listDomainOwnershipIdentifiersNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link FunctionEnvelopeCollection} for more + * See {@link ProcessThreadInfoCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listFunctionsNext(nextPageLink, options, callback) { +function _listInstanceProcessThreadsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -67737,7 +68750,7 @@ function _listFunctionsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -67753,9 +68766,10 @@ function _listFunctionsNext(nextPageLink, options, callback) { } /** - * @summary Get hostname bindings for an app or a deployment slot. + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). * - * Get hostname bindings for an app or a deployment slot. + * Gets all metric definitions of an app (or deployment slot, if specified). * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -67772,14 +68786,14 @@ function _listFunctionsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link HostNameBindingCollection} for more + * See {@link ResourceMetricDefinitionCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listHostNameBindingsNext(nextPageLink, options, callback) { +function _listMetricDefinitionsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -67868,7 +68882,7 @@ function _listHostNameBindingsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HostNameBindingCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -67884,9 +68898,10 @@ function _listHostNameBindingsNext(nextPageLink, options, callback) { } /** - * @summary Gets all scale-out instances of an app. + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). * - * Gets all scale-out instances of an app. + * Gets performance metrics of an app (or deployment slot, if specified). * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -67903,14 +68918,14 @@ function _listHostNameBindingsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link WebAppInstanceCollection} for more + * See {@link ResourceMetricCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listInstanceIdentifiersNext(nextPageLink, options, callback) { +function _listMetricsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -67999,7 +69014,7 @@ function _listInstanceIdentifiersNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebAppInstanceCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -68015,11 +69030,9 @@ function _listInstanceIdentifiersNext(nextPageLink, options, callback) { } /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. + * @summary Gets perfmon counters for web app. * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. + * Gets perfmon counters for web app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -68036,13 +69049,14 @@ function _listInstanceIdentifiersNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfoCollection} for more information. + * See {@link PerfMonCounterCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listInstanceProcessesNext(nextPageLink, options, callback) { +function _listPerfMonCountersNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -68095,7 +69109,7 @@ function _listInstanceProcessesNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -68105,12 +69119,13 @@ function _listInstanceProcessesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -68130,7 +69145,7 @@ function _listInstanceProcessesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -68146,11 +69161,11 @@ function _listInstanceProcessesNext(nextPageLink, options, callback) { } /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -68167,14 +69182,13 @@ function _listInstanceProcessesNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfoCollection} for more - * information. + * See {@link ProcessInfoCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listInstanceProcessModulesNext(nextPageLink, options, callback) { +function _listProcessesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -68262,7 +69276,7 @@ function _listInstanceProcessModulesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -68278,11 +69292,11 @@ function _listInstanceProcessModulesNext(nextPageLink, options, callback) { } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -68299,14 +69313,14 @@ function _listInstanceProcessModulesNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfoCollection} for more + * See {@link ProcessModuleInfoCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listInstanceProcessThreadsNext(nextPageLink, options, callback) { +function _listProcessModulesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -68394,139 +69408,7 @@ function _listInstanceProcessThreadsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). - * - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @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 {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceMetricDefinitionCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _listMetricDefinitionsNext(nextPageLink, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -68542,10 +69424,11 @@ function _listMetricDefinitionsNext(nextPageLink, options, callback) { } /** - * @summary Gets performance metrics of an app (or deployment slot, if - * specified). + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. * - * Gets performance metrics of an app (or deployment slot, if specified). + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -68562,14 +69445,14 @@ function _listMetricDefinitionsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceMetricCollection} for more + * See {@link ProcessThreadInfoCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listMetricsNext(nextPageLink, options, callback) { +function _listProcessThreadsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -68622,7 +69505,7 @@ function _listMetricsNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -68632,13 +69515,12 @@ function _listMetricsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -68658,7 +69540,7 @@ function _listMetricsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricCollection']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -68674,9 +69556,9 @@ function _listMetricsNext(nextPageLink, options, callback) { } /** - * @summary Gets perfmon counters for web app. + * @summary Get public certificates for an app or a deployment slot. * - * Gets perfmon counters for web app. + * Get public certificates for an app or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -68693,14 +69575,14 @@ function _listMetricsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PerfMonCounterCollection} for more + * See {@link PublicCertificateCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listPerfMonCountersNext(nextPageLink, options, callback) { +function _listPublicCertificatesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -68789,138 +69671,7 @@ function _listPerfMonCountersNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. - * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. - * - * @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 {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfoCollection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _listProcessesNext(nextPageLink, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = new client.models['PublicCertificateCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -68936,11 +69687,9 @@ function _listProcessesNext(nextPageLink, options, callback) { } /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Get list of siteextensions for a web site, or a deployment slot. * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. + * Get list of siteextensions for a web site, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -68957,14 +69706,14 @@ function _listProcessesNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfoCollection} for more + * See {@link SiteExtensionInfoCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listProcessModulesNext(nextPageLink, options, callback) { +function _listSiteExtensionsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -69052,7 +69801,7 @@ function _listProcessModulesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + let resultMapper = new client.models['SiteExtensionInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -69068,11 +69817,9 @@ function _listProcessModulesNext(nextPageLink, options, callback) { } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Gets an app's deployment slots. * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * Gets an app's deployment slots. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -69089,14 +69836,13 @@ function _listProcessModulesNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfoCollection} for more - * information. + * See {@link WebAppCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listProcessThreadsNext(nextPageLink, options, callback) { +function _listSlotsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -69149,7 +69895,7 @@ function _listProcessThreadsNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -69159,12 +69905,13 @@ function _listProcessThreadsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -69184,7 +69931,7 @@ function _listProcessThreadsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); + let resultMapper = new client.models['WebAppCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -69200,9 +69947,9 @@ function _listProcessThreadsNext(nextPageLink, options, callback) { } /** - * @summary Get public certificates for an app or a deployment slot. + * @summary Gets existing backups of an app. * - * Get public certificates for an app or a deployment slot. + * Gets existing backups of an app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -69219,14 +69966,13 @@ function _listProcessThreadsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PublicCertificateCollection} for more - * information. + * See {@link BackupItemCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listPublicCertificatesNext(nextPageLink, options, callback) { +function _listBackupsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -69315,7 +70061,7 @@ function _listPublicCertificatesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicCertificateCollection']().mapper(); + let resultMapper = new client.models['BackupItemCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -69331,9 +70077,9 @@ function _listPublicCertificatesNext(nextPageLink, options, callback) { } /** - * @summary Get list of siteextensions for a web site, or a deployment slot. + * @summary List the configurations of an app * - * Get list of siteextensions for a web site, or a deployment slot. + * List the configurations of an app * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -69350,14 +70096,14 @@ function _listPublicCertificatesNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteExtensionInfoCollection} for more + * See {@link SiteConfigResourceCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listSiteExtensionsNext(nextPageLink, options, callback) { +function _listConfigurationsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -69410,7 +70156,7 @@ function _listSiteExtensionsNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -69420,12 +70166,13 @@ function _listSiteExtensionsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -69445,7 +70192,7 @@ function _listSiteExtensionsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteExtensionInfoCollection']().mapper(); + let resultMapper = new client.models['SiteConfigResourceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -69461,9 +70208,11 @@ function _listSiteExtensionsNext(nextPageLink, options, callback) { } /** - * @summary Gets an app's deployment slots. + * @summary Gets a list of web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. * - * Gets an app's deployment slots. + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -69480,13 +70229,14 @@ function _listSiteExtensionsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link WebAppCollection} for more information. + * See {@link SiteConfigurationSnapshotInfoCollection} for + * more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listSlotsNext(nextPageLink, options, callback) { +function _listConfigurationSnapshotInfoSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -69575,7 +70325,7 @@ function _listSlotsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebAppCollection']().mapper(); + let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -69591,9 +70341,9 @@ function _listSlotsNext(nextPageLink, options, callback) { } /** - * @summary Gets existing backups of an app. + * @summary List continuous web jobs for an app, or a deployment slot. * - * Gets existing backups of an app. + * List continuous web jobs for an app, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -69610,13 +70360,14 @@ function _listSlotsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link BackupItemCollection} for more information. + * See {@link ContinuousWebJobCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listBackupsSlotNext(nextPageLink, options, callback) { +function _listContinuousWebJobsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -69705,7 +70456,7 @@ function _listBackupsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupItemCollection']().mapper(); + let resultMapper = new client.models['ContinuousWebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -69721,9 +70472,9 @@ function _listBackupsSlotNext(nextPageLink, options, callback) { } /** - * @summary List the configurations of an app + * @summary List deployments for an app, or a deployment slot. * - * List the configurations of an app + * List deployments for an app, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -69740,14 +70491,13 @@ function _listBackupsSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteConfigResourceCollection} for more - * information. + * See {@link DeploymentCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listConfigurationsSlotNext(nextPageLink, options, callback) { +function _listDeploymentsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -69836,7 +70586,7 @@ function _listConfigurationsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigResourceCollection']().mapper(); + let resultMapper = new client.models['DeploymentCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -69852,11 +70602,9 @@ function _listConfigurationsSlotNext(nextPageLink, options, callback) { } /** - * @summary Gets a list of web app configuration snapshots identifiers. Each - * element of the list contains a timestamp and the ID of the snapshot. + * @summary Lists ownership identifiers for domain associated with web app. * - * Gets a list of web app configuration snapshots identifiers. Each element of - * the list contains a timestamp and the ID of the snapshot. + * Lists ownership identifiers for domain associated with web app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -69873,14 +70621,13 @@ function _listConfigurationsSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteConfigurationSnapshotInfoCollection} for - * more information. + * See {@link IdentifierCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listConfigurationSnapshotInfoSlotNext(nextPageLink, options, callback) { +function _listDomainOwnershipIdentifiersSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -69969,7 +70716,7 @@ function _listConfigurationSnapshotInfoSlotNext(nextPageLink, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); + let resultMapper = new client.models['IdentifierCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -69985,9 +70732,9 @@ function _listConfigurationSnapshotInfoSlotNext(nextPageLink, options, callback) } /** - * @summary List continuous web jobs for an app, or a deployment slot. + * @summary List the functions for a web site, or a deployment slot. * - * List continuous web jobs for an app, or a deployment slot. + * List the functions for a web site, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -70004,14 +70751,14 @@ function _listConfigurationSnapshotInfoSlotNext(nextPageLink, options, callback) * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ContinuousWebJobCollection} for more + * See {@link FunctionEnvelopeCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listContinuousWebJobsSlotNext(nextPageLink, options, callback) { +function _listInstanceFunctionsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -70064,7 +70811,7 @@ function _listContinuousWebJobsSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -70074,13 +70821,12 @@ function _listContinuousWebJobsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -70100,7 +70846,7 @@ function _listContinuousWebJobsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ContinuousWebJobCollection']().mapper(); + let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -70116,9 +70862,9 @@ function _listContinuousWebJobsSlotNext(nextPageLink, options, callback) { } /** - * @summary List deployments for an app, or a deployment slot. + * @summary Get hostname bindings for an app or a deployment slot. * - * List deployments for an app, or a deployment slot. + * Get hostname bindings for an app or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -70135,13 +70881,14 @@ function _listContinuousWebJobsSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeploymentCollection} for more information. + * See {@link HostNameBindingCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listDeploymentsSlotNext(nextPageLink, options, callback) { +function _listHostNameBindingsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -70230,7 +70977,7 @@ function _listDeploymentsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DeploymentCollection']().mapper(); + let resultMapper = new client.models['HostNameBindingCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -70246,9 +70993,9 @@ function _listDeploymentsSlotNext(nextPageLink, options, callback) { } /** - * @summary Lists ownership identifiers for domain associated with web app. + * @summary Gets all scale-out instances of an app. * - * Lists ownership identifiers for domain associated with web app. + * Gets all scale-out instances of an app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -70265,13 +71012,14 @@ function _listDeploymentsSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link IdentifierCollection} for more information. + * See {@link WebAppInstanceCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listDomainOwnershipIdentifiersSlotNext(nextPageLink, options, callback) { +function _listInstanceIdentifiersSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -70360,7 +71108,7 @@ function _listDomainOwnershipIdentifiersSlotNext(nextPageLink, options, callback parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['IdentifierCollection']().mapper(); + let resultMapper = new client.models['WebAppInstanceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -70376,9 +71124,11 @@ function _listDomainOwnershipIdentifiersSlotNext(nextPageLink, options, callback } /** - * @summary List the functions for a web site, or a deployment slot. + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. * - * List the functions for a web site, or a deployment slot. + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -70395,14 +71145,13 @@ function _listDomainOwnershipIdentifiersSlotNext(nextPageLink, options, callback * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link FunctionEnvelopeCollection} for more - * information. + * See {@link ProcessInfoCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listInstanceFunctionsSlotNext(nextPageLink, options, callback) { +function _listInstanceProcessesSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -70490,7 +71239,7 @@ function _listInstanceFunctionsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -70506,9 +71255,11 @@ function _listInstanceFunctionsSlotNext(nextPageLink, options, callback) { } /** - * @summary Get hostname bindings for an app or a deployment slot. + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * Get hostname bindings for an app or a deployment slot. + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -70525,14 +71276,14 @@ function _listInstanceFunctionsSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link HostNameBindingCollection} for more + * See {@link ProcessModuleInfoCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listHostNameBindingsSlotNext(nextPageLink, options, callback) { +function _listInstanceProcessModulesSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -70585,7 +71336,7 @@ function _listHostNameBindingsSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -70595,13 +71346,12 @@ function _listHostNameBindingsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -70621,7 +71371,7 @@ function _listHostNameBindingsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HostNameBindingCollection']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -70637,9 +71387,11 @@ function _listHostNameBindingsSlotNext(nextPageLink, options, callback) { } /** - * @summary Gets all scale-out instances of an app. + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. * - * Gets all scale-out instances of an app. + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -70656,146 +71408,14 @@ function _listHostNameBindingsSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link WebAppInstanceCollection} for more + * See {@link ProcessThreadInfoCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listInstanceIdentifiersSlotNext(nextPageLink, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebAppInstanceCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. - * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. - * - * @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 {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfoCollection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _listInstanceProcessesSlotNext(nextPageLink, options, callback) { +function _listInstanceProcessThreadsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -70883,7 +71503,7 @@ function _listInstanceProcessesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -70899,11 +71519,10 @@ function _listInstanceProcessesSlotNext(nextPageLink, options, callback) { } /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. + * Gets all metric definitions of an app (or deployment slot, if specified). * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -70920,14 +71539,14 @@ function _listInstanceProcessesSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfoCollection} for more + * See {@link ResourceMetricDefinitionCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listInstanceProcessModulesSlotNext(nextPageLink, options, callback) { +function _listMetricDefinitionsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -70980,7 +71599,7 @@ function _listInstanceProcessModulesSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -70990,12 +71609,13 @@ function _listInstanceProcessModulesSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -71015,7 +71635,7 @@ function _listInstanceProcessModulesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -71031,11 +71651,10 @@ function _listInstanceProcessModulesSlotNext(nextPageLink, options, callback) { } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * Gets performance metrics of an app (or deployment slot, if specified). * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -71052,14 +71671,14 @@ function _listInstanceProcessModulesSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfoCollection} for more + * See {@link ResourceMetricCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listInstanceProcessThreadsSlotNext(nextPageLink, options, callback) { +function _listMetricsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -71112,7 +71731,7 @@ function _listInstanceProcessThreadsSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -71122,12 +71741,13 @@ function _listInstanceProcessThreadsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -71147,7 +71767,7 @@ function _listInstanceProcessThreadsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -71163,10 +71783,9 @@ function _listInstanceProcessThreadsSlotNext(nextPageLink, options, callback) { } /** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). + * @summary Gets perfmon counters for web app. * - * Gets all metric definitions of an app (or deployment slot, if specified). + * Gets perfmon counters for web app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -71183,14 +71802,14 @@ function _listInstanceProcessThreadsSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceMetricDefinitionCollection} for more + * See {@link PerfMonCounterCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listMetricDefinitionsSlotNext(nextPageLink, options, callback) { +function _listPerfMonCountersSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -71279,7 +71898,7 @@ function _listMetricDefinitionsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); + let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -71295,10 +71914,11 @@ function _listMetricDefinitionsSlotNext(nextPageLink, options, callback) { } /** - * @summary Gets performance metrics of an app (or deployment slot, if - * specified). + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. * - * Gets performance metrics of an app (or deployment slot, if specified). + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -71315,14 +71935,13 @@ function _listMetricDefinitionsSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceMetricCollection} for more - * information. + * See {@link ProcessInfoCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listMetricsSlotNext(nextPageLink, options, callback) { +function _listProcessesSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -71375,7 +71994,7 @@ function _listMetricsSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -71385,13 +72004,12 @@ function _listMetricsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -71411,7 +72029,7 @@ function _listMetricsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricCollection']().mapper(); + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -71427,9 +72045,11 @@ function _listMetricsSlotNext(nextPageLink, options, callback) { } /** - * @summary Gets perfmon counters for web app. + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * Gets perfmon counters for web app. + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -71446,14 +72066,14 @@ function _listMetricsSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PerfMonCounterCollection} for more + * See {@link ProcessModuleInfoCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listPerfMonCountersSlotNext(nextPageLink, options, callback) { +function _listProcessModulesSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -71506,7 +72126,7 @@ function _listPerfMonCountersSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -71516,13 +72136,12 @@ function _listPerfMonCountersSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -71542,7 +72161,7 @@ function _listPerfMonCountersSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -71558,11 +72177,11 @@ function _listPerfMonCountersSlotNext(nextPageLink, options, callback) { } /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -71579,13 +72198,14 @@ function _listPerfMonCountersSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfoCollection} for more information. + * See {@link ProcessThreadInfoCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listProcessesSlotNext(nextPageLink, options, callback) { +function _listProcessThreadsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -71673,7 +72293,7 @@ function _listProcessesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -71689,11 +72309,9 @@ function _listProcessesSlotNext(nextPageLink, options, callback) { } /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Get public certificates for an app or a deployment slot. * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. + * Get public certificates for an app or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -71710,14 +72328,14 @@ function _listProcessesSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfoCollection} for more + * See {@link PublicCertificateCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listProcessModulesSlotNext(nextPageLink, options, callback) { +function _listPublicCertificatesSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -71770,7 +72388,7 @@ function _listProcessModulesSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -71780,12 +72398,13 @@ function _listProcessModulesSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -71805,7 +72424,7 @@ function _listProcessModulesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + let resultMapper = new client.models['PublicCertificateCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -71821,11 +72440,9 @@ function _listProcessModulesSlotNext(nextPageLink, options, callback) { } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Get list of siteextensions for a web site, or a deployment slot. * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * Get list of siteextensions for a web site, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -71842,14 +72459,14 @@ function _listProcessModulesSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfoCollection} for more + * See {@link SiteExtensionInfoCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listProcessThreadsSlotNext(nextPageLink, options, callback) { +function _listSiteExtensionsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -71937,7 +72554,7 @@ function _listProcessThreadsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); + let resultMapper = new client.models['SiteExtensionInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -71953,9 +72570,10 @@ function _listProcessThreadsSlotNext(nextPageLink, options, callback) { } /** - * @summary Get public certificates for an app or a deployment slot. + * @summary Get the difference in configuration settings between two web app + * slots. * - * Get public certificates for an app or a deployment slot. + * Get the difference in configuration settings between two web app slots. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -71972,14 +72590,14 @@ function _listProcessThreadsSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PublicCertificateCollection} for more + * See {@link SlotDifferenceCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listPublicCertificatesSlotNext(nextPageLink, options, callback) { +function _listSlotDifferencesSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -72007,7 +72625,7 @@ function _listPublicCertificatesSlotNext(nextPageLink, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -72068,7 +72686,7 @@ function _listPublicCertificatesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicCertificateCollection']().mapper(); + let resultMapper = new client.models['SlotDifferenceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -72084,9 +72702,9 @@ function _listPublicCertificatesSlotNext(nextPageLink, options, callback) { } /** - * @summary Get list of siteextensions for a web site, or a deployment slot. + * @summary Returns all Snapshots to the user. * - * Get list of siteextensions for a web site, or a deployment slot. + * Returns all Snapshots to the user. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -72103,14 +72721,13 @@ function _listPublicCertificatesSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteExtensionInfoCollection} for more - * information. + * See {@link SnapshotCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listSiteExtensionsSlotNext(nextPageLink, options, callback) { +function _listSnapshotsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -72158,137 +72775,6 @@ function _listSiteExtensionsSlotNext(nextPageLink, options, callback) { } httpRequest.body = null; // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteExtensionInfoCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary Get the difference in configuration settings between two web app - * slots. - * - * Get the difference in configuration settings between two web app slots. - * - * @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 {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SlotDifferenceCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _listSlotDifferencesSlotNext(nextPageLink, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'POST'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); @@ -72330,7 +72816,7 @@ function _listSlotDifferencesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SlotDifferenceCollection']().mapper(); + let resultMapper = new client.models['SnapshotCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -72346,9 +72832,9 @@ function _listSlotDifferencesSlotNext(nextPageLink, options, callback) { } /** - * @summary Returns all Snapshots to the user. + * @summary Returns all Snapshots to the user from DRSecondary endpoint. * - * Returns all Snapshots to the user. + * Returns all Snapshots to the user from DRSecondary endpoint. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -72371,7 +72857,7 @@ function _listSlotDifferencesSlotNext(nextPageLink, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listSnapshotsSlotNext(nextPageLink, options, callback) { +function _listSnapshotsFromDRSecondarySlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -73262,6 +73748,136 @@ function _listSnapshotsNext(nextPageLink, options, callback) { }); } +/** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @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 {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listSnapshotsFromDRSecondaryNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SnapshotCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + /** * @summary List triggered web jobs for an app, or a deployment slot. * @@ -74081,6 +74697,7 @@ class WebApps { this._listSlotDifferencesSlot = _listSlotDifferencesSlot; this._swapSlotSlot = _swapSlotSlot; this._listSnapshotsSlot = _listSnapshotsSlot; + this._listSnapshotsFromDRSecondarySlot = _listSnapshotsFromDRSecondarySlot; this._getSourceControlSlot = _getSourceControlSlot; this._createOrUpdateSourceControlSlot = _createOrUpdateSourceControlSlot; this._deleteSourceControlSlot = _deleteSourceControlSlot; @@ -74109,6 +74726,7 @@ class WebApps { this._listSlotDifferencesFromProduction = _listSlotDifferencesFromProduction; this._swapSlotWithProduction = _swapSlotWithProduction; this._listSnapshots = _listSnapshots; + this._listSnapshotsFromDRSecondary = _listSnapshotsFromDRSecondary; this._getSourceControl = _getSourceControl; this._createOrUpdateSourceControl = _createOrUpdateSourceControl; this._deleteSourceControl = _deleteSourceControl; @@ -74207,12 +74825,14 @@ class WebApps { this._listSiteExtensionsSlotNext = _listSiteExtensionsSlotNext; this._listSlotDifferencesSlotNext = _listSlotDifferencesSlotNext; this._listSnapshotsSlotNext = _listSnapshotsSlotNext; + this._listSnapshotsFromDRSecondarySlotNext = _listSnapshotsFromDRSecondarySlotNext; this._listTriggeredWebJobsSlotNext = _listTriggeredWebJobsSlotNext; this._listTriggeredWebJobHistorySlotNext = _listTriggeredWebJobHistorySlotNext; this._listUsagesSlotNext = _listUsagesSlotNext; this._listWebJobsSlotNext = _listWebJobsSlotNext; this._listSlotDifferencesFromProductionNext = _listSlotDifferencesFromProductionNext; this._listSnapshotsNext = _listSnapshotsNext; + this._listSnapshotsFromDRSecondaryNext = _listSnapshotsFromDRSecondaryNext; this._listTriggeredWebJobsNext = _listTriggeredWebJobsNext; this._listTriggeredWebJobHistoryNext = _listTriggeredWebJobHistoryNext; this._listUsagesNext = _listUsagesNext; @@ -91703,6 +92323,9 @@ class WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -91753,6 +92376,9 @@ class WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -91842,6 +92468,9 @@ class WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -91910,6 +92539,9 @@ class WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -110069,6 +110701,9 @@ class WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -110122,6 +110757,9 @@ class WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -110214,6 +110852,9 @@ class WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -110285,6 +110926,9 @@ class WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -110827,7 +111471,124 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {SlotDifferenceCollection} - The deserialized result object. + * @resolve {SlotDifferenceCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SlotDifferenceCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, optionalCallback); + } + } + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @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} - The error object. + */ + swapSlotSlotWithHttpOperationResponse(resourceGroupName, name, slotSwapEntity, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|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} - The error object. * @@ -110835,15 +111596,13 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SlotDifferenceCollection} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, optionalCallback) { + swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -110852,38 +111611,28 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { + self._swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, optionalCallback); + return self._swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, optionalCallback); } } /** - * @summary Swaps two deployment slots of an app. + * @summary Returns all Snapshots to the user. * - * Swaps two deployment slots of an app. + * Returns all Snapshots to the user. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {object} slotSwapEntity JSON object that contains the target slot - * name. See example. - * - * @param {string} slotSwapEntity.targetSlot Destination deployment slot during - * swap operation. - * - * @param {boolean} slotSwapEntity.preserveVnet true to preserve - * Virtual Network to the slot during swap; otherwise, false. + * @param {string} name Website Name. * - * @param {string} slot Name of the source slot. If a slot is not specified, - * the production slot is used as the source slot. + * @param {string} slot Website Slot. * * @param {object} [options] Optional Parameters. * @@ -110892,15 +111641,15 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - swapSlotSlotWithHttpOperationResponse(resourceGroupName, name, slotSwapEntity, slot, options) { + listSnapshotsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { + self._listSnapshotsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -110911,26 +111660,16 @@ class WebApps { } /** - * @summary Swaps two deployment slots of an app. + * @summary Returns all Snapshots to the user. * - * Swaps two deployment slots of an app. + * Returns all Snapshots to the user. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {object} slotSwapEntity JSON object that contains the target slot - * name. See example. - * - * @param {string} slotSwapEntity.targetSlot Destination deployment slot during - * swap operation. - * - * @param {boolean} slotSwapEntity.preserveVnet true to preserve - * Virtual Network to the slot during swap; otherwise, false. + * @param {string} name Website Name. * - * @param {string} slot Name of the source slot. If a slot is not specified, - * the production slot is used as the source slot. + * @param {string} slot Website Slot. * * @param {object} [options] Optional Parameters. * @@ -110944,7 +111683,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {SnapshotCollection} - The deserialized result object. * * @reject {Error} - The error object. * @@ -110952,13 +111691,14 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, optionalCallback) { + listSnapshotsSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -110967,21 +111707,21 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { + self._listSnapshotsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, optionalCallback); + return self._listSnapshotsSlot(resourceGroupName, name, slot, options, optionalCallback); } } /** - * @summary Returns all Snapshots to the user. + * @summary Returns all Snapshots to the user from DRSecondary endpoint. * - * Returns all Snapshots to the user. + * Returns all Snapshots to the user from DRSecondary endpoint. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -111001,11 +111741,11 @@ class WebApps { * * @reject {Error} - The error object. */ - listSnapshotsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + listSnapshotsFromDRSecondarySlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listSnapshotsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._listSnapshotsFromDRSecondarySlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -111016,9 +111756,9 @@ class WebApps { } /** - * @summary Returns all Snapshots to the user. + * @summary Returns all Snapshots to the user from DRSecondary endpoint. * - * Returns all Snapshots to the user. + * Returns all Snapshots to the user from DRSecondary endpoint. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -111054,7 +111794,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listSnapshotsSlot(resourceGroupName, name, slot, options, optionalCallback) { + listSnapshotsFromDRSecondarySlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -111063,14 +111803,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listSnapshotsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._listSnapshotsFromDRSecondarySlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listSnapshotsSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._listSnapshotsFromDRSecondarySlot(resourceGroupName, name, slot, options, optionalCallback); } } @@ -114158,6 +114898,98 @@ class WebApps { } } + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @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} - The error object. + */ + listSnapshotsFromDRSecondaryWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSnapshotsFromDRSecondary(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|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 {SnapshotCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listSnapshotsFromDRSecondary(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSnapshotsFromDRSecondary(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSnapshotsFromDRSecondary(resourceGroupName, name, options, optionalCallback); + } + } + /** * @summary Gets the source control configuration of an app. * @@ -118837,6 +119669,9 @@ class WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -118887,6 +119722,9 @@ class WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -118976,6 +119814,9 @@ class WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -119044,6 +119885,9 @@ class WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -121066,6 +121910,9 @@ class WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -121119,6 +121966,9 @@ class WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -121211,6 +122061,9 @@ class WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -121282,6 +122135,9 @@ class WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -125996,6 +126852,94 @@ class WebApps { } } + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @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} - The error object. + */ + listSnapshotsFromDRSecondarySlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSnapshotsFromDRSecondarySlotNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @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 {function} [optionalCallback] - The optional callback. + * + * @returns {function|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 {SnapshotCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listSnapshotsFromDRSecondarySlotNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSnapshotsFromDRSecondarySlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSnapshotsFromDRSecondarySlotNext(nextPageLink, options, optionalCallback); + } + } + /** * @summary List triggered web jobs for an app, or a deployment slot. * @@ -126536,6 +127480,94 @@ class WebApps { } } + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @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} - The error object. + */ + listSnapshotsFromDRSecondaryNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSnapshotsFromDRSecondaryNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @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 {function} [optionalCallback] - The optional callback. + * + * @returns {function|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 {SnapshotCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listSnapshotsFromDRSecondaryNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSnapshotsFromDRSecondaryNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSnapshotsFromDRSecondaryNext(nextPageLink, options, optionalCallback); + } + } + /** * @summary List triggered web jobs for an app, or a deployment slot. * From 3d8c0e6c6e69cc6f5c7efc1c415c8fe1fa56af77 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 9 Nov 2018 01:37:58 +0000 Subject: [PATCH 2/2] Generated from c0b2862c0002fa73fe7b3e70cb1bac9435719186 Snapshots API for DR stamps --- .../lib/operations/index.d.ts | 1060 +- .../lib/operations/webApps.js | 8574 +++++++++++------ 2 files changed, 6648 insertions(+), 2986 deletions(-) diff --git a/lib/services/websiteManagement2/lib/operations/index.d.ts b/lib/services/websiteManagement2/lib/operations/index.d.ts index d317be06da..40aab24fbe 100644 --- a/lib/services/websiteManagement2/lib/operations/index.d.ts +++ b/lib/services/websiteManagement2/lib/operations/index.d.ts @@ -20092,11 +20092,11 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getNetworkTraceOperationWithHttpOperationResponse(resourceGroupName: string, name: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getNetworkTraceOperationWithHttpOperationResponse(resourceGroupName: string, name: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Gets a named operation for a network trace capturing (or deployment @@ -20124,7 +20124,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20132,15 +20132,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {Array} [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. */ - getNetworkTraceOperation(resourceGroupName: string, name: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getNetworkTraceOperation(resourceGroupName: string, name: string, operationId: string, callback: ServiceCallback): void; - getNetworkTraceOperation(resourceGroupName: string, name: string, operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getNetworkTraceOperation(resourceGroupName: string, name: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getNetworkTraceOperation(resourceGroupName: string, name: string, operationId: string, callback: ServiceCallback): void; + getNetworkTraceOperation(resourceGroupName: string, name: string, operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -20248,11 +20248,11 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - startWebSiteNetworkTraceOperationWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + startWebSiteNetworkTraceOperationWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Start capturing network packets for the site. @@ -20284,7 +20284,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20292,15 +20292,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {Array} [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. */ - startWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - startWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, callback: ServiceCallback): void; - startWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + startWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + startWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, callback: ServiceCallback): void; + startWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -20439,6 +20439,150 @@ export interface WebApps { getNetworkTraces(resourceGroupName: string, name: string, operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} operationId GUID of 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. + */ + getNetworkTraceOperationV2WithHttpOperationResponse(resourceGroupName: string, name: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} operationId GUID of 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 {Array} - 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. + * + * {Array} [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. + */ + getNetworkTraceOperationV2(resourceGroupName: string, name: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getNetworkTraceOperationV2(resourceGroupName: string, name: string, operationId: string, callback: ServiceCallback): void; + getNetworkTraceOperationV2(resourceGroupName: string, name: string, operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} operationId GUID of 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. + */ + getNetworkTracesV2WithHttpOperationResponse(resourceGroupName: string, name: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} operationId GUID of 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 {Array} - 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. + * + * {Array} [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. + */ + getNetworkTracesV2(resourceGroupName: string, name: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getNetworkTracesV2(resourceGroupName: string, name: string, operationId: string, callback: ServiceCallback): void; + getNetworkTracesV2(resourceGroupName: string, name: string, operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Generates a new publishing password for an app (or deployment slot, * if specified). @@ -34542,11 +34686,11 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getNetworkTraceOperationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, operationId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getNetworkTraceOperationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, operationId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Gets a named operation for a network trace capturing (or deployment @@ -34577,7 +34721,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -34585,15 +34729,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {Array} [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. */ - getNetworkTraceOperationSlot(resourceGroupName: string, name: string, operationId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getNetworkTraceOperationSlot(resourceGroupName: string, name: string, operationId: string, slot: string, callback: ServiceCallback): void; - getNetworkTraceOperationSlot(resourceGroupName: string, name: string, operationId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getNetworkTraceOperationSlot(resourceGroupName: string, name: string, operationId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getNetworkTraceOperationSlot(resourceGroupName: string, name: string, operationId: string, slot: string, callback: ServiceCallback): void; + getNetworkTraceOperationSlot(resourceGroupName: string, name: string, operationId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -34707,11 +34851,11 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - startWebSiteNetworkTraceOperationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + startWebSiteNetworkTraceOperationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Start capturing network packets for the site. @@ -34745,7 +34889,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -34753,15 +34897,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {Array} [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. */ - startWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - startWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - startWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + startWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + startWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + startWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -34911,10 +35055,10 @@ export interface WebApps { /** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). * - * Generates a new publishing password for an app (or deployment slot, if + * Gets a named operation for a network trace capturing (or deployment slot, if * specified). * * @param {string} resourceGroupName Name of the resource group to which the @@ -34922,9 +35066,10 @@ export interface WebApps { * * @param {string} name Name of the app. * + * @param {string} operationId GUID of the operation. + * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API generate a new publishing password for the production - * slot. + * specified, the API will get an operation for the production slot. * * @param {object} [options] Optional Parameters. * @@ -34933,17 +35078,17 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - generateNewSitePublishingPasswordSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getNetworkTraceOperationSlotV2WithHttpOperationResponse(resourceGroupName: string, name: string, operationId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). * - * Generates a new publishing password for an app (or deployment slot, if + * Gets a named operation for a network trace capturing (or deployment slot, if * specified). * * @param {string} resourceGroupName Name of the resource group to which the @@ -34951,9 +35096,10 @@ export interface WebApps { * * @param {string} name Name of the app. * + * @param {string} operationId GUID of the operation. + * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API generate a new publishing password for the production - * slot. + * specified, the API will get an operation for the production slot. * * @param {object} [options] Optional Parameters. * @@ -34967,7 +35113,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -34975,67 +35121,65 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {Array} [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. */ - generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getNetworkTraceOperationSlotV2(resourceGroupName: string, name: string, operationId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getNetworkTraceOperationSlotV2(resourceGroupName: string, name: string, operationId: string, slot: string, callback: ServiceCallback): void; + getNetworkTraceOperationSlotV2(resourceGroupName: string, name: string, operationId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Gets perfmon counters for web app. + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). * - * Gets perfmon counters for web app. + * Gets a named operation for a network trace capturing (or deployment slot, if + * specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @param {string} operationId GUID of the operation. * - * @param {object} [options] Optional Parameters. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get an operation for the production slot. * - * @param {string} [options.filter] Return only usages/metrics specified in the - * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq - * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. + * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listPerfMonCountersSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + getNetworkTracesSlotV2WithHttpOperationResponse(resourceGroupName: string, name: string, operationId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets perfmon counters for web app. + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). * - * Gets perfmon counters for web app. + * Gets a named operation for a network trace capturing (or deployment slot, if + * specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @param {string} operationId GUID of the operation. * - * @param {object} [options] Optional Parameters. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get an operation for the production slot. * - * @param {string} [options.filter] Return only usages/metrics specified in the - * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq - * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -35047,7 +35191,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {PerfMonCounterCollection} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -35055,31 +35199,32 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PerfMonCounterCollection} [result] - The deserialized result object if an error did not occur. - * See {@link PerfMonCounterCollection} for more - * information. + * {Array} [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. */ - listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getNetworkTracesSlotV2(resourceGroupName: string, name: string, operationId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getNetworkTracesSlotV2(resourceGroupName: string, name: string, operationId: string, slot: string, callback: ServiceCallback): void; + getNetworkTracesSlotV2(resourceGroupName: string, name: string, operationId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Gets web app's event logs. + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). * - * Gets web app's event logs. + * Generates a new publishing password for an app (or deployment slot, if + * specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API generate a new publishing password for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -35088,7 +35233,162 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + generateNewSitePublishingPasswordSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API generate a new publishing password for the production + * slot. + * + * @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. + */ + generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listPerfMonCountersSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {PerfMonCounterCollection} - 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. + * + * {PerfMonCounterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link PerfMonCounterCollection} 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. + */ + listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. */ @@ -38430,6 +38730,90 @@ export interface WebApps { startSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @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. + */ + startNetworkTraceSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @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 {Array} - 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. + * + * {Array} [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. + */ + startNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + startNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + startNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Stops an app (or deployment slot, if specified). * @@ -38500,6 +38884,74 @@ export interface WebApps { stopSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @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. + */ + stopNetworkTraceSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @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. + */ + stopNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stopNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + stopNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Sync web app repository. * @@ -40635,61 +41087,206 @@ export interface WebApps { * to limit to manual integration; false to enable continuous * integration (which configures webhooks into online repos like GitHub). * - * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] - * true to enable deployment rollback; otherwise, - * false. + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @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. + */ + updateSourceControlWithHttpOperationResponse(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @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 {SiteSourceControl} - 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. + * + * {SiteSourceControl} [result] - The deserialized result object if an error did not occur. + * See {@link SiteSourceControl} 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. + */ + updateSourceControl(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateSourceControl(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, callback: ServiceCallback): void; + updateSourceControl(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Starts an app (or deployment slot, if specified). + * + * Starts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + startWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Starts an app (or deployment slot, if specified). + * + * Starts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + start(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + start(resourceGroupName: string, name: string, callback: ServiceCallback): void; + start(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. * - * @param {boolean} [siteSourceControl.isMercurial] true for a - * Mercurial repository; false for a Git repository. + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. * - * @param {string} [siteSourceControl.kind] Kind of resource. + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). * - * @param {object} [options] Optional Parameters. + * @param {string} [options.sasUrl] The Blob URL to store capture file. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateSourceControlWithHttpOperationResponse(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + startNetworkTraceWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Updates the source control configuration of an app. + * @summary Start capturing network packets for the site. * - * Updates the source control configuration of an app. + * Start capturing network packets for the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {object} siteSourceControl JSON representation of a SiteSourceControl - * object. See example. - * - * @param {string} [siteSourceControl.repoUrl] Repository or source control - * URL. - * - * @param {string} [siteSourceControl.branch] Name of branch to use for - * deployment. - * - * @param {boolean} [siteSourceControl.isManualIntegration] true - * to limit to manual integration; false to enable continuous - * integration (which configures webhooks into online repos like GitHub). + * @param {string} name The name of the web app. * - * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] - * true to enable deployment rollback; otherwise, - * false. + * @param {object} [options] Optional Parameters. * - * @param {boolean} [siteSourceControl.isMercurial] true for a - * Mercurial repository; false for a Git repository. + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. * - * @param {string} [siteSourceControl.kind] Kind of resource. + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). * - * @param {object} [options] Optional Parameters. + * @param {string} [options.sasUrl] The Blob URL to store capture file. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -40701,7 +41298,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {SiteSourceControl} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -40709,22 +41306,21 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SiteSourceControl} [result] - The deserialized result object if an error did not occur. - * See {@link SiteSourceControl} for more information. + * {Array} [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. */ - updateSourceControl(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateSourceControl(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, callback: ServiceCallback): void; - updateSourceControl(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + startNetworkTrace(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + startNetworkTrace(resourceGroupName: string, name: string, callback: ServiceCallback): void; + startNetworkTrace(resourceGroupName: string, name: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Starts an app (or deployment slot, if specified). + * @summary Stops an app (or deployment slot, if specified). * - * Starts an app (or deployment slot, if specified). + * Stops an app (or deployment slot, if specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -40742,12 +41338,12 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - startWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + stopWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Starts an app (or deployment slot, if specified). + * @summary Stops an app (or deployment slot, if specified). * - * Starts an app (or deployment slot, if specified). + * Stops an app (or deployment slot, if specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -40780,20 +41376,20 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - start(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - start(resourceGroupName: string, name: string, callback: ServiceCallback): void; - start(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + stop(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stop(resourceGroupName: string, name: string, callback: ServiceCallback): void; + stop(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Stops an app (or deployment slot, if specified). + * @summary Stop ongoing capturing network packets for the site. * - * Stops an app (or deployment slot, if specified). + * Stop ongoing capturing network packets for the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name The name of the web app. * * @param {object} [options] Optional Parameters. * @@ -40806,17 +41402,17 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - stopWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + stopNetworkTraceWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Stops an app (or deployment slot, if specified). + * @summary Stop ongoing capturing network packets for the site. * - * Stops an app (or deployment slot, if specified). + * Stop ongoing capturing network packets for the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name The name of the web app. * * @param {object} [options] Optional Parameters. * @@ -40844,9 +41440,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - stop(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - stop(resourceGroupName: string, name: string, callback: ServiceCallback): void; - stop(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + stopNetworkTrace(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stopNetworkTrace(resourceGroupName: string, name: string, callback: ServiceCallback): void; + stopNetworkTrace(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -43886,11 +44482,11 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginStartWebSiteNetworkTraceOperationWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginStartWebSiteNetworkTraceOperationWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Start capturing network packets for the site. @@ -43922,7 +44518,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -43930,15 +44526,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {Array} [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. */ - beginStartWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - beginStartWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, callback: ServiceCallback): void; - beginStartWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginStartWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginStartWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, callback: ServiceCallback): void; + beginStartWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -45822,11 +46418,11 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginStartWebSiteNetworkTraceOperationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginStartWebSiteNetworkTraceOperationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Start capturing network packets for the site. @@ -45860,7 +46456,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -45868,15 +46464,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {Array} [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. */ - beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -46557,6 +47153,90 @@ export interface WebApps { beginCreateOrUpdateSourceControlSlot(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @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. + */ + beginStartNetworkTraceSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @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 {Array} - 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. + * + * {Array} [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. + */ + beginStartNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginStartNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + beginStartNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Swaps two deployment slots of an app. * @@ -46748,6 +47428,86 @@ export interface WebApps { beginCreateOrUpdateSourceControl(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @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. + */ + beginStartNetworkTraceWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @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 {Array} - 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. + * + * {Array} [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. + */ + beginStartNetworkTrace(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginStartNetworkTrace(resourceGroupName: string, name: string, callback: ServiceCallback): void; + beginStartNetworkTrace(resourceGroupName: string, name: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Get all apps for a subscription. * diff --git a/lib/services/websiteManagement2/lib/operations/webApps.js b/lib/services/websiteManagement2/lib/operations/webApps.js index c3e8f814b0..b3285fab82 100644 --- a/lib/services/websiteManagement2/lib/operations/webApps.js +++ b/lib/services/websiteManagement2/lib/operations/webApps.js @@ -19348,7 +19348,7 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -19509,7 +19509,21 @@ function _getNetworkTraceOperation(resourceGroupName, name, operationId, options parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Operation']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -19751,7 +19765,7 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -19798,7 +19812,15 @@ function _startWebSiteNetworkTraceOperation(resourceGroupName, name, options, ca required: false, serializedName: 'parsedResponse', type: { - name: 'Object' + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } } }; result = client.deserialize(resultMapper, parsedResponse, 'result'); @@ -20144,10 +20166,10 @@ function _getNetworkTraces(resourceGroupName, name, operationId, options, callba } /** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). * - * Generates a new publishing password for an app (or deployment slot, if + * Gets a named operation for a network trace capturing (or deployment slot, if * specified). * * @param {string} resourceGroupName Name of the resource group to which the @@ -20155,157 +20177,10 @@ function _getNetworkTraces(resourceGroupName, name, operationId, options, callba * * @param {string} name Name of the app. * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _generateNewSitePublishingPassword(resourceGroupName, name, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === null || name === undefined || typeof name.valueOf() !== 'string') { - throw new Error('name cannot be null or undefined and it must be of type string.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'POST'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary Gets perfmon counters for web app. - * - * Gets perfmon counters for web app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. + * @param {string} operationId GUID of the operation. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] Return only usages/metrics specified in the - * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq - * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -20315,15 +20190,13 @@ function _generateNewSitePublishingPassword(resourceGroupName, name, options, ca * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PerfMonCounterCollection} for more - * information. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listPerfMonCounters(resourceGroupName, name, options, callback) { +function _getNetworkTraceOperationV2(resourceGroupName, name, operationId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20333,7 +20206,6 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20356,8 +20228,8 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter must be of type string.'); + if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string') { + throw new Error('operationId cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); @@ -20374,14 +20246,12 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{operationId}', encodeURIComponent(operationId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + filter); - } queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -20414,7 +20284,7 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -20450,7 +20320,21 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -20460,20 +20344,55 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { return callback(deserializationError); } } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } return callback(null, result, httpRequest, response); }); } /** - * @summary Gets web app's event logs. + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). * - * Gets web app's event logs. + * Gets a named operation for a network trace capturing (or deployment slot, if + * specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name Name of the app. + * + * @param {string} operationId GUID of the operation. * * @param {object} [options] Optional Parameters. * @@ -20486,14 +20405,13 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SitePhpErrorLogFlag} for more information. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { +function _getNetworkTracesV2(resourceGroupName, name, operationId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20525,6 +20443,9 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } + if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string') { + throw new Error('operationId cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -20540,9 +20461,10 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{operationId}', encodeURIComponent(operationId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -20613,7 +20535,21 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SitePhpErrorLogFlag']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -20629,9 +20565,11 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { } /** - * @summary Gets the premier add-ons of an app. + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). * - * Gets the premier add-ons of an app. + * Generates a new publishing password for an app (or deployment slot, if + * specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -20649,14 +20587,164 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _generateNewSitePublishingPassword(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PremierAddOn} for more information. + * See {@link PerfMonCounterCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listPremierAddOns(resourceGroupName, name, options, callback) { +function _listPerfMonCounters(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20666,6 +20754,7 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let filter = (options && options.filter !== undefined) ? options.filter : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20688,6 +20777,9 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -20703,11 +20795,14 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -20776,7 +20871,7 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PremierAddOn']().mapper(); + let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -20792,16 +20887,14 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { } /** - * @summary Gets a named add-on of an app. + * @summary Gets web app's event logs. * - * Gets a named add-on of an app. + * Gets web app's event logs. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {string} premierAddOnName Add-on name. + * @param {string} name Name of web app. * * @param {object} [options] Optional Parameters. * @@ -20815,13 +20908,13 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PremierAddOn} for more information. + * See {@link SitePhpErrorLogFlag} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, callback) { +function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20853,9 +20946,6 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, ca if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (premierAddOnName === null || premierAddOnName === undefined || typeof premierAddOnName.valueOf() !== 'string') { - throw new Error('premierAddOnName cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -20871,10 +20961,9 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -20945,7 +21034,7 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, ca parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PremierAddOn']().mapper(); + let resultMapper = new client.models['SitePhpErrorLogFlag']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -20961,38 +21050,15 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, ca } /** - * @summary Updates a named add-on of an app. + * @summary Gets the premier add-ons of an app. * - * Updates a named add-on of an app. + * Gets the premier add-ons of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} premierAddOnName Add-on name. - * - * @param {object} premierAddOn A JSON representation of the edited premier - * add-on. - * - * @param {string} [premierAddOn.sku] Premier add on SKU. - * - * @param {string} [premierAddOn.product] Premier add on Product. - * - * @param {string} [premierAddOn.vendor] Premier add on Vendor. - * - * @param {string} [premierAddOn.marketplacePublisher] Premier add on - * Marketplace publisher. - * - * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace - * offer. - * - * @param {string} [premierAddOn.kind] Kind of resource. - * - * @param {string} premierAddOn.location Resource Location. - * - * @param {object} [premierAddOn.tags] Resource tags. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -21011,7 +21077,7 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, ca * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, callback) { +function _listPremierAddOns(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21043,12 +21109,6 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (premierAddOnName === null || premierAddOnName === undefined || typeof premierAddOnName.valueOf() !== 'string') { - throw new Error('premierAddOnName cannot be null or undefined and it must be of type string.'); - } - if (premierAddOn === null || premierAddOn === undefined) { - throw new Error('premierAddOn cannot be null or undefined.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -21064,10 +21124,9 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -21077,7 +21136,7 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21095,21 +21154,7 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (premierAddOn !== null && premierAddOn !== undefined) { - let requestModelMapper = new client.models['PremierAddOn']().mapper(); - requestModel = client.serialize(requestModelMapper, premierAddOn, 'premierAddOn'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(premierAddOn, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -21168,9 +21213,9 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO } /** - * @summary Delete a premier add-on from an app. + * @summary Gets a named add-on of an app. * - * Delete a premier add-on from an app. + * Gets a named add-on of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -21190,13 +21235,14 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, callback) { +function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21259,7 +21305,7 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21294,12 +21340,13 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -21312,6 +21359,23 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PremierAddOn']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); @@ -21346,6 +21410,10 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, * * @param {string} [premierAddOn.kind] Kind of resource. * + * @param {string} premierAddOn.location Resource Location. + * + * @param {object} [premierAddOn.tags] Resource tags. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -21364,7 +21432,7 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, callback) { +function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21430,7 +21498,7 @@ function _updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierA // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21453,7 +21521,7 @@ function _updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierA let requestModel = null; try { if (premierAddOn !== null && premierAddOn !== undefined) { - let requestModelMapper = new client.models['PremierAddOnPatchResource']().mapper(); + let requestModelMapper = new client.models['PremierAddOn']().mapper(); requestModel = client.serialize(requestModelMapper, premierAddOn, 'premierAddOn'); requestContent = JSON.stringify(requestModel); } @@ -21521,16 +21589,16 @@ function _updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierA } /** - * @summary Gets data around private site access enablement and authorized - * Virtual Networks that can access the site. + * @summary Delete a premier add-on from an app. * - * Gets data around private site access enablement and authorized Virtual - * Networks that can access the site. + * Delete a premier add-on from an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name The name of the web app. + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. * * @param {object} [options] Optional Parameters. * @@ -21543,14 +21611,13 @@ function _updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierA * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PrivateAccess} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getPrivateAccess(resourceGroupName, name, options, callback) { +function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21582,6 +21649,9 @@ function _getPrivateAccess(resourceGroupName, name, options, callback) { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } + if (premierAddOnName === null || premierAddOnName === undefined || typeof premierAddOnName.valueOf() !== 'string') { + throw new Error('premierAddOnName cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -21597,9 +21667,10 @@ function _getPrivateAccess(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -21609,7 +21680,7 @@ function _getPrivateAccess(resourceGroupName, name, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21644,13 +21715,12 @@ function _getPrivateAccess(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -21663,48 +21733,39 @@ function _getPrivateAccess(resourceGroupName, name, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PrivateAccess']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Sets data around private site access enablement and authorized - * Virtual Networks that can access the site. + * @summary Updates a named add-on of an app. * - * Sets data around private site access enablement and authorized Virtual - * Networks that can access the site. + * Updates a named add-on of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name The name of the web app. + * @param {string} name Name of the app. * - * @param {object} access The information for the private access + * @param {string} premierAddOnName Add-on name. * - * @param {boolean} [access.enabled] Whether private access is enabled or not. + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. * - * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) - * allowed to access the site privately. + * @param {string} [premierAddOn.sku] Premier add on SKU. * - * @param {string} [access.kind] Kind of resource. + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -21718,13 +21779,13 @@ function _getPrivateAccess(resourceGroupName, name, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PrivateAccess} for more information. + * See {@link PremierAddOn} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _putPrivateAccessVnet(resourceGroupName, name, access, options, callback) { +function _updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21756,8 +21817,11 @@ function _putPrivateAccessVnet(resourceGroupName, name, access, options, callbac if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (access === null || access === undefined) { - throw new Error('access cannot be null or undefined.'); + if (premierAddOnName === null || premierAddOnName === undefined || typeof premierAddOnName.valueOf() !== 'string') { + throw new Error('premierAddOnName cannot be null or undefined and it must be of type string.'); + } + if (premierAddOn === null || premierAddOn === undefined) { + throw new Error('premierAddOn cannot be null or undefined.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); @@ -21774,9 +21838,10 @@ function _putPrivateAccessVnet(resourceGroupName, name, access, options, callbac // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -21786,7 +21851,7 @@ function _putPrivateAccessVnet(resourceGroupName, name, access, options, callbac // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21808,14 +21873,14 @@ function _putPrivateAccessVnet(resourceGroupName, name, access, options, callbac let requestContent = null; let requestModel = null; try { - if (access !== null && access !== undefined) { - let requestModelMapper = new client.models['PrivateAccess']().mapper(); - requestModel = client.serialize(requestModelMapper, access, 'access'); + if (premierAddOn !== null && premierAddOn !== undefined) { + let requestModelMapper = new client.models['PremierAddOnPatchResource']().mapper(); + requestModel = client.serialize(requestModelMapper, premierAddOn, 'premierAddOn'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(access, null, 2)}.`); + `payload - ${JSON.stringify(premierAddOn, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -21861,7 +21926,7 @@ function _putPrivateAccessVnet(resourceGroupName, name, access, options, callbac parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PrivateAccess']().mapper(); + let resultMapper = new client.models['PremierAddOn']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -21877,16 +21942,16 @@ function _putPrivateAccessVnet(resourceGroupName, name, access, options, callbac } /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. + * Gets data around private site access enablement and authorized Virtual + * Networks that can access the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name The name of the web app. * * @param {object} [options] Optional Parameters. * @@ -21900,13 +21965,13 @@ function _putPrivateAccessVnet(resourceGroupName, name, access, options, callbac * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfoCollection} for more information. + * See {@link PrivateAccess} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listProcesses(resourceGroupName, name, options, callback) { +function _getPrivateAccess(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21953,7 +22018,7 @@ function _listProcesses(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); @@ -21990,7 +22055,7 @@ function _listProcesses(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -22000,12 +22065,13 @@ function _listProcesses(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -22025,7 +22091,7 @@ function _listProcesses(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = new client.models['PrivateAccess']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -22041,18 +22107,25 @@ function _listProcesses(resourceGroupName, name, options, callback) { } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Get process information by its ID for a specific scaled-out instance in a - * web site. + * Sets data around private site access enablement and authorized Virtual + * Networks that can access the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name The name of the web app. * - * @param {string} processId PID. + * @param {object} access The information for the private access + * + * @param {boolean} [access.enabled] Whether private access is enabled or not. + * + * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. + * + * @param {string} [access.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -22066,13 +22139,13 @@ function _listProcesses(resourceGroupName, name, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfo} for more information. + * See {@link PrivateAccess} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getProcess(resourceGroupName, name, processId, options, callback) { +function _putPrivateAccessVnet(resourceGroupName, name, access, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22104,8 +22177,8 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { - throw new Error('processId cannot be null or undefined and it must be of type string.'); + if (access === null || access === undefined) { + throw new Error('access cannot be null or undefined.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); @@ -22122,10 +22195,9 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -22135,7 +22207,7 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -22153,14 +22225,28 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (access !== null && access !== undefined) { + let requestModelMapper = new client.models['PrivateAccess']().mapper(); + requestModel = client.serialize(requestModelMapper, access, 'access'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(access, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -22170,12 +22256,13 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -22195,7 +22282,7 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfo']().mapper(); + let resultMapper = new client.models['PrivateAccess']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -22211,10 +22298,10 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { } /** - * @summary Terminate a process by its ID for a web site, or a deployment slot, - * or specific scaled-out instance in a web site. + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. * - * Terminate a process by its ID for a web site, or a deployment slot, or + * Get list of processes for a web site, or a deployment slot, or for a * specific scaled-out instance in a web site. * * @param {string} resourceGroupName Name of the resource group to which the @@ -22222,8 +22309,6 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { * * @param {string} name Site name. * - * @param {string} processId PID. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -22235,13 +22320,14 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfoCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteProcess(resourceGroupName, name, processId, options, callback) { +function _listProcesses(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22273,9 +22359,6 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { - throw new Error('processId cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -22291,10 +22374,9 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -22304,7 +22386,7 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -22329,7 +22411,7 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -22357,17 +22439,34 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * @summary Get a memory dump of a process by its ID for a specific scaled-out + * @summary Get process information by its ID for a specific scaled-out * instance in a web site. * - * Get a memory dump of a process by its ID for a specific scaled-out instance - * in a web site. + * Get process information by its ID for a specific scaled-out instance in a + * web site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -22388,12 +22487,13 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfo} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getProcessDump(resourceGroupName, name, processId, options, callback) { +function _getProcess(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22443,7 +22543,7 @@ function _getProcessDump(resourceGroupName, name, processId, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); @@ -22476,22 +22576,20 @@ function _getProcessDump(resourceGroupName, name, processId, options, callback) } httpRequest.body = null; // Send Request - httpRequest.streamedResponse = true; return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } - let statusCode = response.statusCode; if (statusCode !== 200 && statusCode !== 404) { - let error = new Error(`Unexpected status code: ${statusCode}`); + let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { - if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -22508,19 +22606,37 @@ function _getProcessDump(resourceGroupName, name, processId, options, callback) } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ProcessInfo']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + return callback(null, result, httpRequest, response); }); } /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -22540,15 +22656,13 @@ function _getProcessDump(resourceGroupName, name, processId, options, callback) * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfoCollection} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listProcessModules(resourceGroupName, name, processId, options, callback) { +function _deleteProcess(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22598,7 +22712,7 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); @@ -22611,7 +22725,7 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -22636,7 +22750,7 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -22664,34 +22778,170 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getProcessDump(resourceGroupName, name, processId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + httpRequest.streamedResponse = true; + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(`Unexpected status code: ${statusCode}`); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); } + return callback(error); } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * Get process information by its ID for a specific scaled-out instance in a - * web site. + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -22700,8 +22950,6 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba * * @param {string} processId PID. * - * @param {string} baseAddress Module base address. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -22714,13 +22962,14 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfo} for more information. + * See {@link ProcessModuleInfoCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getProcessModule(resourceGroupName, name, processId, baseAddress, options, callback) { +function _listProcessModules(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22755,9 +23004,6 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { throw new Error('processId cannot be null or undefined and it must be of type string.'); } - if (baseAddress === null || baseAddress === undefined || typeof baseAddress.valueOf() !== 'string') { - throw new Error('baseAddress cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -22773,11 +23019,10 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); - requestUrl = requestUrl.replace('{baseAddress}', encodeURIComponent(baseAddress)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -22847,7 +23092,7 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfo']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -22863,11 +23108,11 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti } /** - * @summary List the threads in a process by its ID for a specific scaled-out + * @summary Get process information by its ID for a specific scaled-out * instance in a web site. * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * Get process information by its ID for a specific scaled-out instance in a + * web site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -22876,6 +23121,8 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti * * @param {string} processId PID. * + * @param {string} baseAddress Module base address. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -22888,14 +23135,13 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfoCollection} for more - * information. + * See {@link ProcessModuleInfo} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listProcessThreads(resourceGroupName, name, processId, options, callback) { +function _getProcessModule(resourceGroupName, name, processId, baseAddress, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22930,6 +23176,9 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { throw new Error('processId cannot be null or undefined and it must be of type string.'); } + if (baseAddress === null || baseAddress === undefined || typeof baseAddress.valueOf() !== 'string') { + throw new Error('baseAddress cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -22945,10 +23194,11 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{baseAddress}', encodeURIComponent(baseAddress)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -23018,7 +23268,7 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessModuleInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -23034,11 +23284,11 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba } /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. * - * Get thread information by Thread ID for a specific process, in a specific - * scaled-out instance in a web site. + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -23047,8 +23297,6 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba * * @param {string} processId PID. * - * @param {string} threadId TID. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -23061,13 +23309,14 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfo} for more information. + * See {@link ProcessThreadInfoCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getProcessThread(resourceGroupName, name, processId, threadId, options, callback) { +function _listProcessThreads(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -23102,9 +23351,6 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { throw new Error('processId cannot be null or undefined and it must be of type string.'); } - if (threadId === null || threadId === undefined || typeof threadId.valueOf() !== 'string') { - throw new Error('threadId cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -23120,11 +23366,10 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads/{threadId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); - requestUrl = requestUrl.replace('{threadId}', encodeURIComponent(threadId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -23194,7 +23439,7 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfo']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -23210,182 +23455,20 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options } /** - * @summary Get public certificates for an app or a deployment slot. + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. * - * Get public certificates for an app or a deployment slot. + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PublicCertificateCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _listPublicCertificates(resourceGroupName, name, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === null || name === undefined || typeof name.valueOf() !== 'string') { - throw new Error('name cannot be null or undefined and it must be of type string.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicCertificateCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary Get the named public certificate for an app (or deployment slot, if - * specified). - * - * Get the named public certificate for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {string} name Site name. * - * @param {string} name Name of the app. + * @param {string} processId PID. * - * @param {string} publicCertificateName Public certificate name. + * @param {string} threadId TID. * * @param {object} [options] Optional Parameters. * @@ -23399,13 +23482,13 @@ function _listPublicCertificates(resourceGroupName, name, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PublicCertificate} for more information. + * See {@link ProcessThreadInfo} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getPublicCertificate(resourceGroupName, name, publicCertificateName, options, callback) { +function _getProcessThread(resourceGroupName, name, processId, threadId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -23437,8 +23520,11 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (publicCertificateName === null || publicCertificateName === undefined || typeof publicCertificateName.valueOf() !== 'string') { - throw new Error('publicCertificateName cannot be null or undefined and it must be of type string.'); + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (threadId === null || threadId === undefined || typeof threadId.valueOf() !== 'string') { + throw new Error('threadId cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); @@ -23455,10 +23541,11 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads/{threadId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{threadId}', encodeURIComponent(threadId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -23493,7 +23580,7 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -23503,13 +23590,12 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -23529,7 +23615,7 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicCertificate']().mapper(); + let resultMapper = new client.models['ProcessThreadInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -23545,28 +23631,15 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o } /** - * @summary Creates a hostname binding for an app. + * @summary Get public certificates for an app or a deployment slot. * - * Creates a hostname binding for an app. + * Get public certificates for an app or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} publicCertificateName Public certificate name. - * - * @param {object} publicCertificate Public certificate details. This is the - * JSON representation of a PublicCertificate object. - * - * @param {buffer} [publicCertificate.blob] Public Certificate byte array - * - * @param {string} [publicCertificate.publicCertificateLocation] Public - * Certificate Location. Possible values include: 'CurrentUserMy', - * 'LocalMachineMy', 'Unknown' - * - * @param {string} [publicCertificate.kind] Kind of resource. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -23579,13 +23652,14 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PublicCertificate} for more information. + * See {@link PublicCertificateCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertificateName, publicCertificate, options, callback) { +function _listPublicCertificates(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -23617,12 +23691,6 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (publicCertificateName === null || publicCertificateName === undefined || typeof publicCertificateName.valueOf() !== 'string') { - throw new Error('publicCertificateName cannot be null or undefined and it must be of type string.'); - } - if (publicCertificate === null || publicCertificate === undefined) { - throw new Error('publicCertificate cannot be null or undefined.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -23638,10 +23706,9 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -23651,7 +23718,7 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -23669,21 +23736,375 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (publicCertificate !== null && publicCertificate !== undefined) { - let requestModelMapper = new client.models['PublicCertificate']().mapper(); - requestModel = client.serialize(requestModelMapper, publicCertificate, 'publicCertificate'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(publicCertificate, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PublicCertificateCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get the named public certificate for an app (or deployment slot, if + * specified). + * + * Get the named public certificate for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PublicCertificate} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getPublicCertificate(resourceGroupName, name, publicCertificateName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (publicCertificateName === null || publicCertificateName === undefined || typeof publicCertificateName.valueOf() !== 'string') { + throw new Error('publicCertificateName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PublicCertificate']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @param {object} publicCertificate Public certificate details. This is the + * JSON representation of a PublicCertificate object. + * + * @param {buffer} [publicCertificate.blob] Public Certificate byte array + * + * @param {string} [publicCertificate.publicCertificateLocation] Public + * Certificate Location. Possible values include: 'CurrentUserMy', + * 'LocalMachineMy', 'Unknown' + * + * @param {string} [publicCertificate.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PublicCertificate} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertificateName, publicCertificate, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (publicCertificateName === null || publicCertificateName === undefined || typeof publicCertificateName.valueOf() !== 'string') { + throw new Error('publicCertificateName cannot be null or undefined and it must be of type string.'); + } + if (publicCertificate === null || publicCertificate === undefined) { + throw new Error('publicCertificate cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (publicCertificate !== null && publicCertificate !== undefined) { + let requestModelMapper = new client.models['PublicCertificate']().mapper(); + requestModel = client.serialize(requestModelMapper, publicCertificate, 'publicCertificate'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(publicCertificate, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -44567,7 +44988,7 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -44732,7 +45153,21 @@ function _getNetworkTraceOperationSlot(resourceGroupName, name, operationId, slo parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Operation']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -44982,7 +45417,7 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -45029,7 +45464,15 @@ function _startWebSiteNetworkTraceOperationSlot(resourceGroupName, name, slot, o required: false, serializedName: 'parsedResponse', type: { - name: 'Object' + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } } }; result = client.deserialize(resultMapper, parsedResponse, 'result'); @@ -45388,10 +45831,10 @@ function _getNetworkTracesSlot(resourceGroupName, name, operationId, slot, optio } /** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). * - * Generates a new publishing password for an app (or deployment slot, if + * Gets a named operation for a network trace capturing (or deployment slot, if * specified). * * @param {string} resourceGroupName Name of the resource group to which the @@ -45399,9 +45842,10 @@ function _getNetworkTracesSlot(resourceGroupName, name, operationId, slot, optio * * @param {string} name Name of the app. * + * @param {string} operationId GUID of the operation. + * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API generate a new publishing password for the production - * slot. + * specified, the API will get an operation for the production slot. * * @param {object} [options] Optional Parameters. * @@ -45414,13 +45858,13 @@ function _getNetworkTracesSlot(resourceGroupName, name, operationId, slot, optio * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, callback) { +function _getNetworkTraceOperationSlotV2(resourceGroupName, name, operationId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -45452,6 +45896,9 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } + if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string') { + throw new Error('operationId cannot be null or undefined and it must be of type string.'); + } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -45470,9 +45917,10 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/current/operationresults/{operationId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{operationId}', encodeURIComponent(operationId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -45483,7 +45931,7 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -45508,7 +45956,7 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -45518,12 +45966,13 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -45536,30 +45985,91 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } return callback(null, result, httpRequest, response); }); } /** - * @summary Gets perfmon counters for web app. + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). * - * Gets perfmon counters for web app. + * Gets a named operation for a network trace capturing (or deployment slot, if + * specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @param {string} operationId GUID of the operation. * - * @param {object} [options] Optional Parameters. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get an operation for the production slot. * - * @param {string} [options.filter] Return only usages/metrics specified in the - * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq - * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -45570,15 +46080,13 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PerfMonCounterCollection} for more - * information. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callback) { +function _getNetworkTracesSlotV2(resourceGroupName, name, operationId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -45588,7 +46096,6 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -45611,12 +46118,12 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } + if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string') { + throw new Error('operationId cannot be null or undefined and it must be of type string.'); + } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } - if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -45632,15 +46139,13 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/perfcounters'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/{operationId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{operationId}', encodeURIComponent(operationId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + filter); - } queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -45709,7 +46214,21 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -45725,17 +46244,20 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba } /** - * @summary Gets web app's event logs. + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). * - * Gets web app's event logs. + * Generates a new publishing password for an app (or deployment slot, if + * specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API generate a new publishing password for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -45748,14 +46270,13 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SitePhpErrorLogFlag} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, callback) { +function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -45805,7 +46326,7 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); @@ -45818,7 +46339,7 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -45843,7 +46364,7 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -45853,13 +46374,12 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -45872,43 +46392,31 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SitePhpErrorLogFlag']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Gets the premier add-ons of an app. + * @summary Gets perfmon counters for web app. * - * Gets the premier add-ons of an app. + * Gets perfmon counters for web app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Name of web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the premier add-ons for the production slot. + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -45919,13 +46427,14 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PremierAddOn} for more information. + * See {@link PerfMonCounterCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback) { +function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -45935,6 +46444,7 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback if (!callback) { throw new Error('callback cannot be null.'); } + let filter = (options && options.filter !== undefined) ? options.filter : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -45960,6 +46470,9 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -45975,12 +46488,15 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/perfcounters'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -46049,7 +46565,7 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PremierAddOn']().mapper(); + let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -46065,19 +46581,17 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback } /** - * @summary Gets a named add-on of an app. + * @summary Gets web app's event logs. * - * Gets a named add-on of an app. + * Gets web app's event logs. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {string} premierAddOnName Add-on name. + * @param {string} name Name of web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the named add-on for the production slot. + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -46091,13 +46605,13 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PremierAddOn} for more information. + * See {@link SitePhpErrorLogFlag} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, callback) { +function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -46129,9 +46643,6 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (premierAddOnName === null || premierAddOnName === undefined || typeof premierAddOnName.valueOf() !== 'string') { - throw new Error('premierAddOnName cannot be null or undefined and it must be of type string.'); - } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -46150,10 +46661,9 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -46225,7 +46735,7 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PremierAddOn']().mapper(); + let resultMapper = new client.models['SitePhpErrorLogFlag']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -46241,40 +46751,17 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o } /** - * @summary Updates a named add-on of an app. + * @summary Gets the premier add-ons of an app. * - * Updates a named add-on of an app. + * Gets the premier add-ons of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} premierAddOnName Add-on name. - * - * @param {object} premierAddOn A JSON representation of the edited premier - * add-on. - * - * @param {string} [premierAddOn.sku] Premier add on SKU. - * - * @param {string} [premierAddOn.product] Premier add on Product. - * - * @param {string} [premierAddOn.vendor] Premier add on Vendor. - * - * @param {string} [premierAddOn.marketplacePublisher] Premier add on - * Marketplace publisher. - * - * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace - * offer. - * - * @param {string} [premierAddOn.kind] Kind of resource. - * - * @param {string} premierAddOn.location Resource Location. - * - * @param {object} [premierAddOn.tags] Resource tags. - * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will update the named add-on for the production slot. + * specified, the API will get the premier add-ons for the production slot. * * @param {object} [options] Optional Parameters. * @@ -46294,7 +46781,7 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, callback) { +function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -46326,12 +46813,6 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (premierAddOnName === null || premierAddOnName === undefined || typeof premierAddOnName.valueOf() !== 'string') { - throw new Error('premierAddOnName cannot be null or undefined and it must be of type string.'); - } - if (premierAddOn === null || premierAddOn === undefined) { - throw new Error('premierAddOn cannot be null or undefined.'); - } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -46350,10 +46831,9 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -46364,7 +46844,7 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -46382,21 +46862,7 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (premierAddOn !== null && premierAddOn !== undefined) { - let requestModelMapper = new client.models['PremierAddOn']().mapper(); - requestModel = client.serialize(requestModelMapper, premierAddOn, 'premierAddOn'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(premierAddOn, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -46455,9 +46921,9 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier } /** - * @summary Delete a premier add-on from an app. + * @summary Gets a named add-on of an app. * - * Delete a premier add-on from an app. + * Gets a named add-on of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -46467,7 +46933,7 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier * @param {string} premierAddOnName Add-on name. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete the named add-on for the production slot. + * specified, the API will get the named add-on for the production slot. * * @param {object} [options] Optional Parameters. * @@ -46480,13 +46946,14 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, callback) { +function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -46553,7 +47020,7 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -46588,12 +47055,13 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -46606,6 +47074,23 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PremierAddOn']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); @@ -46640,6 +47125,10 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot * * @param {string} [premierAddOn.kind] Kind of resource. * + * @param {string} premierAddOn.location Resource Location. + * + * @param {object} [premierAddOn.tags] Resource tags. + * * @param {string} slot Name of the deployment slot. If a slot is not * specified, the API will update the named add-on for the production slot. * @@ -46661,7 +47150,7 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, callback) { +function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -46731,7 +47220,7 @@ function _updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, prem // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -46754,7 +47243,7 @@ function _updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, prem let requestModel = null; try { if (premierAddOn !== null && premierAddOn !== undefined) { - let requestModelMapper = new client.models['PremierAddOnPatchResource']().mapper(); + let requestModelMapper = new client.models['PremierAddOn']().mapper(); requestModel = client.serialize(requestModelMapper, premierAddOn, 'premierAddOn'); requestContent = JSON.stringify(requestModel); } @@ -46822,18 +47311,19 @@ function _updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, prem } /** - * @summary Gets data around private site access enablement and authorized - * Virtual Networks that can access the site. + * @summary Delete a premier add-on from an app. * - * Gets data around private site access enablement and authorized Virtual - * Networks that can access the site. + * Delete a premier add-on from an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name The name of the web app. + * @param {string} name Name of the app. * - * @param {string} slot The name of the slot for the web app. + * @param {string} premierAddOnName Add-on name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the named add-on for the production slot. * * @param {object} [options] Optional Parameters. * @@ -46846,14 +47336,13 @@ function _updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, prem * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PrivateAccess} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getPrivateAccessSlot(resourceGroupName, name, slot, options, callback) { +function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -46885,6 +47374,9 @@ function _getPrivateAccessSlot(resourceGroupName, name, slot, options, callback) if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } + if (premierAddOnName === null || premierAddOnName === undefined || typeof premierAddOnName.valueOf() !== 'string') { + throw new Error('premierAddOnName cannot be null or undefined and it must be of type string.'); + } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -46903,9 +47395,10 @@ function _getPrivateAccessSlot(resourceGroupName, name, slot, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -46916,7 +47409,7 @@ function _getPrivateAccessSlot(resourceGroupName, name, slot, options, callback) // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -46951,13 +47444,12 @@ function _getPrivateAccessSlot(resourceGroupName, name, slot, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -46970,50 +47462,42 @@ function _getPrivateAccessSlot(resourceGroupName, name, slot, options, callback) // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PrivateAccess']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Sets data around private site access enablement and authorized - * Virtual Networks that can access the site. + * @summary Updates a named add-on of an app. * - * Sets data around private site access enablement and authorized Virtual - * Networks that can access the site. + * Updates a named add-on of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name The name of the web app. + * @param {string} name Name of the app. * - * @param {object} access The information for the private access + * @param {string} premierAddOnName Add-on name. * - * @param {boolean} [access.enabled] Whether private access is enabled or not. + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. * - * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) - * allowed to access the site privately. + * @param {string} [premierAddOn.sku] Premier add on SKU. * - * @param {string} [access.kind] Kind of resource. + * @param {string} [premierAddOn.product] Premier add on Product. * - * @param {string} slot The name of the slot for the web app. + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the named add-on for the production slot. * * @param {object} [options] Optional Parameters. * @@ -47027,13 +47511,13 @@ function _getPrivateAccessSlot(resourceGroupName, name, slot, options, callback) * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PrivateAccess} for more information. + * See {@link PremierAddOn} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, options, callback) { +function _updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47065,8 +47549,11 @@ function _putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, option if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (access === null || access === undefined) { - throw new Error('access cannot be null or undefined.'); + if (premierAddOnName === null || premierAddOnName === undefined || typeof premierAddOnName.valueOf() !== 'string') { + throw new Error('premierAddOnName cannot be null or undefined and it must be of type string.'); + } + if (premierAddOn === null || premierAddOn === undefined) { + throw new Error('premierAddOn cannot be null or undefined.'); } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); @@ -47086,9 +47573,10 @@ function _putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, option // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -47099,7 +47587,7 @@ function _putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, option // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -47121,14 +47609,14 @@ function _putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, option let requestContent = null; let requestModel = null; try { - if (access !== null && access !== undefined) { - let requestModelMapper = new client.models['PrivateAccess']().mapper(); - requestModel = client.serialize(requestModelMapper, access, 'access'); + if (premierAddOn !== null && premierAddOn !== undefined) { + let requestModelMapper = new client.models['PremierAddOnPatchResource']().mapper(); + requestModel = client.serialize(requestModelMapper, premierAddOn, 'premierAddOn'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(access, null, 2)}.`); + `payload - ${JSON.stringify(premierAddOn, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -47174,7 +47662,7 @@ function _putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, option parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PrivateAccess']().mapper(); + let resultMapper = new client.models['PremierAddOn']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -47190,19 +47678,18 @@ function _putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, option } /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. + * Gets data around private site access enablement and authorized Virtual + * Networks that can access the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name The name of the web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. + * @param {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -47216,13 +47703,13 @@ function _putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, option * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfoCollection} for more information. + * See {@link PrivateAccess} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { +function _getPrivateAccessSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47272,7 +47759,7 @@ function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); @@ -47310,7 +47797,7 @@ function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -47320,12 +47807,13 @@ function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -47345,7 +47833,7 @@ function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = new client.models['PrivateAccess']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -47361,21 +47849,27 @@ function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Get process information by its ID for a specific scaled-out instance in a - * web site. + * Sets data around private site access enablement and authorized Virtual + * Networks that can access the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name The name of the web app. * - * @param {string} processId PID. + * @param {object} access The information for the private access * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. + * @param {boolean} [access.enabled] Whether private access is enabled or not. + * + * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. + * + * @param {string} [access.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -47389,13 +47883,13 @@ function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfo} for more information. + * See {@link PrivateAccess} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getProcessSlot(resourceGroupName, name, processId, slot, options, callback) { +function _putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47427,8 +47921,8 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { - throw new Error('processId cannot be null or undefined and it must be of type string.'); + if (access === null || access === undefined) { + throw new Error('access cannot be null or undefined.'); } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); @@ -47448,10 +47942,9 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -47462,7 +47955,7 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -47480,14 +47973,28 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (access !== null && access !== undefined) { + let requestModelMapper = new client.models['PrivateAccess']().mapper(); + requestModel = client.serialize(requestModelMapper, access, 'access'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(access, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -47497,12 +48004,13 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -47522,7 +48030,7 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfo']().mapper(); + let resultMapper = new client.models['PrivateAccess']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -47538,10 +48046,10 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call } /** - * @summary Terminate a process by its ID for a web site, or a deployment slot, - * or specific scaled-out instance in a web site. + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. * - * Terminate a process by its ID for a web site, or a deployment slot, or + * Get list of processes for a web site, or a deployment slot, or for a * specific scaled-out instance in a web site. * * @param {string} resourceGroupName Name of the resource group to which the @@ -47549,8 +48057,6 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call * * @param {string} name Site name. * - * @param {string} processId PID. - * * @param {string} slot Name of the deployment slot. If a slot is not * specified, the API returns deployments for the production slot. * @@ -47565,13 +48071,14 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfoCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, callback) { +function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47603,9 +48110,6 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { - throw new Error('processId cannot be null or undefined and it must be of type string.'); - } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -47624,10 +48128,9 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -47638,7 +48141,7 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -47663,7 +48166,7 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -47691,17 +48194,34 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * @summary Get a memory dump of a process by its ID for a specific scaled-out + * @summary Get process information by its ID for a specific scaled-out * instance in a web site. * - * Get a memory dump of a process by its ID for a specific scaled-out instance - * in a web site. + * Get process information by its ID for a specific scaled-out instance in a + * web site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -47725,12 +48245,13 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfo} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getProcessDumpSlot(resourceGroupName, name, processId, slot, options, callback) { +function _getProcessSlot(resourceGroupName, name, processId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47783,7 +48304,7 @@ function _getProcessDumpSlot(resourceGroupName, name, processId, slot, options, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); @@ -47817,22 +48338,20 @@ function _getProcessDumpSlot(resourceGroupName, name, processId, slot, options, } httpRequest.body = null; // Send Request - httpRequest.streamedResponse = true; return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } - let statusCode = response.statusCode; if (statusCode !== 200 && statusCode !== 404) { - let error = new Error(`Unexpected status code: ${statusCode}`); + let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { - if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -47849,19 +48368,37 @@ function _getProcessDumpSlot(resourceGroupName, name, processId, slot, options, } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ProcessInfo']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + return callback(null, result, httpRequest, response); }); } /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -47884,15 +48421,13 @@ function _getProcessDumpSlot(resourceGroupName, name, processId, slot, options, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfoCollection} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listProcessModulesSlot(resourceGroupName, name, processId, slot, options, callback) { +function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47945,7 +48480,7 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); @@ -47959,7 +48494,7 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -47984,7 +48519,7 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -48012,34 +48547,17 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Get process information by its ID for a specific scaled-out + * @summary Get a memory dump of a process by its ID for a specific scaled-out * instance in a web site. * - * Get process information by its ID for a specific scaled-out instance in a - * web site. + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -48048,8 +48566,6 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio * * @param {string} processId PID. * - * @param {string} baseAddress Module base address. - * * @param {string} slot Name of the deployment slot. If a slot is not * specified, the API returns deployments for the production slot. * @@ -48065,13 +48581,12 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfo} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, options, callback) { +function _getProcessDumpSlot(resourceGroupName, name, processId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -48106,9 +48621,6 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { throw new Error('processId cannot be null or undefined and it must be of type string.'); } - if (baseAddress === null || baseAddress === undefined || typeof baseAddress.valueOf() !== 'string') { - throw new Error('baseAddress cannot be null or undefined and it must be of type string.'); - } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -48127,11 +48639,10 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules/{baseAddress}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); - requestUrl = requestUrl.replace('{baseAddress}', encodeURIComponent(baseAddress)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -48162,20 +48673,22 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, } httpRequest.body = null; // Send Request + httpRequest.streamedResponse = true; return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } + let statusCode = response.statusCode; if (statusCode !== 200 && statusCode !== 404) { - let error = new Error(responseBody); + let error = new Error(`Unexpected status code: ${statusCode}`); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { - parsedErrorResponse = JSON.parse(responseBody); + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -48192,37 +48705,19 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfo']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -48246,14 +48741,14 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfoCollection} for more + * See {@link ProcessModuleInfoCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, options, callback) { +function _listProcessModulesSlot(resourceGroupName, name, processId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -48306,7 +48801,7 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); @@ -48380,7 +48875,7 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -48396,11 +48891,11 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio } /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. * - * Get thread information by Thread ID for a specific process, in a specific - * scaled-out instance in a web site. + * Get process information by its ID for a specific scaled-out instance in a + * web site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -48409,7 +48904,7 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio * * @param {string} processId PID. * - * @param {string} threadId TID. + * @param {string} baseAddress Module base address. * * @param {string} slot Name of the deployment slot. If a slot is not * specified, the API returns deployments for the production slot. @@ -48426,13 +48921,13 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfo} for more information. + * See {@link ProcessModuleInfo} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, options, callback) { +function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -48467,8 +48962,8 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { throw new Error('processId cannot be null or undefined and it must be of type string.'); } - if (threadId === null || threadId === undefined || typeof threadId.valueOf() !== 'string') { - throw new Error('threadId cannot be null or undefined and it must be of type string.'); + if (baseAddress === null || baseAddress === undefined || typeof baseAddress.valueOf() !== 'string') { + throw new Error('baseAddress cannot be null or undefined and it must be of type string.'); } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); @@ -48488,11 +48983,11 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads/{threadId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules/{baseAddress}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); - requestUrl = requestUrl.replace('{threadId}', encodeURIComponent(threadId)); + requestUrl = requestUrl.replace('{baseAddress}', encodeURIComponent(baseAddress)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -48563,7 +49058,7 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfo']().mapper(); + let resultMapper = new client.models['ProcessModuleInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -48579,17 +49074,21 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo } /** - * @summary Get public certificates for an app or a deployment slot. + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. * - * Get public certificates for an app or a deployment slot. + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Site name. + * + * @param {string} processId PID. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API gets hostname bindings for the production slot. + * specified, the API returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -48603,14 +49102,14 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PublicCertificateCollection} for more + * See {@link ProcessThreadInfoCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, callback) { +function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -48642,6 +49141,9 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -48660,9 +49162,10 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -48698,7 +49201,7 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -48708,13 +49211,12 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -48734,7 +49236,7 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicCertificateCollection']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -48750,21 +49252,23 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal } /** - * @summary Get the named public certificate for an app (or deployment slot, if - * specified). + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. * - * Get the named public certificate for an app (or deployment slot, if - * specified). + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Site name. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API the named binding for the production slot. + * @param {string} processId PID. * - * @param {string} publicCertificateName Public certificate name. + * @param {string} threadId TID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -48778,13 +49282,13 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PublicCertificate} for more information. + * See {@link ProcessThreadInfo} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, callback) { +function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -48816,12 +49320,15 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (threadId === null || threadId === undefined || typeof threadId.valueOf() !== 'string') { + throw new Error('threadId cannot be null or undefined and it must be of type string.'); + } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } - if (publicCertificateName === null || publicCertificateName === undefined || typeof publicCertificateName.valueOf() !== 'string') { - throw new Error('publicCertificateName cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -48837,11 +49344,12 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads/{threadId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{threadId}', encodeURIComponent(threadId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); - requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -48876,7 +49384,7 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -48886,13 +49394,12 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -48912,7 +49419,7 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicCertificate']().mapper(); + let resultMapper = new client.models['ProcessThreadInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -48928,30 +49435,17 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific } /** - * @summary Creates a hostname binding for an app. + * @summary Get public certificates for an app or a deployment slot. * - * Creates a hostname binding for an app. + * Get public certificates for an app or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} publicCertificateName Public certificate name. - * - * @param {object} publicCertificate Public certificate details. This is the - * JSON representation of a PublicCertificate object. - * - * @param {buffer} [publicCertificate.blob] Public Certificate byte array - * - * @param {string} [publicCertificate.publicCertificateLocation] Public - * Certificate Location. Possible values include: 'CurrentUserMy', - * 'LocalMachineMy', 'Unknown' - * - * @param {string} [publicCertificate.kind] Kind of resource. - * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will create a binding for the production slot. + * specified, the API gets hostname bindings for the production slot. * * @param {object} [options] Optional Parameters. * @@ -48965,13 +49459,14 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PublicCertificate} for more information. + * See {@link PublicCertificateCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCertificateName, publicCertificate, slot, options, callback) { +function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -49003,12 +49498,6 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (publicCertificateName === null || publicCertificateName === undefined || typeof publicCertificateName.valueOf() !== 'string') { - throw new Error('publicCertificateName cannot be null or undefined and it must be of type string.'); - } - if (publicCertificate === null || publicCertificate === undefined) { - throw new Error('publicCertificate cannot be null or undefined.'); - } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -49027,10 +49516,9 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -49041,7 +49529,7 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -49059,21 +49547,7 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (publicCertificate !== null && publicCertificate !== undefined) { - let requestModelMapper = new client.models['PublicCertificate']().mapper(); - requestModel = client.serialize(requestModelMapper, publicCertificate, 'publicCertificate'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(publicCertificate, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -49116,7 +49590,7 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicCertificate']().mapper(); + let resultMapper = new client.models['PublicCertificateCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -49132,9 +49606,11 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer } /** - * @summary Deletes a hostname binding for an app. + * @summary Get the named public certificate for an app (or deployment slot, if + * specified). * - * Deletes a hostname binding for an app. + * Get the named public certificate for an app (or deployment slot, if + * specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -49142,7 +49618,7 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete the binding for the production slot. + * specified, the API the named binding for the production slot. * * @param {string} publicCertificateName Public certificate name. * @@ -49157,13 +49633,14 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PublicCertificate} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, callback) { +function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -49230,7 +49707,7 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -49255,7 +49732,7 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -49265,12 +49742,13 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -49283,37 +49761,53 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PublicCertificate']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * @summary Gets the publishing profile for an app (or deployment slot, if - * specified). + * @summary Creates a hostname binding for an app. * - * Gets the publishing profile for an app (or deployment slot, if specified). + * Creates a hostname binding for an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {object} publishingProfileOptions Specifies publishingProfileOptions - * for publishing profile. For example, use {"format": "FileZilla3"} to get a - * FileZilla publishing profile. + * @param {string} publicCertificateName Public certificate name. * - * @param {string} [publishingProfileOptions.format] Name of the format. Valid - * values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * @param {object} publicCertificate Public certificate details. This is the + * JSON representation of a PublicCertificate object. * - * @param {boolean} [publishingProfileOptions.includeDisasterRecoveryEndpoints] - * Include the DisasterRecover endpoint if true + * @param {buffer} [publicCertificate.blob] Public Certificate byte array + * + * @param {string} [publicCertificate.publicCertificateLocation] Public + * Certificate Location. Possible values include: 'CurrentUserMy', + * 'LocalMachineMy', 'Unknown' + * + * @param {string} [publicCertificate.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the publishing profile for the production slot. + * specified, the API will create a binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -49327,12 +49821,13 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PublicCertificate} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, publishingProfileOptions, slot, options, callback) { +function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCertificateName, publicCertificate, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -49364,8 +49859,11 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, publi if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (publishingProfileOptions === null || publishingProfileOptions === undefined) { - throw new Error('publishingProfileOptions cannot be null or undefined.'); + if (publicCertificateName === null || publicCertificateName === undefined || typeof publicCertificateName.valueOf() !== 'string') { + throw new Error('publicCertificateName cannot be null or undefined and it must be of type string.'); + } + if (publicCertificate === null || publicCertificate === undefined) { + throw new Error('publicCertificate cannot be null or undefined.'); } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); @@ -49385,9 +49883,10 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, publi // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -49398,7 +49897,7 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, publi // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -49420,34 +49919,32 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, publi let requestContent = null; let requestModel = null; try { - if (publishingProfileOptions !== null && publishingProfileOptions !== undefined) { - let requestModelMapper = new client.models['CsmPublishingProfileOptions']().mapper(); - requestModel = client.serialize(requestModelMapper, publishingProfileOptions, 'publishingProfileOptions'); + if (publicCertificate !== null && publicCertificate !== undefined) { + let requestModelMapper = new client.models['PublicCertificate']().mapper(); + requestModel = client.serialize(requestModelMapper, publicCertificate, 'publicCertificate'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(publishingProfileOptions, null, 2)}.`); + `payload - ${JSON.stringify(publicCertificate, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; // Send Request - httpRequest.streamedResponse = true; return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } - let statusCode = response.statusCode; if (statusCode !== 200) { - let error = new Error(`Unexpected status code: ${statusCode}`); + let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; let parsedErrorResponse; try { - if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { let internalError = null; if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; @@ -49465,19 +49962,35 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, publi } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PublicCertificate']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + return callback(null, result, httpRequest, response); }); } /** - * @summary Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * @summary Deletes a hostname binding for an app. * - * Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * Deletes a hostname binding for an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -49485,7 +49998,9 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, publi * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API resets configuration settings for the production slot. + * specified, the API will delete the binding for the production slot. + * + * @param {string} publicCertificateName Public certificate name. * * @param {object} [options] Optional Parameters. * @@ -49504,7 +50019,7 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, publi * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, callback) { +function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -49539,6 +50054,9 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } + if (publicCertificateName === null || publicCertificateName === undefined || typeof publicCertificateName.valueOf() !== 'string') { + throw new Error('publicCertificateName cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -49554,10 +50072,11 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -49567,7 +50086,7 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -49592,7 +50111,344 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets the publishing profile for an app (or deployment slot, if + * specified). + * + * Gets the publishing profile for an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} publishingProfileOptions Specifies publishingProfileOptions + * for publishing profile. For example, use {"format": "FileZilla3"} to get a + * FileZilla publishing profile. + * + * @param {string} [publishingProfileOptions.format] Name of the format. Valid + * values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {boolean} [publishingProfileOptions.includeDisasterRecoveryEndpoints] + * Include the DisasterRecover endpoint if true + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the publishing profile for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, publishingProfileOptions, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (publishingProfileOptions === null || publishingProfileOptions === undefined) { + throw new Error('publishingProfileOptions cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (publishingProfileOptions !== null && publishingProfileOptions !== undefined) { + let requestModelMapper = new client.models['CsmPublishingProfileOptions']().mapper(); + requestModel = client.serialize(requestModelMapper, publishingProfileOptions, 'publishingProfileOptions'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(publishingProfileOptions, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + httpRequest.streamedResponse = true; + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(`Unexpected status code: ${statusCode}`); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + + // Create Result + let result = response; + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API resets configuration settings for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -52162,21 +53018,29 @@ function _startSlot(resourceGroupName, name, slot, options, callback) { }); } + /** - * @summary Stops an app (or deployment slot, if specified). + * @summary Start capturing network packets for the site. * - * Stops an app (or deployment slot, if specified). + * Start capturing network packets for the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name The name of the web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will stop the production slot. + * @param {string} slot The name of the slot for this web app. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -52186,145 +53050,90 @@ function _startSlot(resourceGroupName, name, slot, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _stopSlot(resourceGroupName, name, slot, options, callback) { +function _startNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } + if (!callback) { throw new Error('callback cannot be null.'); } - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === null || name === undefined || typeof name.valueOf() !== 'string') { - throw new Error('name cannot be null or undefined and it must be of type string.'); - } - if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { - throw new Error('slot cannot be null or undefined and it must be of type string.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + // Send request + this.beginStartNetworkTraceSlot(resourceGroupName, name, slot, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'POST'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; if (responseBody === '') responseBody = null; - let parsedErrorResponse; + + // Deserialize Response + let parsedResponse = null; try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - return callback(null, result, httpRequest, response); + return callback(null, result, httpRequest, response); + }); }); } /** - * @summary Sync web app repository. + * @summary Stops an app (or deployment slot, if specified). * - * Sync web app repository. + * Stops an app (or deployment slot, if specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will stop the production slot. * * @param {object} [options] Optional Parameters. * @@ -52343,7 +53152,7 @@ function _stopSlot(resourceGroupName, name, slot, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { +function _stopSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52393,7 +53202,7 @@ function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); @@ -52465,17 +53274,16 @@ function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Syncs function trigger metadata to the scale controller + * @summary Stop ongoing capturing network packets for the site. * - * Syncs function trigger metadata to the scale controller + * Stop ongoing capturing network packets for the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name The name of the web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will restore a backup of the production slot. + * @param {string} slot The name of the slot for this web app. * * @param {object} [options] Optional Parameters. * @@ -52494,7 +53302,7 @@ function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callback) { +function _stopNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52544,7 +53352,7 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stopNetworkTrace'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); @@ -52582,7 +53390,7 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callb return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -52616,17 +53424,17 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callb } /** - * @summary List triggered web jobs for an app, or a deployment slot. + * @summary Sync web app repository. * - * List triggered web jobs for an app, or a deployment slot. + * Sync web app repository. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -52639,15 +53447,13 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callb * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TriggeredWebJobCollection} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callback) { +function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52697,7 +53503,7 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); @@ -52710,7 +53516,7 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -52745,13 +53551,12 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -52764,43 +53569,23 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredWebJobCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Gets a triggered web job by its ID for an app, or a deployment - * slot. + * @summary Syncs function trigger metadata to the scale controller * - * Gets a triggered web job by its ID for an app, or a deployment slot. + * Syncs function trigger metadata to the scale controller * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. - * - * @param {string} webJobName Name of Web Job. + * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * specified, the API will restore a backup of the production slot. * * @param {object} [options] Optional Parameters. * @@ -52813,14 +53598,13 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TriggeredWebJob} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52852,9 +53636,6 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { - throw new Error('webJobName cannot be null or undefined and it must be of type string.'); - } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -52873,10 +53654,9 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -52887,7 +53667,7 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -52912,7 +53692,7 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -52940,6 +53720,160 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti // Create Result let result = null; if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link TriggeredWebJobCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; // Deserialize Response if (statusCode === 200) { let parsedResponse = null; @@ -52947,7 +53881,7 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredWebJob']().mapper(); + let resultMapper = new client.models['TriggeredWebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -52963,10 +53897,10 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti } /** - * @summary Delete a triggered web job by its ID for an app, or a deployment + * @summary Gets a triggered web job by its ID for an app, or a deployment * slot. * - * Delete a triggered web job by its ID for an app, or a deployment slot. + * Gets a triggered web job by its ID for an app, or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -52989,13 +53923,14 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link TriggeredWebJob} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53062,7 +53997,7 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, o // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -53087,7 +54022,7 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, o return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -53115,16 +54050,33 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, o // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['TriggeredWebJob']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * @summary List a triggered web job's history for an app, or a deployment + * @summary Delete a triggered web job by its ID for an app, or a deployment * slot. * - * List a triggered web job's history for an app, or a deployment slot. + * Delete a triggered web job by its ID for an app, or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -53147,15 +54099,13 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, o * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TriggeredJobHistoryCollection} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53208,7 +54158,7 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); @@ -53222,7 +54172,7 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -53247,7 +54197,7 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -53275,35 +54225,17 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredJobHistoryCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Gets a triggered web job's history by its ID for an app, , or a - * deployment slot. - * - * Gets a triggered web job's history by its ID for an app, , or a deployment + * @summary List a triggered web job's history for an app, or a deployment * slot. * + * List a triggered web job's history for an app, or a deployment slot. + * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * @@ -53311,8 +54243,6 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl * * @param {string} webJobName Name of Web Job. * - * @param {string} id History ID. - * * @param {string} slot Name of the deployment slot. If a slot is not * specified, the API deletes a deployment for the production slot. * @@ -53328,13 +54258,14 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TriggeredJobHistory} for more information. + * See {@link TriggeredJobHistoryCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, slot, options, callback) { +function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53369,9 +54300,6 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { throw new Error('webJobName cannot be null or undefined and it must be of type string.'); } - if (id === null || id === undefined || typeof id.valueOf() !== 'string') { - throw new Error('id cannot be null or undefined and it must be of type string.'); - } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -53390,11 +54318,10 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); - requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -53465,7 +54392,7 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredJobHistory']().mapper(); + let resultMapper = new client.models['TriggeredJobHistoryCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -53481,9 +54408,11 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, } /** - * @summary Run a triggered web job for an app, or a deployment slot. + * @summary Gets a triggered web job's history by its ID for an app, , or a + * deployment slot. * - * Run a triggered web job for an app, or a deployment slot. + * Gets a triggered web job's history by its ID for an app, , or a deployment + * slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -53492,6 +54421,8 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, * * @param {string} webJobName Name of Web Job. * + * @param {string} id History ID. + * * @param {string} slot Name of the deployment slot. If a slot is not * specified, the API deletes a deployment for the production slot. * @@ -53506,13 +54437,14 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link TriggeredJobHistory} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53547,6 +54479,9 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { throw new Error('webJobName cannot be null or undefined and it must be of type string.'); } + if (id === null || id === undefined || typeof id.valueOf() !== 'string') { + throw new Error('id cannot be null or undefined and it must be of type string.'); + } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -53565,10 +54500,11 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/run'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -53579,7 +54515,181 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['TriggeredJobHistory']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Run a triggered web job for an app, or a deployment slot. + * + * Run a triggered web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/run'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -57134,6 +58244,108 @@ function _start(resourceGroupName, name, options, callback) { }); } + +/** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _startNetworkTrace(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginStartNetworkTrace(resourceGroupName, name, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + /** * @summary Stops an app (or deployment slot, if specified). * @@ -57279,14 +58491,14 @@ function _stop(resourceGroupName, name, options, callback) { } /** - * @summary Sync web app repository. + * @summary Stop ongoing capturing network packets for the site. * - * Sync web app repository. + * Stop ongoing capturing network packets for the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name The name of the web app. * * @param {object} [options] Optional Parameters. * @@ -57305,7 +58517,7 @@ function _stop(resourceGroupName, name, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _syncRepository(resourceGroupName, name, options, callback) { +function _stopNetworkTrace(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -57352,7 +58564,7 @@ function _syncRepository(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stopNetworkTrace'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); @@ -57389,7 +58601,7 @@ function _syncRepository(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -57423,14 +58635,14 @@ function _syncRepository(resourceGroupName, name, options, callback) { } /** - * @summary Syncs function trigger metadata to the scale controller + * @summary Sync web app repository. * - * Syncs function trigger metadata to the scale controller + * Sync web app repository. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Name of web app. * * @param {object} [options] Optional Parameters. * @@ -57449,7 +58661,7 @@ function _syncRepository(resourceGroupName, name, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _syncFunctionTriggers(resourceGroupName, name, options, callback) { +function _syncRepository(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -57496,7 +58708,7 @@ function _syncFunctionTriggers(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/syncfunctiontriggers'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); @@ -57533,7 +58745,7 @@ function _syncFunctionTriggers(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -57567,14 +58779,14 @@ function _syncFunctionTriggers(resourceGroupName, name, options, callback) { } /** - * @summary List triggered web jobs for an app, or a deployment slot. + * @summary Syncs function trigger metadata to the scale controller * - * List triggered web jobs for an app, or a deployment slot. + * Syncs function trigger metadata to the scale controller * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -57587,15 +58799,13 @@ function _syncFunctionTriggers(resourceGroupName, name, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TriggeredWebJobCollection} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { +function _syncFunctionTriggers(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -57642,7 +58852,7 @@ function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/syncfunctiontriggers'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); @@ -57654,7 +58864,7 @@ function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -57679,7 +58889,7 @@ function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -57689,13 +58899,12 @@ function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -57708,41 +58917,21 @@ function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredWebJobCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Gets a triggered web job by its ID for an app, or a deployment - * slot. + * @summary List triggered web jobs for an app, or a deployment slot. * - * Gets a triggered web job by its ID for an app, or a deployment slot. + * List triggered web jobs for an app, or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Site name. * - * @param {string} webJobName Name of Web Job. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -57755,13 +58944,14 @@ function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TriggeredWebJob} for more information. + * See {@link TriggeredWebJobCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { +function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -57793,9 +58983,6 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { - throw new Error('webJobName cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -57811,10 +58998,9 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -57849,7 +59035,7 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -57859,12 +59045,13 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -57884,7 +59071,7 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredWebJob']().mapper(); + let resultMapper = new client.models['TriggeredWebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -57900,161 +59087,10 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb } /** - * @summary Delete a triggered web job by its ID for an app, or a deployment - * slot. - * - * Delete a triggered web job by its ID for an app, or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} webJobName Name of Web Job. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === null || name === undefined || typeof name.valueOf() !== 'string') { - throw new Error('name cannot be null or undefined and it must be of type string.'); - } - if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { - throw new Error('webJobName cannot be null or undefined and it must be of type string.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary List a triggered web job's history for an app, or a deployment + * @summary Gets a triggered web job by its ID for an app, or a deployment * slot. * - * List a triggered web job's history for an app, or a deployment slot. + * Gets a triggered web job by its ID for an app, or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -58075,14 +59111,13 @@ function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, ca * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TriggeredJobHistoryCollection} for more - * information. + * See {@link TriggeredWebJob} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, options, callback) { +function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -58132,7 +59167,7 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); @@ -58205,7 +59240,7 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredJobHistoryCollection']().mapper(); + let resultMapper = new client.models['TriggeredWebJob']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -58221,12 +59256,11 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option } /** - * @summary Gets a triggered web job's history by its ID for an app, , or a - * deployment slot. - * - * Gets a triggered web job's history by its ID for an app, , or a deployment + * @summary Delete a triggered web job by its ID for an app, or a deployment * slot. * + * Delete a triggered web job by its ID for an app, or a deployment slot. + * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * @@ -58234,8 +59268,6 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option * * @param {string} webJobName Name of Web Job. * - * @param {string} id History ID. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -58247,14 +59279,13 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TriggeredJobHistory} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, options, callback) { +function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -58289,9 +59320,6 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { throw new Error('webJobName cannot be null or undefined and it must be of type string.'); } - if (id === null || id === undefined || typeof id.valueOf() !== 'string') { - throw new Error('id cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -58307,11 +59335,10 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history/{id}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); - requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -58321,7 +59348,7 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -58346,7 +59373,7 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -58374,32 +59401,16 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredJobHistory']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Run a triggered web job for an app, or a deployment slot. + * @summary List a triggered web job's history for an app, or a deployment + * slot. * - * Run a triggered web job for an app, or a deployment slot. + * List a triggered web job's history for an app, or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -58419,13 +59430,15 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link TriggeredJobHistoryCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { +function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -58475,7 +59488,7 @@ function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/run'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); @@ -58488,7 +59501,7 @@ function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callb // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -58541,30 +59554,45 @@ function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callb // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['TriggeredJobHistoryCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * @summary Gets the quota usage information of an app (or deployment slot, if - * specified). + * @summary Gets a triggered web job's history by its ID for an app, , or a + * deployment slot. * - * Gets the quota usage information of an app (or deployment slot, if - * specified). + * Gets a triggered web job's history by its ID for an app, , or a deployment + * slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Site name. * - * @param {object} [options] Optional Parameters. + * @param {string} webJobName Name of Web Job. * - * @param {string} [options.filter] Return only information specified in the - * filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' - * or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and - * endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. + * @param {string} id History ID. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -58576,14 +59604,13 @@ function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callb * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CsmUsageQuotaCollection} for more - * information. + * See {@link TriggeredJobHistory} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listUsages(resourceGroupName, name, options, callback) { +function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -58593,7 +59620,6 @@ function _listUsages(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58616,8 +59642,11 @@ function _listUsages(resourceGroupName, name, options, callback) { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter must be of type string.'); + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (id === null || id === undefined || typeof id.valueOf() !== 'string') { + throw new Error('id cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); @@ -58634,14 +59663,13 @@ function _listUsages(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history/{id}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + filter); - } queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -58674,7 +59702,7 @@ function _listUsages(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -58684,13 +59712,12 @@ function _listUsages(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -58710,7 +59737,7 @@ function _listUsages(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['CsmUsageQuotaCollection']().mapper(); + let resultMapper = new client.models['TriggeredJobHistory']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -58726,15 +59753,16 @@ function _listUsages(resourceGroupName, name, options, callback) { } /** - * @summary Gets the virtual networks the app (or deployment slot) is connected - * to. + * @summary Run a triggered web job for an app, or a deployment slot. * - * Gets the virtual networks the app (or deployment slot) is connected to. + * Run a triggered web job for an app, or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -58747,13 +59775,13 @@ function _listUsages(resourceGroupName, name, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listVnetConnections(resourceGroupName, name, options, callback) { +function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -58785,6 +59813,9 @@ function _listVnetConnections(resourceGroupName, name, options, callback) { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -58800,9 +59831,10 @@ function _listVnetConnections(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/run'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -58812,7 +59844,7 @@ function _listVnetConnections(resourceGroupName, name, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -58837,7 +59869,7 @@ function _listVnetConnections(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -58847,13 +59879,12 @@ function _listVnetConnections(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -58866,57 +59897,31 @@ function _listVnetConnections(resourceGroupName, name, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VnetInfoElementType', - type: { - name: 'Composite', - className: 'VnetInfo' - } - } - } - }; - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Gets a virtual network the app (or deployment slot) is connected to - * by name. + * @summary Gets the quota usage information of an app (or deployment slot, if + * specified). * - * Gets a virtual network the app (or deployment slot) is connected to by name. + * Gets the quota usage information of an app (or deployment slot, if + * specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} vnetName Name of the virtual network. - * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] Return only information specified in the + * filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' + * or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and + * endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -58927,13 +59932,14 @@ function _listVnetConnections(resourceGroupName, name, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link VnetInfo} for more information. + * See {@link CsmUsageQuotaCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getVnetConnection(resourceGroupName, name, vnetName, options, callback) { +function _listUsages(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -58943,6 +59949,7 @@ function _getVnetConnection(resourceGroupName, name, vnetName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } + let filter = (options && options.filter !== undefined) ? options.filter : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58965,8 +59972,8 @@ function _getVnetConnection(resourceGroupName, name, vnetName, options, callback if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { - throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); @@ -58983,12 +59990,14 @@ function _getVnetConnection(resourceGroupName, name, vnetName, options, callback // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -59057,7 +60066,7 @@ function _getVnetConnection(resourceGroupName, name, vnetName, options, callback parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VnetInfo']().mapper(); + let resultMapper = new client.models['CsmUsageQuotaCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -59073,34 +60082,16 @@ function _getVnetConnection(resourceGroupName, name, vnetName, options, callback } /** - * @summary Adds a Virtual Network connection to an app or slot (PUT) or - * updates the connection properties (PATCH). + * @summary Gets the virtual networks the app (or deployment slot) is connected + * to. * - * Adds a Virtual Network connection to an app or slot (PUT) or updates the - * connection properties (PATCH). + * Gets the virtual networks the app (or deployment slot) is connected to. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} vnetName Name of an existing Virtual Network. - * - * @param {object} connectionEnvelope Properties of the Virtual Network - * connection. See example. - * - * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's - * resource ID. - * - * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob - * containing the public key of the private key used to authenticate a - * Point-To-Site VPN connection. - * - * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by - * this Virtual Network. This should be a comma-separated list of IP addresses. - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -59112,14 +60103,13 @@ function _getVnetConnection(resourceGroupName, name, vnetName, options, callback * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link VnetInfo} for more information. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, callback) { +function _listVnetConnections(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -59151,12 +60141,6 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { - throw new Error('vnetName cannot be null or undefined and it must be of type string.'); - } - if (connectionEnvelope === null || connectionEnvelope === undefined) { - throw new Error('connectionEnvelope cannot be null or undefined.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -59172,10 +60156,9 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -59185,7 +60168,7 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -59203,21 +60186,7 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (connectionEnvelope !== null && connectionEnvelope !== undefined) { - let requestModelMapper = new client.models['VnetInfo']().mapper(); - requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(connectionEnvelope, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -59260,7 +60229,21 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VnetInfo']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VnetInfoElementType', + type: { + name: 'Composite', + className: 'VnetInfo' + } + } + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -59276,11 +60259,10 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec } /** - * @summary Deletes a connection from an app (or deployment slot to a named - * virtual network. + * @summary Gets a virtual network the app (or deployment slot) is connected to + * by name. * - * Deletes a connection from an app (or deployment slot to a named virtual - * network. + * Gets a virtual network the app (or deployment slot) is connected to by name. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -59300,13 +60282,14 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link VnetInfo} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callback) { +function _getVnetConnection(resourceGroupName, name, vnetName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -59369,7 +60352,7 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callb // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -59394,7 +60377,7 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callb return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -59404,12 +60387,13 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -59422,6 +60406,23 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callb // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VnetInfo']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); @@ -59474,7 +60475,7 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callb * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, callback) { +function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -59540,7 +60541,7 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -59631,19 +60632,18 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve } /** - * @summary Gets an app's Virtual Network gateway. + * @summary Deletes a connection from an app (or deployment slot to a named + * virtual network. * - * Gets an app's Virtual Network gateway. + * Deletes a connection from an app (or deployment slot to a named virtual + * network. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} vnetName Name of the Virtual Network. - * - * @param {string} gatewayName Name of the gateway. Currently, the only - * supported string is "primary". + * @param {string} vnetName Name of the virtual network. * * @param {object} [options] Optional Parameters. * @@ -59656,14 +60656,13 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link VnetGateway} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, options, callback) { +function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -59698,9 +60697,6 @@ function _getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayNam if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { throw new Error('vnetName cannot be null or undefined and it must be of type string.'); } - if (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { - throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -59716,11 +60712,10 @@ function _getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayNam // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); - requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -59730,7 +60725,7 @@ function _getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayNam // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -59783,51 +60778,37 @@ function _getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayNam // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VnetGateway']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it - * (PATCH). + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). * - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} vnetName Name of the Virtual Network. + * @param {string} vnetName Name of an existing Virtual Network. * - * @param {string} gatewayName Name of the gateway. Currently, the only - * supported string is "primary". + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. * - * @param {object} connectionEnvelope The properties to update this gateway - * with. + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. * - * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. * - * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN - * package can be downloaded. + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. * * @param {string} [connectionEnvelope.kind] Kind of resource. * @@ -59843,13 +60824,13 @@ function _getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayNam * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link VnetGateway} for more information. + * See {@link VnetInfo} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, callback) { +function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -59884,9 +60865,6 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { throw new Error('vnetName cannot be null or undefined and it must be of type string.'); } - if (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { - throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); - } if (connectionEnvelope === null || connectionEnvelope === undefined) { throw new Error('connectionEnvelope cannot be null or undefined.'); } @@ -59905,11 +60883,10 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); - requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -59919,7 +60896,7 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -59942,7 +60919,7 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, let requestModel = null; try { if (connectionEnvelope !== null && connectionEnvelope !== undefined) { - let requestModelMapper = new client.models['VnetGateway']().mapper(); + let requestModelMapper = new client.models['VnetInfo']().mapper(); requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); requestContent = JSON.stringify(requestModel); } @@ -59994,7 +60971,7 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VnetGateway']().mapper(); + let resultMapper = new client.models['VnetInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -60010,10 +60987,9 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, } /** - * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it - * (PATCH). + * @summary Gets an app's Virtual Network gateway. * - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * Gets an app's Virtual Network gateway. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -60025,16 +61001,6 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, * @param {string} gatewayName Name of the gateway. Currently, the only * supported string is "primary". * - * @param {object} connectionEnvelope The properties to update this gateway - * with. - * - * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. - * - * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN - * package can be downloaded. - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -60053,7 +61019,7 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, callback) { +function _getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -60091,9 +61057,6 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway if (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); } - if (connectionEnvelope === null || connectionEnvelope === undefined) { - throw new Error('connectionEnvelope cannot be null or undefined.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -60123,7 +61086,7 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -60141,28 +61104,14 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (connectionEnvelope !== null && connectionEnvelope !== undefined) { - let requestModelMapper = new client.models['VnetGateway']().mapper(); - requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(connectionEnvelope, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -60172,13 +61121,12 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -60214,14 +61162,30 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway } /** - * @summary List webjobs for an app, or a deployment slot. + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). * - * List webjobs for an app, or a deployment slot. + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -60235,13 +61199,13 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link WebJobCollection} for more information. + * See {@link VnetGateway} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listWebJobs(resourceGroupName, name, options, callback) { +function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -60273,6 +61237,15 @@ function _listWebJobs(resourceGroupName, name, options, callback) { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { + throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -60288,9 +61261,11 @@ function _listWebJobs(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -60300,7 +61275,7 @@ function _listWebJobs(resourceGroupName, name, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -60318,7 +61293,21 @@ function _listWebJobs(resourceGroupName, name, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['VnetGateway']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -60361,7 +61350,7 @@ function _listWebJobs(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebJobCollection']().mapper(); + let resultMapper = new client.models['VnetGateway']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -60377,16 +61366,30 @@ function _listWebJobs(resourceGroupName, name, options, callback) { } /** - * @summary Get webjob information for an app, or a deployment slot. + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). * - * Get webjob information for an app, or a deployment slot. + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of the web job. + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -60400,13 +61403,366 @@ function _listWebJobs(resourceGroupName, name, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link WebJob} for more information. + * See {@link VnetGateway} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getWebJob(resourceGroupName, name, webJobName, options, callback) { +function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { + throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['VnetGateway']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['VnetGateway']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WebJobCollection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listWebJobs(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebJobCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get webjob information for an app, or a deployment slot. + * + * Get webjob information for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of the web job. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WebJob} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -62530,7 +63886,7 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, o * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -62708,7 +64064,21 @@ function _beginStartWebSiteNetworkTraceOperation(resourceGroupName, name, option parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Operation']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -65119,7 +66489,7 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -65301,7 +66671,21 @@ function _beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName, name, sl parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Operation']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -66527,6 +67911,248 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour }); } +/** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginStartNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let durationInSeconds = (options && options.durationInSeconds !== undefined) ? options.durationInSeconds : undefined; + let maxFrameLength = (options && options.maxFrameLength !== undefined) ? options.maxFrameLength : undefined; + let sasUrl = (options && options.sasUrl !== undefined) ? options.sasUrl : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (durationInSeconds !== null && durationInSeconds !== undefined && typeof durationInSeconds !== 'number') { + throw new Error('durationInSeconds must be of type number.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (maxFrameLength !== null && maxFrameLength !== undefined && typeof maxFrameLength !== 'number') { + throw new Error('maxFrameLength must be of type number.'); + } + if (sasUrl !== null && sasUrl !== undefined && typeof sasUrl.valueOf() !== 'string') { + throw new Error('sasUrl must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (durationInSeconds !== null && durationInSeconds !== undefined) { + queryParameters.push('durationInSeconds=' + encodeURIComponent(durationInSeconds.toString())); + } + if (maxFrameLength !== null && maxFrameLength !== undefined) { + queryParameters.push('maxFrameLength=' + encodeURIComponent(maxFrameLength.toString())); + } + if (sasUrl !== null && sasUrl !== undefined) { + queryParameters.push('sasUrl=' + encodeURIComponent(sasUrl)); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + /** * @summary Swaps two deployment slots of an app. * @@ -66934,15 +68560,25 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo } /** - * @summary Get all apps for a subscription. + * @summary Start capturing network packets for the site. * - * Get all apps for a subscription. + * Start capturing network packets for the site. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. * * @param {object} [options] Optional Parameters. * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -66952,14 +68588,13 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link WebAppCollection} for more information. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listNext(nextPageLink, options, callback) { +function _beginStartNetworkTrace(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -66969,10 +68604,45 @@ function _listNext(nextPageLink, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let durationInSeconds = (options && options.durationInSeconds !== undefined) ? options.durationInSeconds : undefined; + let maxFrameLength = (options && options.maxFrameLength !== undefined) ? options.maxFrameLength : undefined; + let sasUrl = (options && options.sasUrl !== undefined) ? options.sasUrl : undefined; // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (durationInSeconds !== null && durationInSeconds !== undefined && typeof durationInSeconds !== 'number') { + throw new Error('durationInSeconds must be of type number.'); + } + if (maxFrameLength !== null && maxFrameLength !== undefined && typeof maxFrameLength !== 'number') { + throw new Error('maxFrameLength must be of type number.'); + } + if (sasUrl !== null && sasUrl !== undefined && typeof sasUrl.valueOf() !== 'string') { + throw new Error('sasUrl must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -66982,12 +68652,29 @@ function _listNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (durationInSeconds !== null && durationInSeconds !== undefined) { + queryParameters.push('durationInSeconds=' + encodeURIComponent(durationInSeconds.toString())); + } + if (maxFrameLength !== null && maxFrameLength !== undefined) { + queryParameters.push('maxFrameLength=' + encodeURIComponent(maxFrameLength.toString())); + } + if (sasUrl !== null && sasUrl !== undefined) { + queryParameters.push('sasUrl=' + encodeURIComponent(sasUrl)); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -67012,7 +68699,7 @@ function _listNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -67048,7 +68735,21 @@ function _listNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebAppCollection']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -67058,15 +68759,46 @@ function _listNext(nextPageLink, options, callback) { return callback(deserializationError); } } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } return callback(null, result, httpRequest, response); }); } /** - * @summary Gets all web, mobile, and API apps in the specified resource group. + * @summary Get all apps for a subscription. * - * Gets all web, mobile, and API apps in the specified resource group. + * Get all apps for a subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -67089,7 +68821,7 @@ function _listNext(nextPageLink, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByResourceGroupNext(nextPageLink, options, callback) { +function _listNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -67194,9 +68926,9 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { } /** - * @summary Gets existing backups of an app. + * @summary Gets all web, mobile, and API apps in the specified resource group. * - * Gets existing backups of an app. + * Gets all web, mobile, and API apps in the specified resource group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -67213,13 +68945,13 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link BackupItemCollection} for more information. + * See {@link WebAppCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listBackupsNext(nextPageLink, options, callback) { +function _listByResourceGroupNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -67308,7 +69040,7 @@ function _listBackupsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupItemCollection']().mapper(); + let resultMapper = new client.models['WebAppCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -67324,9 +69056,9 @@ function _listBackupsNext(nextPageLink, options, callback) { } /** - * @summary List the configurations of an app + * @summary Gets existing backups of an app. * - * List the configurations of an app + * Gets existing backups of an app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -67343,14 +69075,13 @@ function _listBackupsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteConfigResourceCollection} for more - * information. + * See {@link BackupItemCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listConfigurationsNext(nextPageLink, options, callback) { +function _listBackupsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -67439,7 +69170,7 @@ function _listConfigurationsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigResourceCollection']().mapper(); + let resultMapper = new client.models['BackupItemCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -67455,11 +69186,9 @@ function _listConfigurationsNext(nextPageLink, options, callback) { } /** - * @summary Gets a list of web app configuration snapshots identifiers. Each - * element of the list contains a timestamp and the ID of the snapshot. + * @summary List the configurations of an app * - * Gets a list of web app configuration snapshots identifiers. Each element of - * the list contains a timestamp and the ID of the snapshot. + * List the configurations of an app * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -67476,14 +69205,14 @@ function _listConfigurationsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteConfigurationSnapshotInfoCollection} for - * more information. + * See {@link SiteConfigResourceCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listConfigurationSnapshotInfoNext(nextPageLink, options, callback) { +function _listConfigurationsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -67572,7 +69301,7 @@ function _listConfigurationSnapshotInfoNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); + let resultMapper = new client.models['SiteConfigResourceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -67588,9 +69317,11 @@ function _listConfigurationSnapshotInfoNext(nextPageLink, options, callback) { } /** - * @summary List continuous web jobs for an app, or a deployment slot. + * @summary Gets a list of web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. * - * List continuous web jobs for an app, or a deployment slot. + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -67607,14 +69338,14 @@ function _listConfigurationSnapshotInfoNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ContinuousWebJobCollection} for more - * information. + * See {@link SiteConfigurationSnapshotInfoCollection} for + * more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listContinuousWebJobsNext(nextPageLink, options, callback) { +function _listConfigurationSnapshotInfoNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -67703,7 +69434,7 @@ function _listContinuousWebJobsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ContinuousWebJobCollection']().mapper(); + let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -67719,9 +69450,9 @@ function _listContinuousWebJobsNext(nextPageLink, options, callback) { } /** - * @summary List deployments for an app, or a deployment slot. + * @summary List continuous web jobs for an app, or a deployment slot. * - * List deployments for an app, or a deployment slot. + * List continuous web jobs for an app, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -67738,13 +69469,14 @@ function _listContinuousWebJobsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeploymentCollection} for more information. + * See {@link ContinuousWebJobCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listDeploymentsNext(nextPageLink, options, callback) { +function _listContinuousWebJobsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -67833,7 +69565,7 @@ function _listDeploymentsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DeploymentCollection']().mapper(); + let resultMapper = new client.models['ContinuousWebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -67849,9 +69581,9 @@ function _listDeploymentsNext(nextPageLink, options, callback) { } /** - * @summary Lists ownership identifiers for domain associated with web app. + * @summary List deployments for an app, or a deployment slot. * - * Lists ownership identifiers for domain associated with web app. + * List deployments for an app, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -67868,13 +69600,13 @@ function _listDeploymentsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link IdentifierCollection} for more information. + * See {@link DeploymentCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listDomainOwnershipIdentifiersNext(nextPageLink, options, callback) { +function _listDeploymentsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -67963,7 +69695,7 @@ function _listDomainOwnershipIdentifiersNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['IdentifierCollection']().mapper(); + let resultMapper = new client.models['DeploymentCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -67979,9 +69711,9 @@ function _listDomainOwnershipIdentifiersNext(nextPageLink, options, callback) { } /** - * @summary List the functions for a web site, or a deployment slot. + * @summary Lists ownership identifiers for domain associated with web app. * - * List the functions for a web site, or a deployment slot. + * Lists ownership identifiers for domain associated with web app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -67998,14 +69730,13 @@ function _listDomainOwnershipIdentifiersNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link FunctionEnvelopeCollection} for more - * information. + * See {@link IdentifierCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listFunctionsNext(nextPageLink, options, callback) { +function _listDomainOwnershipIdentifiersNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -68058,7 +69789,7 @@ function _listFunctionsNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -68068,12 +69799,13 @@ function _listFunctionsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -68093,7 +69825,7 @@ function _listFunctionsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); + let resultMapper = new client.models['IdentifierCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -68109,9 +69841,9 @@ function _listFunctionsNext(nextPageLink, options, callback) { } /** - * @summary Get hostname bindings for an app or a deployment slot. + * @summary List the functions for a web site, or a deployment slot. * - * Get hostname bindings for an app or a deployment slot. + * List the functions for a web site, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -68128,14 +69860,14 @@ function _listFunctionsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link HostNameBindingCollection} for more + * See {@link FunctionEnvelopeCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listHostNameBindingsNext(nextPageLink, options, callback) { +function _listFunctionsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -68188,7 +69920,7 @@ function _listHostNameBindingsNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -68198,13 +69930,12 @@ function _listHostNameBindingsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -68224,7 +69955,7 @@ function _listHostNameBindingsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HostNameBindingCollection']().mapper(); + let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -68240,9 +69971,9 @@ function _listHostNameBindingsNext(nextPageLink, options, callback) { } /** - * @summary Gets all scale-out instances of an app. + * @summary Get hostname bindings for an app or a deployment slot. * - * Gets all scale-out instances of an app. + * Get hostname bindings for an app or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -68259,14 +69990,14 @@ function _listHostNameBindingsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link WebAppInstanceCollection} for more + * See {@link HostNameBindingCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listInstanceIdentifiersNext(nextPageLink, options, callback) { +function _listHostNameBindingsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -68355,7 +70086,7 @@ function _listInstanceIdentifiersNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebAppInstanceCollection']().mapper(); + let resultMapper = new client.models['HostNameBindingCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -68371,11 +70102,9 @@ function _listInstanceIdentifiersNext(nextPageLink, options, callback) { } /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. + * @summary Gets all scale-out instances of an app. * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. + * Gets all scale-out instances of an app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -68392,13 +70121,14 @@ function _listInstanceIdentifiersNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfoCollection} for more information. + * See {@link WebAppInstanceCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listInstanceProcessesNext(nextPageLink, options, callback) { +function _listInstanceIdentifiersNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -68451,7 +70181,7 @@ function _listInstanceProcessesNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -68461,12 +70191,13 @@ function _listInstanceProcessesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -68486,7 +70217,7 @@ function _listInstanceProcessesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = new client.models['WebAppInstanceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -68502,11 +70233,11 @@ function _listInstanceProcessesNext(nextPageLink, options, callback) { } /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -68523,14 +70254,13 @@ function _listInstanceProcessesNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfoCollection} for more - * information. + * See {@link ProcessInfoCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listInstanceProcessModulesNext(nextPageLink, options, callback) { +function _listInstanceProcessesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -68618,7 +70348,7 @@ function _listInstanceProcessModulesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -68634,11 +70364,11 @@ function _listInstanceProcessModulesNext(nextPageLink, options, callback) { } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -68655,14 +70385,14 @@ function _listInstanceProcessModulesNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfoCollection} for more + * See {@link ProcessModuleInfoCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listInstanceProcessThreadsNext(nextPageLink, options, callback) { +function _listInstanceProcessModulesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -68750,7 +70480,7 @@ function _listInstanceProcessThreadsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -68766,10 +70496,11 @@ function _listInstanceProcessThreadsNext(nextPageLink, options, callback) { } /** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. * - * Gets all metric definitions of an app (or deployment slot, if specified). + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -68786,14 +70517,14 @@ function _listInstanceProcessThreadsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceMetricDefinitionCollection} for more + * See {@link ProcessThreadInfoCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listMetricDefinitionsNext(nextPageLink, options, callback) { +function _listInstanceProcessThreadsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -68846,7 +70577,7 @@ function _listMetricDefinitionsNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -68856,13 +70587,12 @@ function _listMetricDefinitionsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -68882,7 +70612,7 @@ function _listMetricDefinitionsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -68898,10 +70628,10 @@ function _listMetricDefinitionsNext(nextPageLink, options, callback) { } /** - * @summary Gets performance metrics of an app (or deployment slot, if + * @summary Gets all metric definitions of an app (or deployment slot, if * specified). * - * Gets performance metrics of an app (or deployment slot, if specified). + * Gets all metric definitions of an app (or deployment slot, if specified). * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -68918,14 +70648,14 @@ function _listMetricDefinitionsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceMetricCollection} for more + * See {@link ResourceMetricDefinitionCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listMetricsNext(nextPageLink, options, callback) { +function _listMetricDefinitionsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -69014,7 +70744,7 @@ function _listMetricsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -69030,9 +70760,10 @@ function _listMetricsNext(nextPageLink, options, callback) { } /** - * @summary Gets perfmon counters for web app. + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). * - * Gets perfmon counters for web app. + * Gets performance metrics of an app (or deployment slot, if specified). * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -69049,14 +70780,14 @@ function _listMetricsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PerfMonCounterCollection} for more + * See {@link ResourceMetricCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listPerfMonCountersNext(nextPageLink, options, callback) { +function _listMetricsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -69145,138 +70876,7 @@ function _listPerfMonCountersNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. - * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. - * - * @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 {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfoCollection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _listProcessesNext(nextPageLink, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -69292,11 +70892,9 @@ function _listProcessesNext(nextPageLink, options, callback) { } /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Gets perfmon counters for web app. * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. + * Gets perfmon counters for web app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -69313,14 +70911,14 @@ function _listProcessesNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfoCollection} for more + * See {@link PerfMonCounterCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listProcessModulesNext(nextPageLink, options, callback) { +function _listPerfMonCountersNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -69373,7 +70971,7 @@ function _listProcessModulesNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -69383,12 +70981,13 @@ function _listProcessModulesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -69408,7 +71007,7 @@ function _listProcessModulesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -69424,11 +71023,11 @@ function _listProcessModulesNext(nextPageLink, options, callback) { } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -69445,14 +71044,13 @@ function _listProcessModulesNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfoCollection} for more - * information. + * See {@link ProcessInfoCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listProcessThreadsNext(nextPageLink, options, callback) { +function _listProcessesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -69540,7 +71138,7 @@ function _listProcessThreadsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -69556,9 +71154,11 @@ function _listProcessThreadsNext(nextPageLink, options, callback) { } /** - * @summary Get public certificates for an app or a deployment slot. + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * Get public certificates for an app or a deployment slot. + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -69575,14 +71175,14 @@ function _listProcessThreadsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PublicCertificateCollection} for more + * See {@link ProcessModuleInfoCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listPublicCertificatesNext(nextPageLink, options, callback) { +function _listProcessModulesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -69635,7 +71235,7 @@ function _listPublicCertificatesNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -69645,13 +71245,12 @@ function _listPublicCertificatesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -69671,7 +71270,7 @@ function _listPublicCertificatesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicCertificateCollection']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -69687,9 +71286,11 @@ function _listPublicCertificatesNext(nextPageLink, options, callback) { } /** - * @summary Get list of siteextensions for a web site, or a deployment slot. + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. * - * Get list of siteextensions for a web site, or a deployment slot. + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -69706,14 +71307,14 @@ function _listPublicCertificatesNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteExtensionInfoCollection} for more + * See {@link ProcessThreadInfoCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listSiteExtensionsNext(nextPageLink, options, callback) { +function _listProcessThreadsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -69801,7 +71402,7 @@ function _listSiteExtensionsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteExtensionInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -69817,9 +71418,9 @@ function _listSiteExtensionsNext(nextPageLink, options, callback) { } /** - * @summary Gets an app's deployment slots. + * @summary Get public certificates for an app or a deployment slot. * - * Gets an app's deployment slots. + * Get public certificates for an app or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -69836,13 +71437,14 @@ function _listSiteExtensionsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link WebAppCollection} for more information. + * See {@link PublicCertificateCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listSlotsNext(nextPageLink, options, callback) { +function _listPublicCertificatesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -69931,7 +71533,7 @@ function _listSlotsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebAppCollection']().mapper(); + let resultMapper = new client.models['PublicCertificateCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -69947,9 +71549,9 @@ function _listSlotsNext(nextPageLink, options, callback) { } /** - * @summary Gets existing backups of an app. + * @summary Get list of siteextensions for a web site, or a deployment slot. * - * Gets existing backups of an app. + * Get list of siteextensions for a web site, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -69966,13 +71568,143 @@ function _listSlotsNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link BackupItemCollection} for more information. + * See {@link SiteExtensionInfoCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listBackupsSlotNext(nextPageLink, options, callback) { +function _listSiteExtensionsNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteExtensionInfoCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets an app's deployment slots. + * + * Gets an app's deployment slots. + * + * @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 {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listSlotsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -70061,7 +71793,7 @@ function _listBackupsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupItemCollection']().mapper(); + let resultMapper = new client.models['WebAppCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -70077,9 +71809,9 @@ function _listBackupsSlotNext(nextPageLink, options, callback) { } /** - * @summary List the configurations of an app + * @summary Gets existing backups of an app. * - * List the configurations of an app + * Gets existing backups of an app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -70096,14 +71828,13 @@ function _listBackupsSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteConfigResourceCollection} for more - * information. + * See {@link BackupItemCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listConfigurationsSlotNext(nextPageLink, options, callback) { +function _listBackupsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -70192,7 +71923,7 @@ function _listConfigurationsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigResourceCollection']().mapper(); + let resultMapper = new client.models['BackupItemCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -70208,11 +71939,9 @@ function _listConfigurationsSlotNext(nextPageLink, options, callback) { } /** - * @summary Gets a list of web app configuration snapshots identifiers. Each - * element of the list contains a timestamp and the ID of the snapshot. + * @summary List the configurations of an app * - * Gets a list of web app configuration snapshots identifiers. Each element of - * the list contains a timestamp and the ID of the snapshot. + * List the configurations of an app * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -70229,14 +71958,14 @@ function _listConfigurationsSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteConfigurationSnapshotInfoCollection} for - * more information. + * See {@link SiteConfigResourceCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listConfigurationSnapshotInfoSlotNext(nextPageLink, options, callback) { +function _listConfigurationsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -70325,7 +72054,7 @@ function _listConfigurationSnapshotInfoSlotNext(nextPageLink, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); + let resultMapper = new client.models['SiteConfigResourceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -70341,9 +72070,11 @@ function _listConfigurationSnapshotInfoSlotNext(nextPageLink, options, callback) } /** - * @summary List continuous web jobs for an app, or a deployment slot. + * @summary Gets a list of web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. * - * List continuous web jobs for an app, or a deployment slot. + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -70360,14 +72091,14 @@ function _listConfigurationSnapshotInfoSlotNext(nextPageLink, options, callback) * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ContinuousWebJobCollection} for more - * information. + * See {@link SiteConfigurationSnapshotInfoCollection} for + * more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listContinuousWebJobsSlotNext(nextPageLink, options, callback) { +function _listConfigurationSnapshotInfoSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -70456,7 +72187,7 @@ function _listContinuousWebJobsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ContinuousWebJobCollection']().mapper(); + let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -70472,9 +72203,9 @@ function _listContinuousWebJobsSlotNext(nextPageLink, options, callback) { } /** - * @summary List deployments for an app, or a deployment slot. + * @summary List continuous web jobs for an app, or a deployment slot. * - * List deployments for an app, or a deployment slot. + * List continuous web jobs for an app, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -70491,13 +72222,14 @@ function _listContinuousWebJobsSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DeploymentCollection} for more information. + * See {@link ContinuousWebJobCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listDeploymentsSlotNext(nextPageLink, options, callback) { +function _listContinuousWebJobsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -70586,7 +72318,7 @@ function _listDeploymentsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DeploymentCollection']().mapper(); + let resultMapper = new client.models['ContinuousWebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -70602,9 +72334,9 @@ function _listDeploymentsSlotNext(nextPageLink, options, callback) { } /** - * @summary Lists ownership identifiers for domain associated with web app. + * @summary List deployments for an app, or a deployment slot. * - * Lists ownership identifiers for domain associated with web app. + * List deployments for an app, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -70621,13 +72353,13 @@ function _listDeploymentsSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link IdentifierCollection} for more information. + * See {@link DeploymentCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listDomainOwnershipIdentifiersSlotNext(nextPageLink, options, callback) { +function _listDeploymentsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -70716,7 +72448,7 @@ function _listDomainOwnershipIdentifiersSlotNext(nextPageLink, options, callback parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['IdentifierCollection']().mapper(); + let resultMapper = new client.models['DeploymentCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -70732,9 +72464,9 @@ function _listDomainOwnershipIdentifiersSlotNext(nextPageLink, options, callback } /** - * @summary List the functions for a web site, or a deployment slot. + * @summary Lists ownership identifiers for domain associated with web app. * - * List the functions for a web site, or a deployment slot. + * Lists ownership identifiers for domain associated with web app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -70751,14 +72483,13 @@ function _listDomainOwnershipIdentifiersSlotNext(nextPageLink, options, callback * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link FunctionEnvelopeCollection} for more - * information. + * See {@link IdentifierCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listInstanceFunctionsSlotNext(nextPageLink, options, callback) { +function _listDomainOwnershipIdentifiersSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -70811,7 +72542,7 @@ function _listInstanceFunctionsSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -70821,12 +72552,13 @@ function _listInstanceFunctionsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -70846,7 +72578,7 @@ function _listInstanceFunctionsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); + let resultMapper = new client.models['IdentifierCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -70862,9 +72594,9 @@ function _listInstanceFunctionsSlotNext(nextPageLink, options, callback) { } /** - * @summary Get hostname bindings for an app or a deployment slot. + * @summary List the functions for a web site, or a deployment slot. * - * Get hostname bindings for an app or a deployment slot. + * List the functions for a web site, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -70881,14 +72613,14 @@ function _listInstanceFunctionsSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link HostNameBindingCollection} for more + * See {@link FunctionEnvelopeCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listHostNameBindingsSlotNext(nextPageLink, options, callback) { +function _listInstanceFunctionsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -70941,7 +72673,7 @@ function _listHostNameBindingsSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -70951,13 +72683,12 @@ function _listHostNameBindingsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -70977,7 +72708,7 @@ function _listHostNameBindingsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HostNameBindingCollection']().mapper(); + let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -70993,9 +72724,9 @@ function _listHostNameBindingsSlotNext(nextPageLink, options, callback) { } /** - * @summary Gets all scale-out instances of an app. + * @summary Get hostname bindings for an app or a deployment slot. * - * Gets all scale-out instances of an app. + * Get hostname bindings for an app or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -71012,14 +72743,14 @@ function _listHostNameBindingsSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link WebAppInstanceCollection} for more + * See {@link HostNameBindingCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listInstanceIdentifiersSlotNext(nextPageLink, options, callback) { +function _listHostNameBindingsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -71108,7 +72839,7 @@ function _listInstanceIdentifiersSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebAppInstanceCollection']().mapper(); + let resultMapper = new client.models['HostNameBindingCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -71124,11 +72855,9 @@ function _listInstanceIdentifiersSlotNext(nextPageLink, options, callback) { } /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. + * @summary Gets all scale-out instances of an app. * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. + * Gets all scale-out instances of an app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -71145,13 +72874,14 @@ function _listInstanceIdentifiersSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfoCollection} for more information. + * See {@link WebAppInstanceCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listInstanceProcessesSlotNext(nextPageLink, options, callback) { +function _listInstanceIdentifiersSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -71204,7 +72934,7 @@ function _listInstanceProcessesSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -71214,12 +72944,13 @@ function _listInstanceProcessesSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -71239,7 +72970,7 @@ function _listInstanceProcessesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = new client.models['WebAppInstanceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -71255,11 +72986,11 @@ function _listInstanceProcessesSlotNext(nextPageLink, options, callback) { } /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -71276,14 +73007,13 @@ function _listInstanceProcessesSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfoCollection} for more - * information. + * See {@link ProcessInfoCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listInstanceProcessModulesSlotNext(nextPageLink, options, callback) { +function _listInstanceProcessesSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -71371,7 +73101,7 @@ function _listInstanceProcessModulesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -71387,11 +73117,11 @@ function _listInstanceProcessModulesSlotNext(nextPageLink, options, callback) { } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -71408,14 +73138,14 @@ function _listInstanceProcessModulesSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfoCollection} for more + * See {@link ProcessModuleInfoCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listInstanceProcessThreadsSlotNext(nextPageLink, options, callback) { +function _listInstanceProcessModulesSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -71503,7 +73233,7 @@ function _listInstanceProcessThreadsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -71519,10 +73249,11 @@ function _listInstanceProcessThreadsSlotNext(nextPageLink, options, callback) { } /** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. * - * Gets all metric definitions of an app (or deployment slot, if specified). + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -71539,14 +73270,14 @@ function _listInstanceProcessThreadsSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceMetricDefinitionCollection} for more + * See {@link ProcessThreadInfoCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listMetricDefinitionsSlotNext(nextPageLink, options, callback) { +function _listInstanceProcessThreadsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -71599,7 +73330,7 @@ function _listMetricDefinitionsSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -71609,13 +73340,12 @@ function _listMetricDefinitionsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -71635,7 +73365,7 @@ function _listMetricDefinitionsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -71651,10 +73381,10 @@ function _listMetricDefinitionsSlotNext(nextPageLink, options, callback) { } /** - * @summary Gets performance metrics of an app (or deployment slot, if + * @summary Gets all metric definitions of an app (or deployment slot, if * specified). * - * Gets performance metrics of an app (or deployment slot, if specified). + * Gets all metric definitions of an app (or deployment slot, if specified). * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -71671,14 +73401,14 @@ function _listMetricDefinitionsSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceMetricCollection} for more + * See {@link ResourceMetricDefinitionCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listMetricsSlotNext(nextPageLink, options, callback) { +function _listMetricDefinitionsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -71767,7 +73497,7 @@ function _listMetricsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -71783,9 +73513,10 @@ function _listMetricsSlotNext(nextPageLink, options, callback) { } /** - * @summary Gets perfmon counters for web app. + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). * - * Gets perfmon counters for web app. + * Gets performance metrics of an app (or deployment slot, if specified). * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -71802,14 +73533,14 @@ function _listMetricsSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PerfMonCounterCollection} for more + * See {@link ResourceMetricCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listPerfMonCountersSlotNext(nextPageLink, options, callback) { +function _listMetricsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -71898,138 +73629,7 @@ function _listPerfMonCountersSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. - * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. - * - * @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 {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfoCollection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _listProcessesSlotNext(nextPageLink, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -72045,11 +73645,9 @@ function _listProcessesSlotNext(nextPageLink, options, callback) { } /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Gets perfmon counters for web app. * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. + * Gets perfmon counters for web app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -72066,14 +73664,278 @@ function _listProcessesSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfoCollection} for more + * See {@link PerfMonCounterCollection} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listProcessModulesSlotNext(nextPageLink, options, callback) { +function _listPerfMonCountersSlotNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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 {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfoCollection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listProcessesSlotNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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 {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfoCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listProcessModulesSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -74523,6 +76385,8 @@ class WebApps { this._startWebSiteNetworkTraceOperation = _startWebSiteNetworkTraceOperation; this._stopWebSiteNetworkTrace = _stopWebSiteNetworkTrace; this._getNetworkTraces = _getNetworkTraces; + this._getNetworkTraceOperationV2 = _getNetworkTraceOperationV2; + this._getNetworkTracesV2 = _getNetworkTracesV2; this._generateNewSitePublishingPassword = _generateNewSitePublishingPassword; this._listPerfMonCounters = _listPerfMonCounters; this._getSitePhpErrorLogFlag = _getSitePhpErrorLogFlag; @@ -74662,6 +76526,8 @@ class WebApps { this._startWebSiteNetworkTraceOperationSlot = _startWebSiteNetworkTraceOperationSlot; this._stopWebSiteNetworkTraceSlot = _stopWebSiteNetworkTraceSlot; this._getNetworkTracesSlot = _getNetworkTracesSlot; + this._getNetworkTraceOperationSlotV2 = _getNetworkTraceOperationSlotV2; + this._getNetworkTracesSlotV2 = _getNetworkTracesSlotV2; this._generateNewSitePublishingPasswordSlot = _generateNewSitePublishingPasswordSlot; this._listPerfMonCountersSlot = _listPerfMonCountersSlot; this._getSitePhpErrorLogFlagSlot = _getSitePhpErrorLogFlagSlot; @@ -74703,7 +76569,9 @@ class WebApps { this._deleteSourceControlSlot = _deleteSourceControlSlot; this._updateSourceControlSlot = _updateSourceControlSlot; this._startSlot = _startSlot; + this._startNetworkTraceSlot = _startNetworkTraceSlot; this._stopSlot = _stopSlot; + this._stopNetworkTraceSlot = _stopNetworkTraceSlot; this._syncRepositorySlot = _syncRepositorySlot; this._syncFunctionTriggersSlot = _syncFunctionTriggersSlot; this._listTriggeredWebJobsSlot = _listTriggeredWebJobsSlot; @@ -74732,7 +76600,9 @@ class WebApps { this._deleteSourceControl = _deleteSourceControl; this._updateSourceControl = _updateSourceControl; this._start = _start; + this._startNetworkTrace = _startNetworkTrace; this._stop = _stop; + this._stopNetworkTrace = _stopNetworkTrace; this._syncRepository = _syncRepository; this._syncFunctionTriggers = _syncFunctionTriggers; this._listTriggeredWebJobs = _listTriggeredWebJobs; @@ -74778,8 +76648,10 @@ class WebApps { this._beginInstallSiteExtensionSlot = _beginInstallSiteExtensionSlot; this._beginSwapSlotSlot = _beginSwapSlotSlot; this._beginCreateOrUpdateSourceControlSlot = _beginCreateOrUpdateSourceControlSlot; + this._beginStartNetworkTraceSlot = _beginStartNetworkTraceSlot; this._beginSwapSlotWithProduction = _beginSwapSlotWithProduction; this._beginCreateOrUpdateSourceControl = _beginCreateOrUpdateSourceControl; + this._beginStartNetworkTrace = _beginStartNetworkTrace; this._listNext = _listNext; this._listByResourceGroupNext = _listByResourceGroupNext; this._listBackupsNext = _listBackupsNext; @@ -89065,7 +90937,7 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -89109,7 +90981,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -89117,7 +90989,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -89275,7 +91147,7 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -89323,7 +91195,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -89331,7 +91203,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -89548,10 +91420,10 @@ class WebApps { } /** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). * - * Generates a new publishing password for an app (or deployment slot, if + * Gets a named operation for a network trace capturing (or deployment slot, if * specified). * * @param {string} resourceGroupName Name of the resource group to which the @@ -89559,6 +91431,8 @@ class WebApps { * * @param {string} name Name of the app. * + * @param {string} operationId GUID of the operation. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -89566,15 +91440,15 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - generateNewSitePublishingPasswordWithHttpOperationResponse(resourceGroupName, name, options) { + getNetworkTraceOperationV2WithHttpOperationResponse(resourceGroupName, name, operationId, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._generateNewSitePublishingPassword(resourceGroupName, name, options, (err, result, request, response) => { + self._getNetworkTraceOperationV2(resourceGroupName, name, operationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -89585,10 +91459,10 @@ class WebApps { } /** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). * - * Generates a new publishing password for an app (or deployment slot, if + * Gets a named operation for a network trace capturing (or deployment slot, if * specified). * * @param {string} resourceGroupName Name of the resource group to which the @@ -89596,6 +91470,8 @@ class WebApps { * * @param {string} name Name of the app. * + * @param {string} operationId GUID of the operation. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -89608,7 +91484,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -89616,13 +91492,13 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - generateNewSitePublishingPassword(resourceGroupName, name, options, optionalCallback) { + getNetworkTraceOperationV2(resourceGroupName, name, operationId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -89631,48 +91507,47 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._generateNewSitePublishingPassword(resourceGroupName, name, options, (err, result, request, response) => { + self._getNetworkTraceOperationV2(resourceGroupName, name, operationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._generateNewSitePublishingPassword(resourceGroupName, name, options, optionalCallback); + return self._getNetworkTraceOperationV2(resourceGroupName, name, operationId, options, optionalCallback); } } /** - * @summary Gets perfmon counters for web app. + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). * - * Gets perfmon counters for web app. + * Gets a named operation for a network trace capturing (or deployment slot, if + * specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name Name of the app. * - * @param {object} [options] Optional Parameters. + * @param {string} operationId GUID of the operation. * - * @param {string} [options.filter] Return only usages/metrics specified in the - * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq - * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. + * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listPerfMonCountersWithHttpOperationResponse(resourceGroupName, name, options) { + getNetworkTracesV2WithHttpOperationResponse(resourceGroupName, name, operationId, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listPerfMonCounters(resourceGroupName, name, options, (err, result, request, response) => { + self._getNetworkTracesV2(resourceGroupName, name, operationId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -89683,21 +91558,20 @@ class WebApps { } /** - * @summary Gets perfmon counters for web app. + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). * - * Gets perfmon counters for web app. + * Gets a named operation for a network trace capturing (or deployment slot, if + * specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name Name of the app. * - * @param {object} [options] Optional Parameters. + * @param {string} operationId GUID of the operation. * - * @param {string} [options.filter] Return only usages/metrics specified in the - * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq - * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -89709,7 +91583,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {PerfMonCounterCollection} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -89717,15 +91591,13 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PerfMonCounterCollection} for more - * information. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listPerfMonCounters(resourceGroupName, name, options, optionalCallback) { + getNetworkTracesV2(resourceGroupName, name, operationId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -89734,26 +91606,28 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listPerfMonCounters(resourceGroupName, name, options, (err, result, request, response) => { + self._getNetworkTracesV2(resourceGroupName, name, operationId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listPerfMonCounters(resourceGroupName, name, options, optionalCallback); + return self._getNetworkTracesV2(resourceGroupName, name, operationId, options, optionalCallback); } } /** - * @summary Gets web app's event logs. + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). * - * Gets web app's event logs. + * Generates a new publishing password for an app (or deployment slot, if + * specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -89762,15 +91636,15 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getSitePhpErrorLogFlagWithHttpOperationResponse(resourceGroupName, name, options) { + generateNewSitePublishingPasswordWithHttpOperationResponse(resourceGroupName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getSitePhpErrorLogFlag(resourceGroupName, name, options, (err, result, request, response) => { + self._generateNewSitePublishingPassword(resourceGroupName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -89781,14 +91655,16 @@ class WebApps { } /** - * @summary Gets web app's event logs. + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). * - * Gets web app's event logs. + * Generates a new publishing password for an app (or deployment slot, if + * specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -89802,7 +91678,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {SitePhpErrorLogFlag} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -89810,14 +91686,13 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SitePhpErrorLogFlag} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getSitePhpErrorLogFlag(resourceGroupName, name, options, optionalCallback) { + generateNewSitePublishingPassword(resourceGroupName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -89826,43 +91701,48 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getSitePhpErrorLogFlag(resourceGroupName, name, options, (err, result, request, response) => { + self._generateNewSitePublishingPassword(resourceGroupName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getSitePhpErrorLogFlag(resourceGroupName, name, options, optionalCallback); + return self._generateNewSitePublishingPassword(resourceGroupName, name, options, optionalCallback); } } /** - * @summary Gets the premier add-ons of an app. + * @summary Gets perfmon counters for web app. * - * Gets the premier add-ons of an app. + * Gets perfmon counters for web app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Name of web app. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listPremierAddOnsWithHttpOperationResponse(resourceGroupName, name, options) { + listPerfMonCountersWithHttpOperationResponse(resourceGroupName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listPremierAddOns(resourceGroupName, name, options, (err, result, request, response) => { + self._listPerfMonCounters(resourceGroupName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -89873,17 +91753,22 @@ class WebApps { } /** - * @summary Gets the premier add-ons of an app. + * @summary Gets perfmon counters for web app. * - * Gets the premier add-ons of an app. + * Gets perfmon counters for web app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Name of web app. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -89894,7 +91779,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {PremierAddOn} - The deserialized result object. + * @resolve {PerfMonCounterCollection} - The deserialized result object. * * @reject {Error} - The error object. * @@ -89903,13 +91788,14 @@ class WebApps { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PremierAddOn} for more information. + * See {@link PerfMonCounterCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listPremierAddOns(resourceGroupName, name, options, optionalCallback) { + listPerfMonCounters(resourceGroupName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -89918,28 +91804,26 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listPremierAddOns(resourceGroupName, name, options, (err, result, request, response) => { + self._listPerfMonCounters(resourceGroupName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listPremierAddOns(resourceGroupName, name, options, optionalCallback); + return self._listPerfMonCounters(resourceGroupName, name, options, optionalCallback); } } /** - * @summary Gets a named add-on of an app. + * @summary Gets web app's event logs. * - * Gets a named add-on of an app. + * Gets web app's event logs. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {string} premierAddOnName Add-on name. + * @param {string} name Name of web app. * * @param {object} [options] Optional Parameters. * @@ -89948,15 +91832,15 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getPremierAddOnWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, options) { + getSitePhpErrorLogFlagWithHttpOperationResponse(resourceGroupName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getPremierAddOn(resourceGroupName, name, premierAddOnName, options, (err, result, request, response) => { + self._getSitePhpErrorLogFlag(resourceGroupName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -89967,16 +91851,14 @@ class WebApps { } /** - * @summary Gets a named add-on of an app. + * @summary Gets web app's event logs. * - * Gets a named add-on of an app. + * Gets web app's event logs. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {string} premierAddOnName Add-on name. + * @param {string} name Name of web app. * * @param {object} [options] Optional Parameters. * @@ -89990,7 +91872,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {PremierAddOn} - The deserialized result object. + * @resolve {SitePhpErrorLogFlag} - The deserialized result object. * * @reject {Error} - The error object. * @@ -89999,13 +91881,13 @@ class WebApps { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PremierAddOn} for more information. + * See {@link SitePhpErrorLogFlag} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getPremierAddOn(resourceGroupName, name, premierAddOnName, options, optionalCallback) { + getSitePhpErrorLogFlag(resourceGroupName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -90014,50 +91896,27 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getPremierAddOn(resourceGroupName, name, premierAddOnName, options, (err, result, request, response) => { + self._getSitePhpErrorLogFlag(resourceGroupName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getPremierAddOn(resourceGroupName, name, premierAddOnName, options, optionalCallback); + return self._getSitePhpErrorLogFlag(resourceGroupName, name, options, optionalCallback); } } /** - * @summary Updates a named add-on of an app. + * @summary Gets the premier add-ons of an app. * - * Updates a named add-on of an app. + * Gets the premier add-ons of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} premierAddOnName Add-on name. - * - * @param {object} premierAddOn A JSON representation of the edited premier - * add-on. - * - * @param {string} [premierAddOn.sku] Premier add on SKU. - * - * @param {string} [premierAddOn.product] Premier add on Product. - * - * @param {string} [premierAddOn.vendor] Premier add on Vendor. - * - * @param {string} [premierAddOn.marketplacePublisher] Premier add on - * Marketplace publisher. - * - * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace - * offer. - * - * @param {string} [premierAddOn.kind] Kind of resource. - * - * @param {string} premierAddOn.location Resource Location. - * - * @param {object} [premierAddOn.tags] Resource tags. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -90069,11 +91928,11 @@ class WebApps { * * @reject {Error} - The error object. */ - addPremierAddOnWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, premierAddOn, options) { + listPremierAddOnsWithHttpOperationResponse(resourceGroupName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, (err, result, request, response) => { + self._listPremierAddOns(resourceGroupName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -90084,38 +91943,15 @@ class WebApps { } /** - * @summary Updates a named add-on of an app. + * @summary Gets the premier add-ons of an app. * - * Updates a named add-on of an app. + * Gets the premier add-ons of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} premierAddOnName Add-on name. - * - * @param {object} premierAddOn A JSON representation of the edited premier - * add-on. - * - * @param {string} [premierAddOn.sku] Premier add on SKU. - * - * @param {string} [premierAddOn.product] Premier add on Product. - * - * @param {string} [premierAddOn.vendor] Premier add on Vendor. - * - * @param {string} [premierAddOn.marketplacePublisher] Premier add on - * Marketplace publisher. - * - * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace - * offer. - * - * @param {string} [premierAddOn.kind] Kind of resource. - * - * @param {string} premierAddOn.location Resource Location. - * - * @param {object} [premierAddOn.tags] Resource tags. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -90143,7 +91979,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, optionalCallback) { + listPremierAddOns(resourceGroupName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -90152,21 +91988,21 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, (err, result, request, response) => { + self._listPremierAddOns(resourceGroupName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, optionalCallback); + return self._listPremierAddOns(resourceGroupName, name, options, optionalCallback); } } /** - * @summary Delete a premier add-on from an app. + * @summary Gets a named add-on of an app. * - * Delete a premier add-on from an app. + * Gets a named add-on of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -90182,15 +92018,15 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deletePremierAddOnWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, options) { + getPremierAddOnWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, (err, result, request, response) => { + self._getPremierAddOn(resourceGroupName, name, premierAddOnName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -90201,9 +92037,9 @@ class WebApps { } /** - * @summary Delete a premier add-on from an app. + * @summary Gets a named add-on of an app. * - * Delete a premier add-on from an app. + * Gets a named add-on of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -90224,7 +92060,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {PremierAddOn} - The deserialized result object. * * @reject {Error} - The error object. * @@ -90232,13 +92068,14 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, optionalCallback) { + getPremierAddOn(resourceGroupName, name, premierAddOnName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -90247,14 +92084,247 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, (err, result, request, response) => { + self._getPremierAddOn(resourceGroupName, name, premierAddOnName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, optionalCallback); + return self._getPremierAddOn(resourceGroupName, name, premierAddOnName, options, optionalCallback); + } + } + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @param {string} premierAddOn.location Resource Location. + * + * @param {object} [premierAddOn.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} - The error object. + */ + addPremierAddOnWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, premierAddOn, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @param {string} premierAddOn.location Resource Location. + * + * @param {object} [premierAddOn.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|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 {PremierAddOn} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, optionalCallback); + } + } + + /** + * @summary Delete a premier add-on from an app. + * + * Delete a premier add-on from an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @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} - The error object. + */ + deletePremierAddOnWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete a premier add-on from an app. + * + * Delete a premier add-on from an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|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} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, optionalCallback); } } @@ -107268,7 +109338,7 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -107315,7 +109385,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -107323,7 +109393,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -107487,7 +109557,7 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -107537,7 +109607,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -107545,7 +109615,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -107771,6 +109841,216 @@ class WebApps { } } + /** + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} operationId GUID of the operation. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get an operation for the production slot. + * + * @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} - The error object. + */ + getNetworkTraceOperationSlotV2WithHttpOperationResponse(resourceGroupName, name, operationId, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getNetworkTraceOperationSlotV2(resourceGroupName, name, operationId, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} operationId GUID of the operation. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get an operation for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|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 {Array} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getNetworkTraceOperationSlotV2(resourceGroupName, name, operationId, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getNetworkTraceOperationSlotV2(resourceGroupName, name, operationId, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getNetworkTraceOperationSlotV2(resourceGroupName, name, operationId, slot, options, optionalCallback); + } + } + + /** + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} operationId GUID of the operation. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get an operation for the production slot. + * + * @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} - The error object. + */ + getNetworkTracesSlotV2WithHttpOperationResponse(resourceGroupName, name, operationId, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getNetworkTracesSlotV2(resourceGroupName, name, operationId, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). + * + * Gets a named operation for a network trace capturing (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} operationId GUID of the operation. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get an operation for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|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 {Array} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getNetworkTracesSlotV2(resourceGroupName, name, operationId, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getNetworkTracesSlotV2(resourceGroupName, name, operationId, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getNetworkTracesSlotV2(resourceGroupName, name, operationId, slot, options, optionalCallback); + } + } + /** * @summary Generates a new publishing password for an app (or deployment slot, * if specified). @@ -111368,7 +113648,241 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, optionalCallback) { + deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, optionalCallback); + } + } + + /** + * @summary Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @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} - The error object. + */ + listSlotDifferencesSlotWithHttpOperationResponse(resourceGroupName, name, slotSwapEntity, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|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 {SlotDifferenceCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SlotDifferenceCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, optionalCallback); + } + } + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @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} - The error object. + */ + swapSlotSlotWithHttpOperationResponse(resourceGroupName, name, slotSwapEntity, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|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} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -111377,39 +113891,28 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, (err, result, request, response) => { + self._swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, optionalCallback); + return self._swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, optionalCallback); } } /** - * @summary Get the difference in configuration settings between two web app - * slots. + * @summary Returns all Snapshots to the user. * - * Get the difference in configuration settings between two web app slots. + * Returns all Snapshots to the user. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {object} slotSwapEntity JSON object that contains the target slot - * name. See example. - * - * @param {string} slotSwapEntity.targetSlot Destination deployment slot during - * swap operation. - * - * @param {boolean} slotSwapEntity.preserveVnet true to preserve - * Virtual Network to the slot during swap; otherwise, false. + * @param {string} name Website Name. * - * @param {string} slot Name of the source slot. If a slot is not specified, - * the production slot is used as the source slot. + * @param {string} slot Website Slot. * * @param {object} [options] Optional Parameters. * @@ -111418,15 +113921,15 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listSlotDifferencesSlotWithHttpOperationResponse(resourceGroupName, name, slotSwapEntity, slot, options) { + listSnapshotsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { + self._listSnapshotsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -111437,27 +113940,16 @@ class WebApps { } /** - * @summary Get the difference in configuration settings between two web app - * slots. + * @summary Returns all Snapshots to the user. * - * Get the difference in configuration settings between two web app slots. + * Returns all Snapshots to the user. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {object} slotSwapEntity JSON object that contains the target slot - * name. See example. - * - * @param {string} slotSwapEntity.targetSlot Destination deployment slot during - * swap operation. - * - * @param {boolean} slotSwapEntity.preserveVnet true to preserve - * Virtual Network to the slot during swap; otherwise, false. + * @param {string} name Website Name. * - * @param {string} slot Name of the source slot. If a slot is not specified, - * the production slot is used as the source slot. + * @param {string} slot Website Slot. * * @param {object} [options] Optional Parameters. * @@ -111471,7 +113963,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {SlotDifferenceCollection} - The deserialized result object. + * @resolve {SnapshotCollection} - The deserialized result object. * * @reject {Error} - The error object. * @@ -111480,14 +113972,13 @@ class WebApps { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SlotDifferenceCollection} for more - * information. + * See {@link SnapshotCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, optionalCallback) { + listSnapshotsSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -111496,38 +113987,28 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { + self._listSnapshotsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, optionalCallback); + return self._listSnapshotsSlot(resourceGroupName, name, slot, options, optionalCallback); } } /** - * @summary Swaps two deployment slots of an app. + * @summary Returns all Snapshots to the user from DRSecondary endpoint. * - * Swaps two deployment slots of an app. + * Returns all Snapshots to the user from DRSecondary endpoint. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {object} slotSwapEntity JSON object that contains the target slot - * name. See example. - * - * @param {string} slotSwapEntity.targetSlot Destination deployment slot during - * swap operation. - * - * @param {boolean} slotSwapEntity.preserveVnet true to preserve - * Virtual Network to the slot during swap; otherwise, false. + * @param {string} name Website Name. * - * @param {string} slot Name of the source slot. If a slot is not specified, - * the production slot is used as the source slot. + * @param {string} slot Website Slot. * * @param {object} [options] Optional Parameters. * @@ -111536,15 +114017,15 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - swapSlotSlotWithHttpOperationResponse(resourceGroupName, name, slotSwapEntity, slot, options) { + listSnapshotsFromDRSecondarySlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { + self._listSnapshotsFromDRSecondarySlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -111555,26 +114036,16 @@ class WebApps { } /** - * @summary Swaps two deployment slots of an app. + * @summary Returns all Snapshots to the user from DRSecondary endpoint. * - * Swaps two deployment slots of an app. + * Returns all Snapshots to the user from DRSecondary endpoint. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {object} slotSwapEntity JSON object that contains the target slot - * name. See example. - * - * @param {string} slotSwapEntity.targetSlot Destination deployment slot during - * swap operation. - * - * @param {boolean} slotSwapEntity.preserveVnet true to preserve - * Virtual Network to the slot during swap; otherwise, false. + * @param {string} name Website Name. * - * @param {string} slot Name of the source slot. If a slot is not specified, - * the production slot is used as the source slot. + * @param {string} slot Website Slot. * * @param {object} [options] Optional Parameters. * @@ -111588,7 +114059,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {SnapshotCollection} - The deserialized result object. * * @reject {Error} - The error object. * @@ -111596,13 +114067,14 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, optionalCallback) { + listSnapshotsFromDRSecondarySlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -111611,28 +114083,30 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { + self._listSnapshotsFromDRSecondarySlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, optionalCallback); + return self._listSnapshotsFromDRSecondarySlot(resourceGroupName, name, slot, options, optionalCallback); } } /** - * @summary Returns all Snapshots to the user. + * @summary Gets the source control configuration of an app. * - * Returns all Snapshots to the user. + * Gets the source control configuration of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Website Name. + * @param {string} name Name of the app. * - * @param {string} slot Website Slot. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the source control configuration for the + * production slot. * * @param {object} [options] Optional Parameters. * @@ -111641,15 +114115,15 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listSnapshotsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + getSourceControlSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listSnapshotsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._getSourceControlSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -111660,16 +114134,18 @@ class WebApps { } /** - * @summary Returns all Snapshots to the user. + * @summary Gets the source control configuration of an app. * - * Returns all Snapshots to the user. + * Gets the source control configuration of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Website Name. + * @param {string} name Name of the app. * - * @param {string} slot Website Slot. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the source control configuration for the + * production slot. * * @param {object} [options] Optional Parameters. * @@ -111683,7 +114159,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {SnapshotCollection} - The deserialized result object. + * @resolve {SiteSourceControl} - The deserialized result object. * * @reject {Error} - The error object. * @@ -111692,13 +114168,13 @@ class WebApps { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SnapshotCollection} for more information. + * See {@link SiteSourceControl} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listSnapshotsSlot(resourceGroupName, name, slot, options, optionalCallback) { + getSourceControlSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -111707,28 +114183,52 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listSnapshotsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._getSourceControlSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listSnapshotsSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._getSourceControlSlot(resourceGroupName, name, slot, options, optionalCallback); } } /** - * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * @summary Updates the source control configuration of an app. * - * Returns all Snapshots to the user from DRSecondary endpoint. + * Updates the source control configuration of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Website Name. + * @param {string} name Name of the app. * - * @param {string} slot Website Slot. + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the source control configuration for the + * production slot. * * @param {object} [options] Optional Parameters. * @@ -111737,15 +114237,15 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listSnapshotsFromDRSecondarySlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + createOrUpdateSourceControlSlotWithHttpOperationResponse(resourceGroupName, name, siteSourceControl, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listSnapshotsFromDRSecondarySlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._createOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -111756,16 +114256,40 @@ class WebApps { } /** - * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * @summary Updates the source control configuration of an app. * - * Returns all Snapshots to the user from DRSecondary endpoint. + * Updates the source control configuration of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Website Name. + * @param {string} name Name of the app. * - * @param {string} slot Website Slot. + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the source control configuration for the + * production slot. * * @param {object} [options] Optional Parameters. * @@ -111779,7 +114303,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {SnapshotCollection} - The deserialized result object. + * @resolve {SiteSourceControl} - The deserialized result object. * * @reject {Error} - The error object. * @@ -111788,13 +114312,13 @@ class WebApps { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SnapshotCollection} for more information. + * See {@link SiteSourceControl} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listSnapshotsFromDRSecondarySlot(resourceGroupName, name, slot, options, optionalCallback) { + createOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -111803,21 +114327,21 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listSnapshotsFromDRSecondarySlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._createOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listSnapshotsFromDRSecondarySlot(resourceGroupName, name, slot, options, optionalCallback); + return self._createOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, optionalCallback); } } /** - * @summary Gets the source control configuration of an app. + * @summary Deletes the source control configuration of an app. * - * Gets the source control configuration of an app. + * Deletes the source control configuration of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -111825,7 +114349,7 @@ class WebApps { * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the source control configuration for the + * specified, the API will delete the source control configuration for the * production slot. * * @param {object} [options] Optional Parameters. @@ -111835,15 +114359,15 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getSourceControlSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + deleteSourceControlSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getSourceControlSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._deleteSourceControlSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -111854,9 +114378,9 @@ class WebApps { } /** - * @summary Gets the source control configuration of an app. + * @summary Deletes the source control configuration of an app. * - * Gets the source control configuration of an app. + * Deletes the source control configuration of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -111864,7 +114388,7 @@ class WebApps { * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the source control configuration for the + * specified, the API will delete the source control configuration for the * production slot. * * @param {object} [options] Optional Parameters. @@ -111879,7 +114403,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {SiteSourceControl} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -111887,14 +114411,13 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteSourceControl} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getSourceControlSlot(resourceGroupName, name, slot, options, optionalCallback) { + deleteSourceControlSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -111903,14 +114426,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getSourceControlSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._deleteSourceControlSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getSourceControlSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._deleteSourceControlSlot(resourceGroupName, name, slot, options, optionalCallback); } } @@ -111961,11 +114484,11 @@ class WebApps { * * @reject {Error} - The error object. */ - createOrUpdateSourceControlSlotWithHttpOperationResponse(resourceGroupName, name, siteSourceControl, slot, options) { + updateSourceControlSlotWithHttpOperationResponse(resourceGroupName, name, siteSourceControl, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, (err, result, request, response) => { + self._updateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -112038,7 +114561,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, optionalCallback) { + updateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -112047,21 +114570,21 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, (err, result, request, response) => { + self._updateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, optionalCallback); + return self._updateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, optionalCallback); } } /** - * @summary Deletes the source control configuration of an app. + * @summary Starts an app (or deployment slot, if specified). * - * Deletes the source control configuration of an app. + * Starts an app (or deployment slot, if specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -112069,8 +114592,7 @@ class WebApps { * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete the source control configuration for the - * production slot. + * specified, the API will start the production slot. * * @param {object} [options] Optional Parameters. * @@ -112083,11 +114605,11 @@ class WebApps { * * @reject {Error} - The error object. */ - deleteSourceControlSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + startSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteSourceControlSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._startSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -112098,9 +114620,9 @@ class WebApps { } /** - * @summary Deletes the source control configuration of an app. + * @summary Starts an app (or deployment slot, if specified). * - * Deletes the source control configuration of an app. + * Starts an app (or deployment slot, if specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -112108,8 +114630,7 @@ class WebApps { * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete the source control configuration for the - * production slot. + * specified, the API will start the production slot. * * @param {object} [options] Optional Parameters. * @@ -112137,7 +114658,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteSourceControlSlot(resourceGroupName, name, slot, options, optionalCallback) { + startSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -112146,69 +114667,53 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteSourceControlSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._startSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteSourceControlSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._startSlot(resourceGroupName, name, slot, options, optionalCallback); } } /** - * @summary Updates the source control configuration of an app. + * @summary Start capturing network packets for the site. * - * Updates the source control configuration of an app. + * Start capturing network packets for the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {object} siteSourceControl JSON representation of a SiteSourceControl - * object. See example. - * - * @param {string} [siteSourceControl.repoUrl] Repository or source control - * URL. - * - * @param {string} [siteSourceControl.branch] Name of branch to use for - * deployment. - * - * @param {boolean} [siteSourceControl.isManualIntegration] true - * to limit to manual integration; false to enable continuous - * integration (which configures webhooks into online repos like GitHub). + * @param {string} name The name of the web app. * - * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] - * true to enable deployment rollback; otherwise, - * false. + * @param {string} slot The name of the slot for this web app. * - * @param {boolean} [siteSourceControl.isMercurial] true for a - * Mercurial repository; false for a Git repository. + * @param {object} [options] Optional Parameters. * - * @param {string} [siteSourceControl.kind] Kind of resource. + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will update the source control configuration for the - * production slot. + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). * - * @param {object} [options] Optional Parameters. + * @param {string} [options.sasUrl] The Blob URL to store capture file. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - updateSourceControlSlotWithHttpOperationResponse(resourceGroupName, name, siteSourceControl, slot, options) { + startNetworkTraceSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._updateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, (err, result, request, response) => { + self._startNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -112219,42 +114724,26 @@ class WebApps { } /** - * @summary Updates the source control configuration of an app. + * @summary Start capturing network packets for the site. * - * Updates the source control configuration of an app. + * Start capturing network packets for the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {object} siteSourceControl JSON representation of a SiteSourceControl - * object. See example. - * - * @param {string} [siteSourceControl.repoUrl] Repository or source control - * URL. - * - * @param {string} [siteSourceControl.branch] Name of branch to use for - * deployment. - * - * @param {boolean} [siteSourceControl.isManualIntegration] true - * to limit to manual integration; false to enable continuous - * integration (which configures webhooks into online repos like GitHub). + * @param {string} name The name of the web app. * - * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] - * true to enable deployment rollback; otherwise, - * false. + * @param {string} slot The name of the slot for this web app. * - * @param {boolean} [siteSourceControl.isMercurial] true for a - * Mercurial repository; false for a Git repository. + * @param {object} [options] Optional Parameters. * - * @param {string} [siteSourceControl.kind] Kind of resource. + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will update the source control configuration for the - * production slot. + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). * - * @param {object} [options] Optional Parameters. + * @param {string} [options.sasUrl] The Blob URL to store capture file. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -112266,7 +114755,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {SiteSourceControl} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -112274,14 +114763,13 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteSourceControl} for more information. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - updateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, optionalCallback) { + startNetworkTraceSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -112290,21 +114778,21 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, (err, result, request, response) => { + self._startNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, optionalCallback); + return self._startNetworkTraceSlot(resourceGroupName, name, slot, options, optionalCallback); } } /** - * @summary Starts an app (or deployment slot, if specified). + * @summary Stops an app (or deployment slot, if specified). * - * Starts an app (or deployment slot, if specified). + * Stops an app (or deployment slot, if specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -112312,7 +114800,7 @@ class WebApps { * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will start the production slot. + * specified, the API will stop the production slot. * * @param {object} [options] Optional Parameters. * @@ -112325,11 +114813,11 @@ class WebApps { * * @reject {Error} - The error object. */ - startSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + stopSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._startSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._stopSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -112340,9 +114828,9 @@ class WebApps { } /** - * @summary Starts an app (or deployment slot, if specified). + * @summary Stops an app (or deployment slot, if specified). * - * Starts an app (or deployment slot, if specified). + * Stops an app (or deployment slot, if specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -112350,7 +114838,7 @@ class WebApps { * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will start the production slot. + * specified, the API will stop the production slot. * * @param {object} [options] Optional Parameters. * @@ -112378,7 +114866,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - startSlot(resourceGroupName, name, slot, options, optionalCallback) { + stopSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -112387,29 +114875,28 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._startSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._stopSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._startSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._stopSlot(resourceGroupName, name, slot, options, optionalCallback); } } /** - * @summary Stops an app (or deployment slot, if specified). + * @summary Stop ongoing capturing network packets for the site. * - * Stops an app (or deployment slot, if specified). + * Stop ongoing capturing network packets for the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name The name of the web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will stop the production slot. + * @param {string} slot The name of the slot for this web app. * * @param {object} [options] Optional Parameters. * @@ -112422,11 +114909,11 @@ class WebApps { * * @reject {Error} - The error object. */ - stopSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + stopNetworkTraceSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._stopSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._stopNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -112437,17 +114924,16 @@ class WebApps { } /** - * @summary Stops an app (or deployment slot, if specified). + * @summary Stop ongoing capturing network packets for the site. * - * Stops an app (or deployment slot, if specified). + * Stop ongoing capturing network packets for the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name The name of the web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will stop the production slot. + * @param {string} slot The name of the slot for this web app. * * @param {object} [options] Optional Parameters. * @@ -112475,7 +114961,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - stopSlot(resourceGroupName, name, slot, options, optionalCallback) { + stopNetworkTraceSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -112484,14 +114970,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._stopSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._stopNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._stopSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._stopNetworkTraceSlot(resourceGroupName, name, slot, options, optionalCallback); } } @@ -115536,6 +118022,113 @@ class WebApps { } } + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @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} - The error object. + */ + startNetworkTraceWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._startNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|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 {Array} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + startNetworkTrace(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._startNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._startNetworkTrace(resourceGroupName, name, options, optionalCallback); + } + } + /** * @summary Stops an app (or deployment slot, if specified). * @@ -115627,6 +118220,97 @@ class WebApps { } } + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @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} - The error object. + */ + stopNetworkTraceWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._stopNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|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} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + stopNetworkTrace(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._stopNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._stopNetworkTrace(resourceGroupName, name, options, optionalCallback); + } + } + /** * @summary Sync web app repository. * @@ -119393,7 +122077,7 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -119441,7 +122125,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -119449,7 +122133,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -121626,7 +124310,7 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -121676,7 +124360,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -121684,7 +124368,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -122550,6 +125234,117 @@ class WebApps { } } + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @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} - The error object. + */ + beginStartNetworkTraceSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginStartNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|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 {Array} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginStartNetworkTraceSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginStartNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginStartNetworkTraceSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + /** * @summary Swaps two deployment slots of an app. * @@ -122795,6 +125590,113 @@ class WebApps { } } + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @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} - The error object. + */ + beginStartNetworkTraceWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginStartNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|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 {Array} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginStartNetworkTrace(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginStartNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginStartNetworkTrace(resourceGroupName, name, options, optionalCallback); + } + } + /** * @summary Get all apps for a subscription. *