diff --git a/lib/services/websiteManagement2/lib/models/appServiceEnvironment.js b/lib/services/websiteManagement2/lib/models/appServiceEnvironment.js index af47066e3f..f700716e96 100644 --- a/lib/services/websiteManagement2/lib/models/appServiceEnvironment.js +++ b/lib/services/websiteManagement2/lib/models/appServiceEnvironment.js @@ -97,6 +97,12 @@ class AppServiceEnvironment { * behavior of the App Service Environment. * @member {array} [userWhitelistedIpRanges] User added ip ranges to * whitelist on ASE db + * @member {boolean} [hasLinuxWorkers] Flag that displays whether an ASE has + * linux workers or not + * @member {string} [sslCertKeyVaultId] Key Vault ID for ILB App Service + * Environment default SSL certificate + * @member {string} [sslCertKeyVaultSecretName] Key Vault Secret Name for ILB + * App Service Environment default SSL certificate */ constructor() { } @@ -434,6 +440,27 @@ class AppServiceEnvironment { } } } + }, + hasLinuxWorkers: { + required: false, + serializedName: 'hasLinuxWorkers', + type: { + name: 'Boolean' + } + }, + sslCertKeyVaultId: { + required: false, + serializedName: 'sslCertKeyVaultId', + type: { + name: 'String' + } + }, + sslCertKeyVaultSecretName: { + required: false, + serializedName: 'sslCertKeyVaultSecretName', + type: { + name: 'String' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/appServiceEnvironmentPatchResource.js b/lib/services/websiteManagement2/lib/models/appServiceEnvironmentPatchResource.js index 990549c0b2..ab454a36fc 100644 --- a/lib/services/websiteManagement2/lib/models/appServiceEnvironmentPatchResource.js +++ b/lib/services/websiteManagement2/lib/models/appServiceEnvironmentPatchResource.js @@ -99,6 +99,12 @@ class AppServiceEnvironmentPatchResource extends models['ProxyOnlyResource'] { * behavior of the App Service Environment. * @member {array} [userWhitelistedIpRanges] User added ip ranges to * whitelist on ASE db + * @member {boolean} [hasLinuxWorkers] Flag that displays whether an ASE has + * linux workers or not + * @member {string} [sslCertKeyVaultId] Key Vault ID for ILB App Service + * Environment default SSL certificate + * @member {string} [sslCertKeyVaultSecretName] Key Vault Secret Name for ILB + * App Service Environment default SSL certificate */ constructor() { super(); @@ -468,6 +474,27 @@ class AppServiceEnvironmentPatchResource extends models['ProxyOnlyResource'] { } } } + }, + hasLinuxWorkers: { + required: false, + serializedName: 'properties.hasLinuxWorkers', + type: { + name: 'Boolean' + } + }, + sslCertKeyVaultId: { + required: false, + serializedName: 'properties.sslCertKeyVaultId', + type: { + name: 'String' + } + }, + sslCertKeyVaultSecretName: { + required: false, + serializedName: 'properties.sslCertKeyVaultSecretName', + type: { + name: 'String' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/appServiceEnvironmentResource.js b/lib/services/websiteManagement2/lib/models/appServiceEnvironmentResource.js index 458a7a0309..462a7c2f8b 100644 --- a/lib/services/websiteManagement2/lib/models/appServiceEnvironmentResource.js +++ b/lib/services/websiteManagement2/lib/models/appServiceEnvironmentResource.js @@ -99,6 +99,12 @@ class AppServiceEnvironmentResource extends models['Resource'] { * behavior of the App Service Environment. * @member {array} [userWhitelistedIpRanges] User added ip ranges to * whitelist on ASE db + * @member {boolean} [hasLinuxWorkers] Flag that displays whether an ASE has + * linux workers or not + * @member {string} [sslCertKeyVaultId] Key Vault ID for ILB App Service + * Environment default SSL certificate + * @member {string} [sslCertKeyVaultSecretName] Key Vault Secret Name for ILB + * App Service Environment default SSL certificate */ constructor() { super(); @@ -489,6 +495,27 @@ class AppServiceEnvironmentResource extends models['Resource'] { } } } + }, + hasLinuxWorkers: { + required: false, + serializedName: 'properties.hasLinuxWorkers', + type: { + name: 'Boolean' + } + }, + sslCertKeyVaultId: { + required: false, + serializedName: 'properties.sslCertKeyVaultId', + type: { + name: 'String' + } + }, + sslCertKeyVaultSecretName: { + required: false, + serializedName: 'properties.sslCertKeyVaultSecretName', + type: { + name: 'String' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/appServicePlan.js b/lib/services/websiteManagement2/lib/models/appServicePlan.js index b8ecc0f0b9..79f4b30d7d 100644 --- a/lib/services/websiteManagement2/lib/models/appServicePlan.js +++ b/lib/services/websiteManagement2/lib/models/appServicePlan.js @@ -20,7 +20,6 @@ const models = require('./index'); class AppServicePlan extends models['Resource'] { /** * Create a AppServicePlan. - * @member {string} appServicePlanName Name for the App Service plan. * @member {string} [workerTierName] Target worker tier assigned to the App * Service plan. * @member {string} [status] App Service plan status. Possible values @@ -49,9 +48,13 @@ class AppServicePlan extends models['Resource'] { * owns spot instances. * @member {date} [spotExpirationTime] The time when the server farm expires. * Valid only if it is a spot server farm. + * @member {date} [freeOfferExpirationTime] The time when the server farm + * free offer expires. * @member {string} [resourceGroup] Resource group of the App Service plan. * @member {boolean} [reserved] If Linux app service plan true, * false otherwise. Default value: false . + * @member {boolean} [isXenon] If Hyper-V container app service plan + * true, false otherwise. Default value: false . * @member {number} [targetWorkerCount] Scaling worker count. * @member {number} [targetWorkerSizeId] Scaling worker size ID. * @member {string} [provisioningState] Provisioning state of the App Service @@ -148,13 +151,6 @@ class AppServicePlan extends models['Resource'] { } } }, - appServicePlanName: { - required: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, workerTierName: { required: false, serializedName: 'properties.workerTierName', @@ -240,6 +236,13 @@ class AppServicePlan extends models['Resource'] { name: 'DateTime' } }, + freeOfferExpirationTime: { + required: false, + serializedName: 'properties.freeOfferExpirationTime', + type: { + name: 'DateTime' + } + }, resourceGroup: { required: false, readOnly: true, @@ -256,6 +259,14 @@ class AppServicePlan extends models['Resource'] { name: 'Boolean' } }, + isXenon: { + required: false, + serializedName: 'properties.isXenon', + defaultValue: false, + type: { + name: 'Boolean' + } + }, targetWorkerCount: { required: false, serializedName: 'properties.targetWorkerCount', diff --git a/lib/services/websiteManagement2/lib/models/appServicePlanCollection.js b/lib/services/websiteManagement2/lib/models/appServicePlanCollection.js index 620bda3ea5..74827eafd6 100644 --- a/lib/services/websiteManagement2/lib/models/appServicePlanCollection.js +++ b/lib/services/websiteManagement2/lib/models/appServicePlanCollection.js @@ -53,6 +53,7 @@ class AppServicePlanCollection extends Array { }, nextLink: { required: false, + readOnly: true, serializedName: 'nextLink', type: { name: 'String' diff --git a/lib/services/websiteManagement2/lib/models/appServicePlanPatchResource.js b/lib/services/websiteManagement2/lib/models/appServicePlanPatchResource.js index e08905aeec..bbeaed4a8f 100644 --- a/lib/services/websiteManagement2/lib/models/appServicePlanPatchResource.js +++ b/lib/services/websiteManagement2/lib/models/appServicePlanPatchResource.js @@ -20,8 +20,6 @@ const models = require('./index'); class AppServicePlanPatchResource extends models['ProxyOnlyResource'] { /** * Create a AppServicePlanPatchResource. - * @member {string} appServicePlanPatchResourceName Name for the App Service - * plan. * @member {string} [workerTierName] Target worker tier assigned to the App * Service plan. * @member {string} [status] App Service plan status. Possible values @@ -50,9 +48,13 @@ class AppServicePlanPatchResource extends models['ProxyOnlyResource'] { * owns spot instances. * @member {date} [spotExpirationTime] The time when the server farm expires. * Valid only if it is a spot server farm. + * @member {date} [freeOfferExpirationTime] The time when the server farm + * free offer expires. * @member {string} [resourceGroup] Resource group of the App Service plan. * @member {boolean} [reserved] If Linux app service plan true, * false otherwise. Default value: false . + * @member {boolean} [isXenon] If Hyper-V container app service plan + * true, false otherwise. Default value: false . * @member {number} [targetWorkerCount] Scaling worker count. * @member {number} [targetWorkerSizeId] Scaling worker size ID. * @member {string} [provisioningState] Provisioning state of the App Service @@ -108,13 +110,6 @@ class AppServicePlanPatchResource extends models['ProxyOnlyResource'] { name: 'String' } }, - appServicePlanPatchResourceName: { - required: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, workerTierName: { required: false, serializedName: 'properties.workerTierName', @@ -200,6 +195,13 @@ class AppServicePlanPatchResource extends models['ProxyOnlyResource'] { name: 'DateTime' } }, + freeOfferExpirationTime: { + required: false, + serializedName: 'properties.freeOfferExpirationTime', + type: { + name: 'DateTime' + } + }, resourceGroup: { required: false, readOnly: true, @@ -216,6 +218,14 @@ class AppServicePlanPatchResource extends models['ProxyOnlyResource'] { name: 'Boolean' } }, + isXenon: { + required: false, + serializedName: 'properties.isXenon', + defaultValue: false, + type: { + name: 'Boolean' + } + }, targetWorkerCount: { required: false, serializedName: 'properties.targetWorkerCount', diff --git a/lib/services/websiteManagement2/lib/models/backupRequest.js b/lib/services/websiteManagement2/lib/models/backupRequest.js index dba65bf110..c7b5da3f97 100644 --- a/lib/services/websiteManagement2/lib/models/backupRequest.js +++ b/lib/services/websiteManagement2/lib/models/backupRequest.js @@ -20,7 +20,6 @@ const models = require('./index'); class BackupRequest extends models['ProxyOnlyResource'] { /** * Create a BackupRequest. - * @member {string} backupRequestName Name of the backup. * @member {boolean} [enabled] True if the backup schedule is enabled (must * be included in that case), false if the backup schedule should be * disabled. @@ -44,8 +43,6 @@ class BackupRequest extends models['ProxyOnlyResource'] { * @member {date} [backupSchedule.lastExecutionTime] Last time when this * schedule was triggered. * @member {array} [databases] Databases included in the backup. - * @member {string} [backupRequestType] Type of the backup. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' */ constructor() { super(); @@ -96,13 +93,6 @@ class BackupRequest extends models['ProxyOnlyResource'] { name: 'String' } }, - backupRequestName: { - required: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, enabled: { required: false, serializedName: 'properties.enabled', @@ -139,14 +129,6 @@ class BackupRequest extends models['ProxyOnlyResource'] { } } } - }, - backupRequestType: { - required: false, - serializedName: 'properties.type', - type: { - name: 'Enum', - allowedValues: [ 'Default', 'Clone', 'Relocation', 'Snapshot' ] - } } } } diff --git a/lib/services/websiteManagement2/lib/models/billingMeter.js b/lib/services/websiteManagement2/lib/models/billingMeter.js index 14229378b7..aba6effb23 100644 --- a/lib/services/websiteManagement2/lib/models/billingMeter.js +++ b/lib/services/websiteManagement2/lib/models/billingMeter.js @@ -26,7 +26,8 @@ class BillingMeter extends models['ProxyOnlyResource'] { * @member {string} [shortName] Short Name from App Service Azure pricing * Page * @member {string} [friendlyName] Friendly name of the meter - * @member {string} [resourceType] App Service resource type meter used for + * @member {string} [resourceType] App Service ResourceType meter used for + * @member {string} [osType] App Service OS type meter used for */ constructor() { super(); @@ -111,6 +112,13 @@ class BillingMeter extends models['ProxyOnlyResource'] { type: { name: 'String' } + }, + osType: { + required: false, + serializedName: 'properties.osType', + type: { + name: 'String' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/certificate.js b/lib/services/websiteManagement2/lib/models/certificate.js index 200bd1eaf4..f7b9f4da55 100644 --- a/lib/services/websiteManagement2/lib/models/certificate.js +++ b/lib/services/websiteManagement2/lib/models/certificate.js @@ -50,7 +50,6 @@ class Certificate extends models['Resource'] { * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', * 'Unknown' - * @member {string} [geoRegion] Region of the certificate. * @member {string} [serverFarmId] Resource ID of the associated App Service * plan, formatted as: * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". @@ -273,14 +272,6 @@ class Certificate extends models['Resource'] { allowedValues: [ 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', 'Unknown' ] } }, - geoRegion: { - required: false, - readOnly: true, - serializedName: 'properties.geoRegion', - type: { - name: 'String' - } - }, serverFarmId: { required: false, serializedName: 'properties.serverFarmId', diff --git a/lib/services/websiteManagement2/lib/models/certificateOrderAction.js b/lib/services/websiteManagement2/lib/models/certificateOrderAction.js index fc3635e0c7..123fb2ad46 100644 --- a/lib/services/websiteManagement2/lib/models/certificateOrderAction.js +++ b/lib/services/websiteManagement2/lib/models/certificateOrderAction.js @@ -20,8 +20,8 @@ const models = require('./index'); class CertificateOrderAction extends models['ProxyOnlyResource'] { /** * Create a CertificateOrderAction. - * @member {string} [certificateOrderActionType] Action type. Possible values - * include: 'CertificateIssued', 'CertificateOrderCanceled', + * @member {string} [actionType] Action type. Possible values include: + * 'CertificateIssued', 'CertificateOrderCanceled', * 'CertificateOrderCreated', 'CertificateRevoked', * 'DomainValidationComplete', 'FraudDetected', 'OrgNameChange', * 'OrgValidationComplete', 'SanDrop', 'FraudCleared', 'CertificateExpired', @@ -78,9 +78,10 @@ class CertificateOrderAction extends models['ProxyOnlyResource'] { name: 'String' } }, - certificateOrderActionType: { + actionType: { required: false, - serializedName: 'properties.type', + readOnly: true, + serializedName: 'properties.actionType', type: { name: 'Enum', allowedValues: [ 'CertificateIssued', 'CertificateOrderCanceled', 'CertificateOrderCreated', 'CertificateRevoked', 'DomainValidationComplete', 'FraudDetected', 'OrgNameChange', 'OrgValidationComplete', 'SanDrop', 'FraudCleared', 'CertificateExpired', 'CertificateExpirationWarning', 'FraudDocumentationRequired', 'Unknown' ] @@ -88,6 +89,7 @@ class CertificateOrderAction extends models['ProxyOnlyResource'] { }, createdAt: { required: false, + readOnly: true, serializedName: 'properties.createdAt', type: { name: 'DateTime' diff --git a/lib/services/websiteManagement2/lib/models/certificatePatchResource.js b/lib/services/websiteManagement2/lib/models/certificatePatchResource.js index e68d49ee1a..708ccf5cf0 100644 --- a/lib/services/websiteManagement2/lib/models/certificatePatchResource.js +++ b/lib/services/websiteManagement2/lib/models/certificatePatchResource.js @@ -50,7 +50,6 @@ class CertificatePatchResource extends models['ProxyOnlyResource'] { * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', * 'Unknown' - * @member {string} [geoRegion] Region of the certificate. * @member {string} [serverFarmId] Resource ID of the associated App Service * plan, formatted as: * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". @@ -252,14 +251,6 @@ class CertificatePatchResource extends models['ProxyOnlyResource'] { allowedValues: [ 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', 'Unknown' ] } }, - geoRegion: { - required: false, - readOnly: true, - serializedName: 'properties.geoRegion', - type: { - name: 'String' - } - }, serverFarmId: { required: false, serializedName: 'properties.serverFarmId', diff --git a/lib/services/websiteManagement2/lib/models/cloningInfo.js b/lib/services/websiteManagement2/lib/models/cloningInfo.js index 868a356c16..971b705122 100644 --- a/lib/services/websiteManagement2/lib/models/cloningInfo.js +++ b/lib/services/websiteManagement2/lib/models/cloningInfo.js @@ -46,8 +46,6 @@ class CloningInfo { * @member {string} [trafficManagerProfileName] Name of Traffic Manager * profile to create. This is only needed if Traffic Manager profile does not * already exist. - * @member {boolean} [ignoreQuotas] true if quotas should be - * ignored; otherwise, false. */ constructor() { } @@ -142,13 +140,6 @@ class CloningInfo { type: { name: 'String' } - }, - ignoreQuotas: { - required: false, - serializedName: 'ignoreQuotas', - type: { - name: 'Boolean' - } } } } diff --git a/lib/services/websiteManagement2/lib/models/continuousWebJob.js b/lib/services/websiteManagement2/lib/models/continuousWebJob.js index ffba08bca7..7ae4000f49 100644 --- a/lib/services/websiteManagement2/lib/models/continuousWebJob.js +++ b/lib/services/websiteManagement2/lib/models/continuousWebJob.js @@ -24,12 +24,10 @@ class ContinuousWebJob extends models['ProxyOnlyResource'] { * 'Initializing', 'Starting', 'Running', 'PendingRestart', 'Stopped' * @member {string} [detailedStatus] Detailed status. * @member {string} [logUrl] Log URL. - * @member {string} [continuousWebJobName] Job name. Used as job identifier - * in ARM resource URI. * @member {string} [runCommand] Run command. * @member {string} [url] Job URL. * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] Job type. Possible values include: + * @member {string} [webJobType] Job type. Possible values include: * 'Continuous', 'Triggered' * @member {string} [error] Error information. * @member {boolean} [usingSdk] Using SDK? @@ -94,29 +92,21 @@ class ContinuousWebJob extends models['ProxyOnlyResource'] { }, detailedStatus: { required: false, - serializedName: 'properties.detailedStatus', + serializedName: 'properties.detailed_status', type: { name: 'String' } }, logUrl: { required: false, - serializedName: 'properties.logUrl', - type: { - name: 'String' - } - }, - continuousWebJobName: { - required: false, - readOnly: true, - serializedName: 'properties.name', + serializedName: 'properties.log_url', type: { name: 'String' } }, runCommand: { required: false, - serializedName: 'properties.runCommand', + serializedName: 'properties.run_command', type: { name: 'String' } @@ -130,14 +120,14 @@ class ContinuousWebJob extends models['ProxyOnlyResource'] { }, extraInfoUrl: { required: false, - serializedName: 'properties.extraInfoUrl', + serializedName: 'properties.extra_info_url', type: { name: 'String' } }, - jobType: { + webJobType: { required: false, - serializedName: 'properties.jobType', + serializedName: 'properties.web_job_type', type: { name: 'Enum', allowedValues: [ 'Continuous', 'Triggered' ] @@ -152,7 +142,7 @@ class ContinuousWebJob extends models['ProxyOnlyResource'] { }, usingSdk: { required: false, - serializedName: 'properties.usingSdk', + serializedName: 'properties.using_sdk', type: { name: 'Boolean' } diff --git a/lib/services/websiteManagement2/lib/models/continuousWebJobCollection.js b/lib/services/websiteManagement2/lib/models/continuousWebJobCollection.js index 99a440181a..5d82a581b7 100644 --- a/lib/services/websiteManagement2/lib/models/continuousWebJobCollection.js +++ b/lib/services/websiteManagement2/lib/models/continuousWebJobCollection.js @@ -53,6 +53,7 @@ class ContinuousWebJobCollection extends Array { }, nextLink: { required: false, + readOnly: true, serializedName: 'nextLink', type: { name: 'String' diff --git a/lib/services/websiteManagement2/lib/models/csmOperationDescription.js b/lib/services/websiteManagement2/lib/models/csmOperationDescription.js index 9375a0b953..a1d904e61f 100644 --- a/lib/services/websiteManagement2/lib/models/csmOperationDescription.js +++ b/lib/services/websiteManagement2/lib/models/csmOperationDescription.js @@ -29,6 +29,7 @@ class CsmOperationDescription { * @member {object} [properties] * @member {object} [properties.serviceSpecification] * @member {array} [properties.serviceSpecification.metricSpecifications] + * @member {array} [properties.serviceSpecification.logSpecifications] */ constructor() { } diff --git a/lib/services/websiteManagement2/lib/models/csmOperationDescriptionProperties.js b/lib/services/websiteManagement2/lib/models/csmOperationDescriptionProperties.js index 77631076bc..bf869cb952 100644 --- a/lib/services/websiteManagement2/lib/models/csmOperationDescriptionProperties.js +++ b/lib/services/websiteManagement2/lib/models/csmOperationDescriptionProperties.js @@ -21,6 +21,7 @@ class CsmOperationDescriptionProperties { * Create a CsmOperationDescriptionProperties. * @member {object} [serviceSpecification] * @member {array} [serviceSpecification.metricSpecifications] + * @member {array} [serviceSpecification.logSpecifications] */ constructor() { } diff --git a/lib/services/websiteManagement2/lib/models/deletedAppRestoreRequest.js b/lib/services/websiteManagement2/lib/models/deletedAppRestoreRequest.js new file mode 100644 index 0000000000..715d8d3e51 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/deletedAppRestoreRequest.js @@ -0,0 +1,108 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Details about restoring a deleted app. + * + * @extends models['ProxyOnlyResource'] + */ +class DeletedAppRestoreRequest extends models['ProxyOnlyResource'] { + /** + * Create a DeletedAppRestoreRequest. + * @member {string} [deletedSiteId] ARM resource ID of the deleted app. + * Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * @member {boolean} [recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * @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. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedAppRestoreRequest + * + * @returns {object} metadata of DeletedAppRestoreRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedAppRestoreRequest', + type: { + name: 'Composite', + className: 'DeletedAppRestoreRequest', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + kind: { + required: false, + serializedName: 'kind', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + deletedSiteId: { + required: false, + serializedName: 'properties.deletedSiteId', + type: { + name: 'String' + } + }, + recoverConfiguration: { + required: false, + serializedName: 'properties.recoverConfiguration', + type: { + name: 'Boolean' + } + }, + snapshotTime: { + required: false, + serializedName: 'properties.snapshotTime', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DeletedAppRestoreRequest; diff --git a/lib/services/websiteManagement2/lib/models/deletedSite.js b/lib/services/websiteManagement2/lib/models/deletedSite.js index 265245476b..e076b9bc7a 100644 --- a/lib/services/websiteManagement2/lib/models/deletedSite.js +++ b/lib/services/websiteManagement2/lib/models/deletedSite.js @@ -17,12 +17,12 @@ class DeletedSite { /** * Create a DeletedSite. - * @member {number} [id] Numeric id for the deleted site + * @member {number} [deletedSiteId] Numeric id for the deleted site * @member {string} [deletedTimestamp] Time in UTC when the app was deleted. * @member {string} [subscription] Subscription containing the deleted site * @member {string} [resourceGroup] ResourceGroup that contained the deleted * site - * @member {string} [name] Name of the deleted site + * @member {string} [deletedSiteName] Name of the deleted site * @member {string} [slot] Slot of the deleted site */ constructor() { @@ -42,9 +42,10 @@ class DeletedSite { name: 'Composite', className: 'DeletedSite', modelProperties: { - id: { + deletedSiteId: { required: false, - serializedName: 'id', + readOnly: true, + serializedName: 'deletedSiteId', type: { name: 'Number' } @@ -73,10 +74,10 @@ class DeletedSite { name: 'String' } }, - name: { + deletedSiteName: { required: false, readOnly: true, - serializedName: 'name', + serializedName: 'deletedSiteName', type: { name: 'String' } diff --git a/lib/services/websiteManagement2/lib/models/deployment.js b/lib/services/websiteManagement2/lib/models/deployment.js index 052aab349d..f8fdc08349 100644 --- a/lib/services/websiteManagement2/lib/models/deployment.js +++ b/lib/services/websiteManagement2/lib/models/deployment.js @@ -20,7 +20,6 @@ const models = require('./index'); class Deployment extends models['ProxyOnlyResource'] { /** * Create a Deployment. - * @member {string} [deploymentId] Identifier for deployment. * @member {number} [status] Deployment status. * @member {string} [message] Details about deployment status. * @member {string} [author] Who authored the deployment. @@ -81,13 +80,6 @@ class Deployment extends models['ProxyOnlyResource'] { name: 'String' } }, - deploymentId: { - required: false, - serializedName: 'properties.id', - type: { - name: 'String' - } - }, status: { required: false, serializedName: 'properties.status', @@ -118,21 +110,21 @@ class Deployment extends models['ProxyOnlyResource'] { }, authorEmail: { required: false, - serializedName: 'properties.authorEmail', + serializedName: 'properties.author_email', type: { name: 'String' } }, startTime: { required: false, - serializedName: 'properties.startTime', + serializedName: 'properties.start_time', type: { name: 'DateTime' } }, endTime: { required: false, - serializedName: 'properties.endTime', + serializedName: 'properties.end_time', type: { name: 'DateTime' } diff --git a/lib/services/websiteManagement2/lib/models/diagnosticData.js b/lib/services/websiteManagement2/lib/models/diagnosticData.js index e583cf9598..f3b0662a2e 100644 --- a/lib/services/websiteManagement2/lib/models/diagnosticData.js +++ b/lib/services/websiteManagement2/lib/models/diagnosticData.js @@ -25,9 +25,8 @@ class DiagnosticData { * @member {array} [table.rows] Raw row values * @member {object} [renderingProperties] Properties that describe how the * table should be rendered - * @member {string} [renderingProperties.renderingType] Rendering Type. - * Possible values include: 'NoGraph', 'Table', 'TimeSeries', - * 'TimeSeriesPerInstance' + * @member {string} [renderingProperties.type] Rendering Type. Possible + * values include: 'NoGraph', 'Table', 'TimeSeries', 'TimeSeriesPerInstance' * @member {string} [renderingProperties.title] Title of data * @member {string} [renderingProperties.description] Description of the data * that will help it be interpreted diff --git a/lib/services/websiteManagement2/lib/models/functionEnvelope.js b/lib/services/websiteManagement2/lib/models/functionEnvelope.js index d7389e080d..de01948153 100644 --- a/lib/services/websiteManagement2/lib/models/functionEnvelope.js +++ b/lib/services/websiteManagement2/lib/models/functionEnvelope.js @@ -20,7 +20,6 @@ const models = require('./index'); class FunctionEnvelope extends models['ProxyOnlyResource'] { /** * Create a FunctionEnvelope. - * @member {string} [functionEnvelopeName] Function name. * @member {string} [functionAppId] Function App ID. * @member {string} [scriptRootPathHref] Script root path URI. * @member {string} [scriptHref] Script URI. @@ -81,46 +80,37 @@ class FunctionEnvelope extends models['ProxyOnlyResource'] { name: 'String' } }, - functionEnvelopeName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, functionAppId: { required: false, - readOnly: true, - serializedName: 'properties.functionAppId', + serializedName: 'properties.function_app_id', type: { name: 'String' } }, scriptRootPathHref: { required: false, - serializedName: 'properties.scriptRootPathHref', + serializedName: 'properties.script_root_path_href', type: { name: 'String' } }, scriptHref: { required: false, - serializedName: 'properties.scriptHref', + serializedName: 'properties.script_href', type: { name: 'String' } }, configHref: { required: false, - serializedName: 'properties.configHref', + serializedName: 'properties.config_href', type: { name: 'String' } }, secretsFileHref: { required: false, - serializedName: 'properties.secretsFileHref', + serializedName: 'properties.secrets_file_href', type: { name: 'String' } @@ -155,7 +145,7 @@ class FunctionEnvelope extends models['ProxyOnlyResource'] { }, testData: { required: false, - serializedName: 'properties.testData', + serializedName: 'properties.test_data', type: { name: 'String' } diff --git a/lib/services/websiteManagement2/lib/models/functionSecrets.js b/lib/services/websiteManagement2/lib/models/functionSecrets.js index 6c33bce188..89769cbd49 100644 --- a/lib/services/websiteManagement2/lib/models/functionSecrets.js +++ b/lib/services/websiteManagement2/lib/models/functionSecrets.js @@ -81,7 +81,7 @@ class FunctionSecrets extends models['ProxyOnlyResource'] { }, triggerUrl: { required: false, - serializedName: 'properties.triggerUrl', + serializedName: 'properties.trigger_url', type: { name: 'String' } diff --git a/lib/services/websiteManagement2/lib/models/geoRegion.js b/lib/services/websiteManagement2/lib/models/geoRegion.js index bf004ffc2e..6488f76da4 100644 --- a/lib/services/websiteManagement2/lib/models/geoRegion.js +++ b/lib/services/websiteManagement2/lib/models/geoRegion.js @@ -20,7 +20,6 @@ const models = require('./index'); class GeoRegion extends models['ProxyOnlyResource'] { /** * Create a GeoRegion. - * @member {string} [geoRegionName] Region name. * @member {string} [description] Region description. * @member {string} [displayName] Display name for region. */ @@ -73,14 +72,6 @@ class GeoRegion extends models['ProxyOnlyResource'] { name: 'String' } }, - geoRegionName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, description: { required: false, readOnly: true, diff --git a/lib/services/websiteManagement2/lib/models/index.d.ts b/lib/services/websiteManagement2/lib/models/index.d.ts index 1ad4b42f71..9687aabe5c 100644 --- a/lib/services/websiteManagement2/lib/models/index.d.ts +++ b/lib/services/websiteManagement2/lib/models/index.d.ts @@ -344,18 +344,18 @@ export interface CertificateEmail extends ProxyOnlyResource { * @constructor * Certificate order action. * - * @member {string} [certificateOrderActionType] Action type. Possible values - * include: 'CertificateIssued', 'CertificateOrderCanceled', - * 'CertificateOrderCreated', 'CertificateRevoked', 'DomainValidationComplete', - * 'FraudDetected', 'OrgNameChange', 'OrgValidationComplete', 'SanDrop', - * 'FraudCleared', 'CertificateExpired', 'CertificateExpirationWarning', + * @member {string} [actionType] Action type. Possible values include: + * 'CertificateIssued', 'CertificateOrderCanceled', 'CertificateOrderCreated', + * 'CertificateRevoked', 'DomainValidationComplete', 'FraudDetected', + * 'OrgNameChange', 'OrgValidationComplete', 'SanDrop', 'FraudCleared', + * 'CertificateExpired', 'CertificateExpirationWarning', * 'FraudDocumentationRequired', 'Unknown' * @member {date} [createdAt] Time at which the certificate action was * performed. */ export interface CertificateOrderAction extends ProxyOnlyResource { - certificateOrderActionType?: string; - createdAt?: Date; + readonly actionType?: string; + readonly createdAt?: Date; } /** @@ -429,8 +429,6 @@ export interface SiteSealRequest { * Virtual Network route contract used to pass routing information for a * Virtual Network. * - * @member {string} [vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. * @member {string} [startAddress] The starting address for this route. This * may also include a CIDR notation, in which case the end address must not be * specified. @@ -446,7 +444,6 @@ export interface SiteSealRequest { * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' */ export interface VnetRoute extends ProxyOnlyResource { - vnetRouteName?: string; startAddress?: string; endAddress?: string; routeType?: string; @@ -501,71 +498,31 @@ export interface VnetGateway extends ProxyOnlyResource { * @constructor * User crendentials used for publishing activity. * - * @member {string} [userName] Username * @member {string} publishingUserName Username used for publishing. * @member {string} [publishingPassword] Password used for publishing. * @member {string} [publishingPasswordHash] Password hash used for publishing. * @member {string} [publishingPasswordHashSalt] Password hash salt used for * publishing. + * @member {string} [scmUri] Url of SCM site. */ export interface User extends ProxyOnlyResource { - userName?: string; publishingUserName: string; publishingPassword?: string; publishingPasswordHash?: string; publishingPasswordHashSalt?: string; + scmUri?: string; } /** * @class - * Initializes a new instance of the SnapshotRecoveryTarget class. - * @constructor - * Specifies the web app that snapshot contents will be written to. - * - * @member {string} [location] Geographical location of the target web app, - * e.g. SouthEastAsia, SouthCentralUS - * @member {string} [id] ARM resource ID of the target 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. - */ -export interface SnapshotRecoveryTarget { - location?: string; - id?: string; -} - -/** - * @class - * Initializes a new instance of the SnapshotRecoveryRequest class. + * Initializes a new instance of the Snapshot class. * @constructor - * Details about app recovery operation. + * A snapshot of an app. * - * @member {string} [snapshotTime] Point in time in which the app recovery - * should be attempted, formatted as a DateTime string. - * @member {object} [recoveryTarget] Specifies the web app that snapshot - * contents will be written to. - * @member {string} [recoveryTarget.location] Geographical location of the - * target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [recoveryTarget.id] ARM resource ID of the target 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. - * @member {boolean} overwrite If true the recovery operation can - * overwrite source app; otherwise, false. - * @member {boolean} [recoverConfiguration] If true, site configuration, in - * addition to content, will be reverted. - * @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 {string} [time] The time the snapshot was taken. */ -export interface SnapshotRecoveryRequest extends ProxyOnlyResource { - snapshotTime?: string; - recoveryTarget?: SnapshotRecoveryTarget; - overwrite: boolean; - recoverConfiguration?: boolean; - ignoreConflictingHostNames?: boolean; +export interface Snapshot extends ProxyOnlyResource { + readonly time?: string; } /** @@ -582,45 +539,24 @@ export interface ResourceMetricAvailability { readonly retention?: string; } -/** - * @class - * Initializes a new instance of the ResourceMetricName class. - * @constructor - * Name of a metric for any resource . - * - * @member {string} [value] metric name value. - * @member {string} [localizedValue] Localized metric name value. - */ -export interface ResourceMetricName { - readonly value?: string; - readonly localizedValue?: string; -} - /** * @class * Initializes a new instance of the ResourceMetricDefinition class. * @constructor * Metadata for the metrics. * - * @member {object} [resourceMetricDefinitionName] Name of the metric. - * @member {string} [resourceMetricDefinitionName.value] metric name value. - * @member {string} [resourceMetricDefinitionName.localizedValue] Localized - * metric name value. * @member {string} [unit] Unit of the metric. * @member {string} [primaryAggregationType] Primary aggregation type. * @member {array} [metricAvailabilities] List of time grains supported for the * metric together with retention period. * @member {string} [resourceUri] Resource URI. - * @member {string} [resourceMetricDefinitionId] Resource ID. * @member {object} [properties] Resource metric definition properties. */ export interface ResourceMetricDefinition extends ProxyOnlyResource { - readonly resourceMetricDefinitionName?: ResourceMetricName; readonly unit?: string; readonly primaryAggregationType?: string; readonly metricAvailabilities?: ResourceMetricAvailability[]; readonly resourceUri?: string; - readonly resourceMetricDefinitionId?: string; readonly properties?: { [propertyName: string]: string }; } @@ -716,14 +652,17 @@ export interface HybridConnection extends ProxyOnlyResource { * Managed service identity. * * @member {string} [type] Type of managed service identity. Possible values - * include: 'SystemAssigned' + * include: 'SystemAssigned', 'UserAssigned' * @member {string} [tenantId] Tenant of managed service identity. * @member {string} [principalId] Principal Id of managed service identity. + * @member {array} [identityIds] Array of UserAssigned managed service + * identities. */ export interface ManagedServiceIdentity { type?: string; readonly tenantId?: string; readonly principalId?: string; + identityIds?: string[]; } /** @@ -780,8 +719,6 @@ export interface SlotSwapStatus { * @member {string} [trafficManagerProfileName] Name of Traffic Manager profile * to create. This is only needed if Traffic Manager profile does not already * exist. - * @member {boolean} [ignoreQuotas] true if quotas should be - * ignored; otherwise, false. */ export interface CloningInfo { correlationId?: string; @@ -794,7 +731,6 @@ export interface CloningInfo { configureLoadBalancing?: boolean; trafficManagerProfileId?: string; trafficManagerProfileName?: string; - ignoreQuotas?: boolean; } /** @@ -820,12 +756,27 @@ export interface HostingEnvironmentProfile { * IP security restriction on an app. * * @member {string} ipAddress IP address the security restriction is valid for. + * It can be in form of pure ipv4 address (required SubnetMask property) or + * CIDR notation such as ipv4/mask (leading bit match). For CIDR, + * SubnetMask property must not be specified. * @member {string} [subnetMask] Subnet mask for the range of IP addresses the * restriction is valid for. + * @member {string} [action] Allow or Deny access for this IP range. + * @member {string} [tag] Defines what this IP filter will be used for. This is + * to support IP filtering on proxies. Possible values include: 'Default', + * 'XffProxy' + * @member {number} [priority] Priority of IP restriction rule. + * @member {string} [name] IP restriction rule name. + * @member {string} [description] IP restriction rule description. */ export interface IpSecurityRestriction { ipAddress: string; subnetMask?: string; + action?: string; + tag?: string; + priority?: number; + name?: string; + description?: string; } /** @@ -1187,6 +1138,7 @@ export interface NameValuePair { * @member {string} [pythonVersion] Version of Python. * @member {string} [nodeVersion] Version of Node.js. * @member {string} [linuxFxVersion] Linux App Framework and version + * @member {string} [windowsFxVersion] Xenon App Framework and version * @member {boolean} [requestTracingEnabled] true if request * tracing is enabled; otherwise, false. * @member {date} [requestTracingExpirationTime] Request tracing expiration @@ -1297,12 +1249,19 @@ export interface NameValuePair { * @member {string} [autoSwapSlotName] Auto-swap slot name. * @member {boolean} [localMySqlEnabled] true to enable local * MySQL; otherwise, false. Default value: false . + * @member {number} [managedServiceIdentityId] Managed Service Identity Id + * @member {number} [xManagedServiceIdentityId] Explicit Managed Service + * Identity Id * @member {array} [ipSecurityRestrictions] IP security restrictions. * @member {boolean} [http20Enabled] Http20Enabled: configures a web site to * allow clients to connect over http2.0. Default value: true . * @member {string} [minTlsVersion] MinTlsVersion: configures the minimum * version of TLS required for SSL requests. Possible values include: '1.0', * '1.1', '1.2' + * @member {string} [ftpsState] State of FTP / FTPS service. Possible values + * include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * @member {number} [reservedInstanceCount] Number of reserved instances. + * This setting only applies to the Consumption Plan */ export interface SiteConfig { numberOfWorkers?: number; @@ -1312,6 +1271,7 @@ export interface SiteConfig { pythonVersion?: string; nodeVersion?: string; linuxFxVersion?: string; + windowsFxVersion?: string; requestTracingEnabled?: boolean; requestTracingExpirationTime?: Date; remoteDebuggingEnabled?: boolean; @@ -1347,9 +1307,13 @@ export interface SiteConfig { apiDefinition?: ApiDefinitionInfo; autoSwapSlotName?: string; localMySqlEnabled?: boolean; + managedServiceIdentityId?: number; + xManagedServiceIdentityId?: number; ipSecurityRestrictions?: IpSecurityRestriction[]; http20Enabled?: boolean; minTlsVersion?: string; + ftpsState?: string; + reservedInstanceCount?: number; } /** @@ -1405,6 +1369,7 @@ export interface HostNameSslState { * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". * @member {boolean} [reserved] true if reserved; otherwise, * false. Default value: false . + * @member {boolean} [isXenon] Hyper-V sandbox. Default value: false . * @member {date} [lastModifiedTimeUtc] Last time the app was modified, in UTC. * Read-only. * @member {object} [siteConfig] Configuration of the app. @@ -1415,6 +1380,8 @@ export interface HostNameSslState { * @member {string} [siteConfig.pythonVersion] Version of Python. * @member {string} [siteConfig.nodeVersion] Version of Node.js. * @member {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * @member {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version * @member {boolean} [siteConfig.requestTracingEnabled] true if * request tracing is enabled; otherwise, false. * @member {date} [siteConfig.requestTracingExpirationTime] Request tracing @@ -1536,6 +1503,10 @@ export interface HostNameSslState { * @member {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. * @member {boolean} [siteConfig.localMySqlEnabled] true to enable * local MySQL; otherwise, false. + * @member {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * @member {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id * @member {array} [siteConfig.ipSecurityRestrictions] IP security * restrictions. * @member {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web @@ -1543,6 +1514,11 @@ export interface HostNameSslState { * @member {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the * minimum version of TLS required for SSL requests. Possible values include: * '1.0', '1.1', '1.2' + * @member {string} [siteConfig.ftpsState] State of FTP / FTPS service. + * Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * @member {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan * @member {array} [trafficManagerHostNames] Azure Traffic Manager hostnames * associated with the app. Read-only. * @member {boolean} [scmSiteAlsoStopped] true to stop SCM (KUDU) @@ -1613,29 +1589,6 @@ export interface HostNameSslState { * @member {string} [cloningInfo.trafficManagerProfileName] Name of Traffic * Manager profile to create. This is only needed if Traffic Manager profile * does not already exist. - * @member {boolean} [cloningInfo.ignoreQuotas] true if quotas - * should be ignored; otherwise, false. - * @member {object} [snapshotInfo] If specified during app creation, the app is - * created from a previous snapshot. - * @member {string} [snapshotInfo.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * @member {string} [snapshotInfo.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the - * target 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. - * @member {boolean} [snapshotInfo.overwrite] If true the recovery - * operation can overwrite source app; otherwise, false. - * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * @member {boolean} [snapshotInfo.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 {string} [resourceGroup] Name of the resource group the app belongs * to. Read-only. * @member {boolean} [isDefaultContainer] true if the app is a @@ -1654,10 +1607,12 @@ export interface HostNameSslState { * http requests * @member {object} [identity] * @member {string} [identity.type] Type of managed service identity. Possible - * values include: 'SystemAssigned' + * values include: 'SystemAssigned', 'UserAssigned' * @member {string} [identity.tenantId] Tenant of managed service identity. * @member {string} [identity.principalId] Principal Id of managed service * identity. + * @member {array} [identity.identityIds] Array of UserAssigned managed service + * identities. */ export interface Site extends Resource { readonly state?: string; @@ -1670,6 +1625,7 @@ export interface Site extends Resource { hostNameSslStates?: HostNameSslState[]; serverFarmId?: string; reserved?: boolean; + isXenon?: boolean; readonly lastModifiedTimeUtc?: Date; siteConfig?: SiteConfig; readonly trafficManagerHostNames?: string[]; @@ -1686,7 +1642,6 @@ export interface Site extends Resource { readonly suspendedTill?: Date; readonly maxNumberOfWorkers?: number; cloningInfo?: CloningInfo; - snapshotInfo?: SnapshotRecoveryRequest; readonly resourceGroup?: string; readonly isDefaultContainer?: boolean; readonly defaultHostName?: string; @@ -1776,7 +1731,6 @@ export interface SkuDescription { * @constructor * App Service plan. * - * @member {string} appServicePlanName Name for the App Service plan. * @member {string} [workerTierName] Target worker tier assigned to the App * Service plan. * @member {string} [status] App Service plan status. Possible values include: @@ -1804,9 +1758,13 @@ export interface SkuDescription { * spot instances. * @member {date} [spotExpirationTime] The time when the server farm expires. * Valid only if it is a spot server farm. + * @member {date} [freeOfferExpirationTime] The time when the server farm free + * offer expires. * @member {string} [resourceGroup] Resource group of the App Service plan. * @member {boolean} [reserved] If Linux app service plan true, * false otherwise. Default value: false . + * @member {boolean} [isXenon] If Hyper-V container app service plan + * true, false otherwise. Default value: false . * @member {number} [targetWorkerCount] Scaling worker count. * @member {number} [targetWorkerSizeId] Scaling worker size ID. * @member {string} [provisioningState] Provisioning state of the App Service @@ -1834,7 +1792,6 @@ export interface SkuDescription { * manager enabled? */ export interface AppServicePlan extends Resource { - appServicePlanName: string; workerTierName?: string; readonly status?: string; readonly subscription?: string; @@ -1846,14 +1803,78 @@ export interface AppServicePlan extends Resource { readonly numberOfSites?: number; isSpot?: boolean; spotExpirationTime?: Date; + freeOfferExpirationTime?: Date; readonly resourceGroup?: string; reserved?: boolean; + isXenon?: boolean; targetWorkerCount?: number; targetWorkerSizeId?: number; readonly provisioningState?: string; sku?: SkuDescription; } +/** + * @class + * Initializes a new instance of the DefaultErrorResponseErrorDetailsItem class. + * @constructor + * Detailed errors. + * + * @member {string} [code] Standardized string to programmatically identify the + * error. + * @member {string} [message] Detailed error description and debugging + * information. + * @member {string} [target] Detailed error description and debugging + * information. + */ +export interface DefaultErrorResponseErrorDetailsItem { + readonly code?: string; + readonly message?: string; + readonly target?: string; +} + +/** + * @class + * Initializes a new instance of the DefaultErrorResponseError class. + * @constructor + * Error model. + * + * @member {string} [code] Standardized string to programmatically identify the + * error. + * @member {string} [message] Detailed error description and debugging + * information. + * @member {string} [target] Detailed error description and debugging + * information. + * @member {array} [details] + * @member {string} [innererror] More information to debug error. + */ +export interface DefaultErrorResponseError { + readonly code?: string; + readonly message?: string; + readonly target?: string; + details?: DefaultErrorResponseErrorDetailsItem[]; + readonly innererror?: string; +} + +/** + * @class + * Initializes a new instance of the DefaultErrorResponse class. + * @constructor + * App Service error response. + * + * @member {object} [error] Error model. + * @member {string} [error.code] Standardized string to programmatically + * identify the error. + * @member {string} [error.message] Detailed error description and debugging + * information. + * @member {string} [error.target] Detailed error description and debugging + * information. + * @member {array} [error.details] + * @member {string} [error.innererror] More information to debug error. + */ +export interface DefaultErrorResponse { + readonly error?: DefaultErrorResponseError; +} + /** * @class * Initializes a new instance of the NameIdentifier class. @@ -1866,6 +1887,22 @@ export interface NameIdentifier { name?: string; } +/** + * @class + * Initializes a new instance of the LogSpecification class. + * @constructor + * Log Definition of a single resource metric. + * + * @member {string} [name] + * @member {string} [displayName] + * @member {string} [blobDuration] + */ +export interface LogSpecification { + name?: string; + displayName?: string; + blobDuration?: string; +} + /** * @class * Initializes a new instance of the MetricAvailability class. @@ -1947,9 +1984,11 @@ export interface MetricSpecification { * Resource metrics service provided by Microsoft.Insights resource provider. * * @member {array} [metricSpecifications] + * @member {array} [logSpecifications] */ export interface ServiceSpecification { metricSpecifications?: MetricSpecification[]; + logSpecifications?: LogSpecification[]; } /** @@ -1960,6 +1999,7 @@ export interface ServiceSpecification { * * @member {object} [serviceSpecification] * @member {array} [serviceSpecification.metricSpecifications] + * @member {array} [serviceSpecification.logSpecifications] */ export interface CsmOperationDescriptionProperties { serviceSpecification?: ServiceSpecification; @@ -1999,6 +2039,7 @@ export interface CsmOperationDisplay { * @member {object} [properties] * @member {object} [properties.serviceSpecification] * @member {array} [properties.serviceSpecification.metricSpecifications] + * @member {array} [properties.serviceSpecification.logSpecifications] */ export interface CsmOperationDescription { name?: string; @@ -2498,21 +2539,6 @@ export interface DomainRecommendationSearchParameters { maxDomainRecommendations?: number; } -/** - * @class - * Initializes a new instance of the ErrorResponse class. - * @constructor - * Error Response. - * - * @member {string} [code] Error code. - * @member {string} [message] Error message indicating why the operation - * failed. - */ -export interface ErrorResponse { - code?: string; - message?: string; -} - /** * @class * Initializes a new instance of the TldLegalAgreement class. @@ -2537,12 +2563,10 @@ export interface TldLegalAgreement { * @constructor * A top level domain object. * - * @member {string} [domainName] Name of the top level domain. * @member {boolean} [privacy] If true, then the top level domain * supports domain privacy; otherwise, false. */ export interface TopLevelDomain extends ProxyOnlyResource { - readonly domainName?: string; privacy?: boolean; } @@ -2600,7 +2624,6 @@ export interface TopLevelDomainAgreementOption { * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', * 'Unknown' - * @member {string} [geoRegion] Region of the certificate. * @member {string} [serverFarmId] Resource ID of the associated App Service * plan, formatted as: * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". @@ -2624,7 +2647,6 @@ export interface Certificate extends Resource { keyVaultId?: string; keyVaultSecretName?: string; readonly keyVaultSecretStatus?: string; - readonly geoRegion?: string; serverFarmId?: string; } @@ -2664,7 +2686,6 @@ export interface Certificate extends Resource { * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', * 'Unknown' - * @member {string} [geoRegion] Region of the certificate. * @member {string} [serverFarmId] Resource ID of the associated App Service * plan, formatted as: * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". @@ -2688,7 +2709,6 @@ export interface CertificatePatchResource extends ProxyOnlyResource { keyVaultId?: string; keyVaultSecretName?: string; readonly keyVaultSecretStatus?: string; - readonly geoRegion?: string; serverFarmId?: string; } @@ -2766,7 +2786,7 @@ export interface VirtualIPMapping { * @member {string} [computeMode] Shared/dedicated workers. Possible values * include: 'Shared', 'Dedicated', 'Dynamic' * @member {string} [workerSize] Size of the machines. Possible values include: - * 'Default', 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3' + * 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'Default' * @member {number} [workerSizeId] Size ID of machines: * 0 - Small * 1 - Medium @@ -2777,6 +2797,7 @@ export interface VirtualIPMapping { * @member {boolean} [isApplicableForAllComputeModes] true if * capacity is applicable for all apps; otherwise, false. * @member {string} [siteMode] Shared or Dedicated. + * @member {boolean} [isLinux] Is this a linux stamp capacity */ export interface StampCapacity { name?: string; @@ -2789,6 +2810,7 @@ export interface StampCapacity { excludeFromCapacityAllocation?: boolean; isApplicableForAllComputeModes?: boolean; siteMode?: string; + isLinux?: boolean; } /** @@ -2893,6 +2915,12 @@ export interface NetworkAccessControlEntry { * of the App Service Environment. * @member {array} [userWhitelistedIpRanges] User added ip ranges to whitelist * on ASE db + * @member {boolean} [hasLinuxWorkers] Flag that displays whether an ASE has + * linux workers or not + * @member {string} [sslCertKeyVaultId] Key Vault ID for ILB App Service + * Environment default SSL certificate + * @member {string} [sslCertKeyVaultSecretName] Key Vault Secret Name for ILB + * App Service Environment default SSL certificate */ export interface AppServiceEnvironment { name: string; @@ -2931,6 +2959,9 @@ export interface AppServiceEnvironment { dynamicCacheEnabled?: boolean; clusterSettings?: NameValuePair[]; userWhitelistedIpRanges?: string[]; + hasLinuxWorkers?: boolean; + sslCertKeyVaultId?: string; + sslCertKeyVaultSecretName?: string; } /** @@ -2969,6 +3000,29 @@ export interface CsmUsageQuota { name?: LocalizableString; } +/** + * @class + * Initializes a new instance of the DeletedSite class. + * @constructor + * A deleted app. + * + * @member {number} [deletedSiteId] Numeric id for the deleted site + * @member {string} [deletedTimestamp] Time in UTC when the app was deleted. + * @member {string} [subscription] Subscription containing the deleted site + * @member {string} [resourceGroup] ResourceGroup that contained the deleted + * site + * @member {string} [deletedSiteName] Name of the deleted site + * @member {string} [slot] Slot of the deleted site + */ +export interface DeletedSite { + readonly deletedSiteId?: number; + readonly deletedTimestamp?: string; + readonly subscription?: string; + readonly resourceGroup?: string; + readonly deletedSiteName?: string; + readonly slot?: string; +} + /** * @class * Initializes a new instance of the ErrorEntity class. @@ -2991,68 +3045,6 @@ export interface ErrorEntity { message?: string; } -/** - * @class - * Initializes a new instance of the DefaultErrorResponseErrorDetailsItem class. - * @constructor - * Detailed errors. - * - * @member {string} [code] Standardized string to programmatically identify the - * error. - * @member {string} [message] Detailed error description and debugging - * information. - * @member {string} [target] Detailed error description and debugging - * information. - */ -export interface DefaultErrorResponseErrorDetailsItem { - readonly code?: string; - readonly message?: string; - readonly target?: string; -} - -/** - * @class - * Initializes a new instance of the DefaultErrorResponseError class. - * @constructor - * Error model. - * - * @member {string} [code] Standardized string to programmatically identify the - * error. - * @member {string} [message] Detailed error description and debugging - * information. - * @member {string} [target] Detailed error description and debugging - * information. - * @member {array} [details] - * @member {string} [innererror] More information to debug error. - */ -export interface DefaultErrorResponseError { - readonly code?: string; - readonly message?: string; - readonly target?: string; - details?: DefaultErrorResponseErrorDetailsItem[]; - readonly innererror?: string; -} - -/** - * @class - * Initializes a new instance of the DefaultErrorResponse class. - * @constructor - * App Service error response. - * - * @member {object} [error] Error model. - * @member {string} [error.code] Standardized string to programmatically - * identify the error. - * @member {string} [error.message] Detailed error description and debugging - * information. - * @member {string} [error.target] Detailed error description and debugging - * information. - * @member {array} [error.details] - * @member {string} [error.innererror] More information to debug error. - */ -export interface DefaultErrorResponse { - readonly error?: DefaultErrorResponseError; -} - /** * @class * Initializes a new instance of the Operation class. @@ -3081,6 +3073,20 @@ export interface Operation { geoMasterOperationId?: string; } +/** + * @class + * Initializes a new instance of the ResourceMetricName class. + * @constructor + * Name of a metric for any resource . + * + * @member {string} [value] metric name value. + * @member {string} [localizedValue] Localized metric name value. + */ +export interface ResourceMetricName { + readonly value?: string; + readonly localizedValue?: string; +} + /** * @class * Initializes a new instance of the ResourceMetricProperty class. @@ -3149,29 +3155,6 @@ export interface ResourceMetric { readonly properties?: ResourceMetricProperty[]; } -/** - * @class - * Initializes a new instance of the DeletedSite class. - * @constructor - * A deleted app. - * - * @member {number} [id] Numeric id for the deleted site - * @member {string} [deletedTimestamp] Time in UTC when the app was deleted. - * @member {string} [subscription] Subscription containing the deleted site - * @member {string} [resourceGroup] ResourceGroup that contained the deleted - * site - * @member {string} [name] Name of the deleted site - * @member {string} [slot] Slot of the deleted site - */ -export interface DeletedSite { - id?: number; - readonly deletedTimestamp?: string; - readonly subscription?: string; - readonly resourceGroup?: string; - readonly name?: string; - readonly slot?: string; -} - /** * @class * Initializes a new instance of the Solution class. @@ -3448,14 +3431,14 @@ export interface DetectorInfo { * @constructor * Instructions for rendering the data * - * @member {string} [renderingType] Rendering Type. Possible values include: - * 'NoGraph', 'Table', 'TimeSeries', 'TimeSeriesPerInstance' + * @member {string} [type] Rendering Type. Possible values include: 'NoGraph', + * 'Table', 'TimeSeries', 'TimeSeriesPerInstance' * @member {string} [title] Title of data * @member {string} [description] Description of the data that will help it be * interpreted */ export interface Rendering { - renderingType?: string; + type?: string; title?: string; description?: string; } @@ -3472,9 +3455,8 @@ export interface Rendering { * @member {array} [table.rows] Raw row values * @member {object} [renderingProperties] Properties that describe how the * table should be rendered - * @member {string} [renderingProperties.renderingType] Rendering Type. - * Possible values include: 'NoGraph', 'Table', 'TimeSeries', - * 'TimeSeriesPerInstance' + * @member {string} [renderingProperties.type] Rendering Type. Possible values + * include: 'NoGraph', 'Table', 'TimeSeries', 'TimeSeriesPerInstance' * @member {string} [renderingProperties.title] Title of data * @member {string} [renderingProperties.description] Description of the data * that will help it be interpreted @@ -3661,9 +3643,13 @@ export interface ApplicationStack { * @member {string} [channels] List of channels that this recommendation can * apply. Possible values include: 'Notification', 'Api', 'Email', 'Webhook', * 'All' - * @member {array} [tags] The list of category tags that this recommendation - * belongs to. + * @member {array} [categoryTags] The list of category tags that this + * recommendation belongs to. * @member {string} [actionName] Name of action recommended by this object. + * @member {number} [enabled] True if this recommendation is still valid (i.e. + * "actionable"). False if it is invalid. + * @member {array} [states] The list of states of this recommendation. If it's + * null then it shoud be considered "Active". * @member {date} [startTime] The beginning time in UTC of a range that the * recommendation refers to. * @member {date} [endTime] The end time in UTC of a range that the @@ -3693,8 +3679,10 @@ export interface Recommendation extends ProxyOnlyResource { message?: string; level?: string; channels?: string; - tags?: string[]; + readonly categoryTags?: string[]; actionName?: string; + enabled?: number; + states?: string[]; startTime?: Date; endTime?: Date; nextNotificationTime?: Date; @@ -3713,7 +3701,7 @@ export interface Recommendation extends ProxyOnlyResource { * @constructor * Represents a recommendation rule that the recommendation engine can perform. * - * @member {string} [recommendationRuleName] Unique name of the rule. + * @member {string} [recommendationName] Unique name of the rule. * @member {string} [displayName] UI friendly name of the rule. * @member {string} [message] Localized name of the rule (Good for UI). * @member {uuid} [recommendationId] Recommendation ID of an associated @@ -3728,7 +3716,8 @@ export interface Recommendation extends ProxyOnlyResource { * @member {string} [channels] List of available channels that this rule * applies. Possible values include: 'Notification', 'Api', 'Email', 'Webhook', * 'All' - * @member {array} [tags] An array of category tags that the rule contains. + * @member {array} [categoryTags] The list of category tags that this + * recommendation rule belongs to. * @member {boolean} [isDynamic] True if this is associated with a dynamically * added rule * @member {string} [extensionName] Extension name of the portal if exists. @@ -3739,7 +3728,7 @@ export interface Recommendation extends ProxyOnlyResource { * associated with the rule. Applicable to dynamic rule only. */ export interface RecommendationRule extends ProxyOnlyResource { - recommendationRuleName?: string; + recommendationName?: string; displayName?: string; message?: string; recommendationId?: string; @@ -3747,29 +3736,13 @@ export interface RecommendationRule extends ProxyOnlyResource { actionName?: string; level?: string; channels?: string; - tags?: string[]; + readonly categoryTags?: string[]; isDynamic?: boolean; extensionName?: string; bladeName?: string; forwardLink?: string; } -/** - * @class - * Initializes a new instance of the ResourceHealthMetadata class. - * @constructor - * Used for getting ResourceHealthCheck settings. - * - * @member {string} [category] The category that the resource matches in the - * RHC Policy File - * @member {boolean} [signalAvailability] Is there a health signal for the - * resource - */ -export interface ResourceHealthMetadata extends ProxyOnlyResource { - category?: string; - signalAvailability?: boolean; -} - /** * @class * Initializes a new instance of the BillingMeter class. @@ -3781,7 +3754,8 @@ export interface ResourceHealthMetadata extends ProxyOnlyResource { * @member {string} [billingLocation] Azure Location of billable resource * @member {string} [shortName] Short Name from App Service Azure pricing Page * @member {string} [friendlyName] Friendly name of the meter - * @member {string} [resourceType] App Service resource type meter used for + * @member {string} [resourceType] App Service ResourceType meter used for + * @member {string} [osType] App Service OS type meter used for */ export interface BillingMeter extends ProxyOnlyResource { meterId?: string; @@ -3789,6 +3763,7 @@ export interface BillingMeter extends ProxyOnlyResource { shortName?: string; friendlyName?: string; resourceType?: string; + osType?: string; } /** @@ -3812,12 +3787,10 @@ export interface CsmMoveResourceEnvelope { * @constructor * Geographical region. * - * @member {string} [geoRegionName] Region name. * @member {string} [description] Region description. * @member {string} [displayName] Display name for region. */ export interface GeoRegion extends ProxyOnlyResource { - readonly geoRegionName?: string; readonly description?: string; readonly displayName?: string; } @@ -3897,7 +3870,6 @@ export interface GlobalCsmSkuDescription { * @member {string} [sku] Premier add on SKU. * @member {string} [product] Premier add on offer Product. * @member {string} [vendor] Premier add on offer Vendor. - * @member {string} [premierAddOnOfferName] Premier add on offer Name. * @member {boolean} [promoCodeRequired] true if promotion code is * required; otherwise, false. * @member {number} [quota] Premier add on offer Quota. @@ -3913,7 +3885,6 @@ export interface PremierAddOnOffer extends ProxyOnlyResource { sku?: string; product?: string; vendor?: string; - premierAddOnOfferName?: string; promoCodeRequired?: boolean; quota?: number; webHostingPlanRestrictions?: string; @@ -3987,14 +3958,12 @@ export interface SkuInfos { * @constructor * The source control OAuth token. * - * @member {string} [sourceControlName] Name or source control type. * @member {string} [token] OAuth access token. * @member {string} [tokenSecret] OAuth access token secret. * @member {string} [refreshToken] OAuth refresh token. * @member {date} [expirationTime] OAuth token expiration. */ export interface SourceControl extends ProxyOnlyResource { - sourceControlName?: string; token?: string; tokenSecret?: string; refreshToken?: string; @@ -4022,6 +3991,8 @@ export interface SourceControl extends ProxyOnlyResource { * of VM's). * @member {string} [hostingEnvironment] Name of App Service Environment where * app or App Service plan should be created. + * @member {boolean} [isXenon] true if App Service plan is running + * as a windows container */ export interface ValidateRequest { name: string; @@ -4033,6 +4004,7 @@ export interface ValidateRequest { isSpot?: boolean; capacity?: number; hostingEnvironment?: string; + isXenon?: boolean; } /** @@ -4320,7 +4292,6 @@ export interface BackupSchedule { * @constructor * Description of a backup which will be performed. * - * @member {string} backupRequestName Name of the backup. * @member {boolean} [enabled] True if the backup schedule is enabled (must be * included in that case), false if the backup schedule should be disabled. * @member {string} storageAccountUrl SAS URL to the container. @@ -4343,16 +4314,12 @@ export interface BackupSchedule { * @member {date} [backupSchedule.lastExecutionTime] Last time when this * schedule was triggered. * @member {array} [databases] Databases included in the backup. - * @member {string} [backupRequestType] Type of the backup. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' */ export interface BackupRequest extends ProxyOnlyResource { - backupRequestName: string; enabled?: boolean; storageAccountUrl: string; backupSchedule?: BackupSchedule; databases?: DatabaseBackupSetting[]; - backupRequestType?: string; } /** @@ -4393,13 +4360,11 @@ export interface ConnectionStringDictionary extends ProxyOnlyResource { * 'Initializing', 'Starting', 'Running', 'PendingRestart', 'Stopped' * @member {string} [detailedStatus] Detailed status. * @member {string} [logUrl] Log URL. - * @member {string} [continuousWebJobName] Job name. Used as job identifier in - * ARM resource URI. * @member {string} [runCommand] Run command. * @member {string} [url] Job URL. * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] Job type. Possible values include: 'Continuous', - * 'Triggered' + * @member {string} [webJobType] Job type. Possible values include: + * 'Continuous', 'Triggered' * @member {string} [error] Error information. * @member {boolean} [usingSdk] Using SDK? * @member {object} [settings] Job settings. @@ -4408,11 +4373,10 @@ export interface ContinuousWebJob extends ProxyOnlyResource { status?: string; detailedStatus?: string; logUrl?: string; - readonly continuousWebJobName?: string; runCommand?: string; url?: string; extraInfoUrl?: string; - jobType?: string; + webJobType?: string; error?: string; usingSdk?: boolean; settings?: { [propertyName: string]: any }; @@ -4503,13 +4467,33 @@ export interface CustomHostnameAnalysisResult extends ProxyOnlyResource { alternateTxtRecords?: string[]; } +/** + * @class + * Initializes a new instance of the DeletedAppRestoreRequest class. + * @constructor + * Details about restoring a deleted app. + * + * @member {string} [deletedSiteId] ARM resource ID of the deleted app. + * Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * @member {boolean} [recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * @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. + */ +export interface DeletedAppRestoreRequest extends ProxyOnlyResource { + deletedSiteId?: string; + recoverConfiguration?: boolean; + snapshotTime?: string; +} + /** * @class * Initializes a new instance of the Deployment class. * @constructor * User crendentials used for publishing activity. * - * @member {string} [deploymentId] Identifier for deployment. * @member {number} [status] Deployment status. * @member {string} [message] Details about deployment status. * @member {string} [author] Who authored the deployment. @@ -4522,7 +4506,6 @@ export interface CustomHostnameAnalysisResult extends ProxyOnlyResource { * @member {string} [details] Details on deployment. */ export interface Deployment extends ProxyOnlyResource { - deploymentId?: string; status?: number; message?: string; author?: string; @@ -4575,7 +4558,6 @@ export interface FileSystemHttpLogsConfig { * @constructor * Web Job Information. * - * @member {string} [functionEnvelopeName] Function name. * @member {string} [functionAppId] Function App ID. * @member {string} [scriptRootPathHref] Script root path URI. * @member {string} [scriptHref] Script URI. @@ -4588,8 +4570,7 @@ export interface FileSystemHttpLogsConfig { * Portal. */ export interface FunctionEnvelope extends ProxyOnlyResource { - readonly functionEnvelopeName?: string; - readonly functionAppId?: string; + functionAppId?: string; scriptRootPathHref?: string; scriptHref?: string; configHref?: string; @@ -4867,13 +4848,11 @@ export interface NetworkFeatures extends ProxyOnlyResource { * @member {string} [instanceName] Name of the server on which the measurement * is made. * @member {number} [value] Value of counter at a certain time. - * @member {number} [coreCount] Core Count of worker. Not a data member */ export interface PerfMonSample { time?: Date; instanceName?: string; value?: number; - coreCount?: number; } /** @@ -4928,9 +4907,6 @@ export interface PerfMonResponse { * @member {string} [sku] Premier add on SKU. * @member {string} [product] Premier add on Product. * @member {string} [vendor] Premier add on Vendor. - * @member {string} [premierAddOnName] Premier add on Name. - * @member {string} [premierAddOnLocation] Premier add on Location. - * @member {object} [premierAddOnTags] Premier add on Tags. * @member {string} [marketplacePublisher] Premier add on Marketplace * publisher. * @member {string} [marketplaceOffer] Premier add on Marketplace offer. @@ -4939,20 +4915,88 @@ export interface PremierAddOn extends Resource { sku?: string; product?: string; vendor?: string; - premierAddOnName?: string; - premierAddOnLocation?: string; - premierAddOnTags?: { [propertyName: string]: string }; marketplacePublisher?: string; marketplaceOffer?: string; } +/** + * @class + * Initializes a new instance of the PremierAddOnPatchResource class. + * @constructor + * ARM resource for a PremierAddOn. + * + * @member {string} [sku] Premier add on SKU. + * @member {string} [product] Premier add on Product. + * @member {string} [vendor] Premier add on Vendor. + * @member {string} [marketplacePublisher] Premier add on Marketplace + * publisher. + * @member {string} [marketplaceOffer] Premier add on Marketplace offer. + */ +export interface PremierAddOnPatchResource extends ProxyOnlyResource { + sku?: string; + product?: string; + vendor?: string; + marketplacePublisher?: string; + marketplaceOffer?: string; +} + +/** + * @class + * Initializes a new instance of the PrivateAccessSubnet class. + * @constructor + * Description of a Virtual Network subnet that is useable for private site + * access. + * + * @member {string} [name] The name of the subnet. + * @member {number} [key] The key (ID) of the subnet. + */ +export interface PrivateAccessSubnet { + name?: string; + key?: number; +} + +/** + * @class + * Initializes a new instance of the PrivateAccessVirtualNetwork class. + * @constructor + * Description of a Virtual Network that is useable for private site access. + * + * @member {string} [name] The name of the Virtual Network. + * @member {number} [key] The key (ID) of the Virtual Network. + * @member {string} [resourceId] The ARM uri of the Virtual Network + * @member {array} [subnets] A List of subnets that access is allowed to on + * this Virtual Network. An empty array (but not null) is interpreted to mean + * that all subnets are allowed within this Virtual Network. + */ +export interface PrivateAccessVirtualNetwork { + name?: string; + key?: number; + resourceId?: string; + subnets?: PrivateAccessSubnet[]; +} + +/** + * @class + * Initializes a new instance of the PrivateAccess class. + * @constructor + * Description of the parameters of Private Access for a Web Site. + * + * @member {boolean} [enabled] Whether private access is enabled or not. + * @member {array} [virtualNetworks] The Virtual Networks (and subnets) allowed + * to access the site privately. + */ +export interface PrivateAccess extends ProxyOnlyResource { + enabled?: boolean; + virtualNetworks?: PrivateAccessVirtualNetwork[]; +} + /** * @class * Initializes a new instance of the ProcessThreadInfo class. * @constructor * Process Thread Information. * - * @member {number} [processThreadInfoId] ARM Identifier for deployment. + * @member {number} [identifier] Site extension ID. * @member {string} [href] HRef URI. * @member {string} [process] Process URI. * @member {string} [startAddress] Start address. @@ -4967,7 +5011,7 @@ export interface PremierAddOn extends Resource { * @member {string} [waitReason] Wait reason. */ export interface ProcessThreadInfo extends ProxyOnlyResource { - processThreadInfoId?: number; + readonly identifier?: number; href?: string; process?: string; startAddress?: string; @@ -5021,10 +5065,10 @@ export interface ProcessModuleInfo extends ProxyOnlyResource { * @constructor * Process Information. * - * @member {number} [processInfoId] ARM Identifier for deployment. - * @member {string} [processInfoName] Deployment name. + * @member {number} [identifier] ARM Identifier for deployment. + * @member {string} [deploymentName] Deployment name. * @member {string} [href] HRef URI. - * @member {string} [miniDump] Minidump URI. + * @member {string} [minidump] Minidump URI. * @member {boolean} [isProfileRunning] Is profile running? * @member {boolean} [isIisProfileRunning] Is the IIS Profile running? * @member {number} [iisProfileTimeoutInSeconds] IIS Profile timeout (seconds). @@ -5040,29 +5084,29 @@ export interface ProcessModuleInfo extends ProxyOnlyResource { * @member {number} [moduleCount] Module count. * @member {number} [threadCount] Thread count. * @member {date} [startTime] Start time. - * @member {string} [totalProcessorTime] Total CPU time. - * @member {string} [userProcessorTime] User CPU time. - * @member {string} [privilegedProcessorTime] Privileged CPU time. - * @member {number} [workingSet64] Working set. - * @member {number} [peakWorkingSet64] Peak working set. - * @member {number} [privateMemorySize64] Private memory size. - * @member {number} [virtualMemorySize64] Virtual memory size. - * @member {number} [peakVirtualMemorySize64] Peak virtual memory usage. - * @member {number} [pagedSystemMemorySize64] Paged system memory. - * @member {number} [nonpagedSystemMemorySize64] Non-paged system memory. - * @member {number} [pagedMemorySize64] Paged memory. - * @member {number} [peakPagedMemorySize64] Peak paged memory. + * @member {string} [totalCpuTime] Total CPU time. + * @member {string} [userCpuTime] User CPU time. + * @member {string} [privilegedCpuTime] Privileged CPU time. + * @member {number} [workingSet] Working set. + * @member {number} [peakWorkingSet] Peak working set. + * @member {number} [privateMemory] Private memory size. + * @member {number} [virtualMemory] Virtual memory size. + * @member {number} [peakVirtualMemory] Peak virtual memory usage. + * @member {number} [pagedSystemMemory] Paged system memory. + * @member {number} [nonPagedSystemMemory] Non-paged system memory. + * @member {number} [pagedMemory] Paged memory. + * @member {number} [peakPagedMemory] Peak paged memory. * @member {date} [timeStamp] Time stamp. * @member {object} [environmentVariables] List of environment variables. * @member {boolean} [isScmSite] Is this the SCM site? - * @member {boolean} [isWebJob] Is this a Web Job? + * @member {boolean} [isWebjob] Is this a Web Job? * @member {string} [description] Description of process. */ export interface ProcessInfo extends ProxyOnlyResource { - processInfoId?: number; - processInfoName?: string; + readonly identifier?: number; + deploymentName?: string; href?: string; - miniDump?: string; + minidump?: string; isProfileRunning?: boolean; isIisProfileRunning?: boolean; iisProfileTimeoutInSeconds?: number; @@ -5078,22 +5122,22 @@ export interface ProcessInfo extends ProxyOnlyResource { moduleCount?: number; threadCount?: number; startTime?: Date; - totalProcessorTime?: string; - userProcessorTime?: string; - privilegedProcessorTime?: string; - workingSet64?: number; - peakWorkingSet64?: number; - privateMemorySize64?: number; - virtualMemorySize64?: number; - peakVirtualMemorySize64?: number; - pagedSystemMemorySize64?: number; - nonpagedSystemMemorySize64?: number; - pagedMemorySize64?: number; - peakPagedMemorySize64?: number; + totalCpuTime?: string; + userCpuTime?: string; + privilegedCpuTime?: string; + workingSet?: number; + peakWorkingSet?: number; + privateMemory?: number; + virtualMemory?: number; + peakVirtualMemory?: number; + pagedSystemMemory?: number; + nonPagedSystemMemory?: number; + pagedMemory?: number; + peakPagedMemory?: number; timeStamp?: Date; environmentVariables?: { [propertyName: string]: string }; isScmSite?: boolean; - isWebJob?: boolean; + isWebjob?: boolean; description?: string; } @@ -5139,7 +5183,8 @@ export interface PublicCertificate extends ProxyOnlyResource { * @member {string} [appServicePlan] Specify app service plan that will own * restored site. * @member {string} [operationType] Operation type. Possible values include: - * 'Default', 'Clone', 'Relocation', 'Snapshot'. Default value: 'Default' . + * 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS'. Default value: + * 'Default' . * @member {boolean} [adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, * false. @@ -5160,19 +5205,6 @@ export interface RestoreRequest extends ProxyOnlyResource { hostingEnvironment?: string; } -/** - * @class - * Initializes a new instance of the RestoreResponse class. - * @constructor - * Response for an app restore request. - * - * @member {string} [operationId] When server starts the restore process, it - * will return an operation ID identifying that particular restore operation. - */ -export interface RestoreResponse extends ProxyOnlyResource { - readonly operationId?: string; -} - /** * @class * Initializes a new instance of the SiteAuthSettings class. @@ -5232,6 +5264,8 @@ export interface RestoreResponse extends ProxyOnlyResource { * This URI is a case-sensitive identifier for the token issuer. * More information on OpenID Connect Discovery: * http://openid.net/specs/openid-connect-discovery-1_0.html + * @member {boolean} [validateIssuer] Gets a value indicating whether the + * issuer should be a valid HTTPS url and be validated as such. * @member {array} [allowedAudiences] Allowed audience values to consider when * validating JWTs issued by * Azure Active Directory. Note that the ClientID value is always @@ -5307,6 +5341,7 @@ export interface SiteAuthSettings extends ProxyOnlyResource { clientId?: string; clientSecret?: string; issuer?: string; + validateIssuer?: boolean; allowedAudiences?: string[]; additionalLoginParams?: string[]; googleClientId?: string; @@ -5373,6 +5408,7 @@ export interface SiteCloneability { * @member {string} [pythonVersion] Version of Python. * @member {string} [nodeVersion] Version of Node.js. * @member {string} [linuxFxVersion] Linux App Framework and version + * @member {string} [windowsFxVersion] Xenon App Framework and version * @member {boolean} [requestTracingEnabled] true if request * tracing is enabled; otherwise, false. * @member {date} [requestTracingExpirationTime] Request tracing expiration @@ -5483,12 +5519,19 @@ export interface SiteCloneability { * @member {string} [autoSwapSlotName] Auto-swap slot name. * @member {boolean} [localMySqlEnabled] true to enable local * MySQL; otherwise, false. Default value: false . + * @member {number} [managedServiceIdentityId] Managed Service Identity Id + * @member {number} [xManagedServiceIdentityId] Explicit Managed Service + * Identity Id * @member {array} [ipSecurityRestrictions] IP security restrictions. * @member {boolean} [http20Enabled] Http20Enabled: configures a web site to * allow clients to connect over http2.0. Default value: true . * @member {string} [minTlsVersion] MinTlsVersion: configures the minimum * version of TLS required for SSL requests. Possible values include: '1.0', * '1.1', '1.2' + * @member {string} [ftpsState] State of FTP / FTPS service. Possible values + * include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * @member {number} [reservedInstanceCount] Number of reserved instances. + * This setting only applies to the Consumption Plan */ export interface SiteConfigResource extends ProxyOnlyResource { numberOfWorkers?: number; @@ -5498,6 +5541,7 @@ export interface SiteConfigResource extends ProxyOnlyResource { pythonVersion?: string; nodeVersion?: string; linuxFxVersion?: string; + windowsFxVersion?: string; requestTracingEnabled?: boolean; requestTracingExpirationTime?: Date; remoteDebuggingEnabled?: boolean; @@ -5533,9 +5577,13 @@ export interface SiteConfigResource extends ProxyOnlyResource { apiDefinition?: ApiDefinitionInfo; autoSwapSlotName?: string; localMySqlEnabled?: boolean; + managedServiceIdentityId?: number; + xManagedServiceIdentityId?: number; ipSecurityRestrictions?: IpSecurityRestriction[]; http20Enabled?: boolean; minTlsVersion?: string; + ftpsState?: string; + reservedInstanceCount?: number; } /** @@ -5545,11 +5593,11 @@ export interface SiteConfigResource extends ProxyOnlyResource { * A snapshot of a web app configuration. * * @member {date} [time] The time the snapshot was taken. - * @member {number} [siteConfigurationSnapshotInfoId] The id of the snapshot + * @member {number} [snapshotId] The id of the snapshot */ export interface SiteConfigurationSnapshotInfo extends ProxyOnlyResource { readonly time?: Date; - readonly siteConfigurationSnapshotInfoId?: number; + readonly snapshotId?: number; } /** @@ -5558,10 +5606,10 @@ export interface SiteConfigurationSnapshotInfo extends ProxyOnlyResource { * @constructor * Site Extension Information. * - * @member {string} [siteExtensionInfoId] Site extension ID. - * @member {string} [title] Site extension title. - * @member {string} [siteExtensionInfoType] Site extension type. Possible - * values include: 'Gallery', 'WebRoot' + * @member {string} [extensionId] Site extension ID. + * @member {string} [title] + * @member {string} [extensionType] Site extension type. Possible values + * include: 'Gallery', 'WebRoot' * @member {string} [summary] Summary description. * @member {string} [description] Detailed description. * @member {string} [version] Version information. @@ -5571,7 +5619,8 @@ export interface SiteConfigurationSnapshotInfo extends ProxyOnlyResource { * @member {string} [licenseUrl] License URL. * @member {string} [feedUrl] Feed URL. * @member {array} [authors] List of authors. - * @member {string} [installationArgs] Installer command line parameters. + * @member {string} [installerCommandLineParams] Installer command line + * parameters. * @member {date} [publishedDateTime] Published timestamp. * @member {number} [downloadCount] Count of downloads. * @member {boolean} [localIsLatestVersion] true if the local @@ -5582,9 +5631,9 @@ export interface SiteConfigurationSnapshotInfo extends ProxyOnlyResource { * @member {string} [comment] Site Extension comment. */ export interface SiteExtensionInfo extends ProxyOnlyResource { - siteExtensionInfoId?: string; + extensionId?: string; title?: string; - siteExtensionInfoType?: string; + extensionType?: string; summary?: string; description?: string; version?: string; @@ -5594,7 +5643,7 @@ export interface SiteExtensionInfo extends ProxyOnlyResource { licenseUrl?: string; feedUrl?: string; authors?: string[]; - installationArgs?: string; + installerCommandLineParams?: string; publishedDateTime?: Date; downloadCount?: number; localIsLatestVersion?: boolean; @@ -5708,6 +5757,7 @@ export interface SiteLogsConfig extends ProxyOnlyResource { * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". * @member {boolean} [reserved] true if reserved; otherwise, * false. Default value: false . + * @member {boolean} [isXenon] Hyper-V sandbox. Default value: false . * @member {date} [lastModifiedTimeUtc] Last time the app was modified, in UTC. * Read-only. * @member {object} [siteConfig] Configuration of the app. @@ -5718,6 +5768,8 @@ export interface SiteLogsConfig extends ProxyOnlyResource { * @member {string} [siteConfig.pythonVersion] Version of Python. * @member {string} [siteConfig.nodeVersion] Version of Node.js. * @member {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * @member {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version * @member {boolean} [siteConfig.requestTracingEnabled] true if * request tracing is enabled; otherwise, false. * @member {date} [siteConfig.requestTracingExpirationTime] Request tracing @@ -5839,6 +5891,10 @@ export interface SiteLogsConfig extends ProxyOnlyResource { * @member {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. * @member {boolean} [siteConfig.localMySqlEnabled] true to enable * local MySQL; otherwise, false. + * @member {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * @member {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id * @member {array} [siteConfig.ipSecurityRestrictions] IP security * restrictions. * @member {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web @@ -5846,6 +5902,11 @@ export interface SiteLogsConfig extends ProxyOnlyResource { * @member {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the * minimum version of TLS required for SSL requests. Possible values include: * '1.0', '1.1', '1.2' + * @member {string} [siteConfig.ftpsState] State of FTP / FTPS service. + * Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * @member {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan * @member {array} [trafficManagerHostNames] Azure Traffic Manager hostnames * associated with the app. Read-only. * @member {boolean} [scmSiteAlsoStopped] true to stop SCM (KUDU) @@ -5916,29 +5977,6 @@ export interface SiteLogsConfig extends ProxyOnlyResource { * @member {string} [cloningInfo.trafficManagerProfileName] Name of Traffic * Manager profile to create. This is only needed if Traffic Manager profile * does not already exist. - * @member {boolean} [cloningInfo.ignoreQuotas] true if quotas - * should be ignored; otherwise, false. - * @member {object} [snapshotInfo] If specified during app creation, the app is - * created from a previous snapshot. - * @member {string} [snapshotInfo.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * @member {string} [snapshotInfo.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the - * target 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. - * @member {boolean} [snapshotInfo.overwrite] If true the recovery - * operation can overwrite source app; otherwise, false. - * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * @member {boolean} [snapshotInfo.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 {string} [resourceGroup] Name of the resource group the app belongs * to. Read-only. * @member {boolean} [isDefaultContainer] true if the app is a @@ -5967,6 +6005,7 @@ export interface SitePatchResource extends ProxyOnlyResource { hostNameSslStates?: HostNameSslState[]; serverFarmId?: string; reserved?: boolean; + isXenon?: boolean; readonly lastModifiedTimeUtc?: Date; siteConfig?: SiteConfig; readonly trafficManagerHostNames?: string[]; @@ -5983,7 +6022,6 @@ export interface SitePatchResource extends ProxyOnlyResource { readonly suspendedTill?: Date; readonly maxNumberOfWorkers?: number; cloningInfo?: CloningInfo; - snapshotInfo?: SnapshotRecoveryRequest; readonly resourceGroup?: string; readonly isDefaultContainer?: boolean; readonly defaultHostName?: string; @@ -6054,8 +6092,8 @@ export interface SlotConfigNamesResource extends ProxyOnlyResource { * @constructor * A setting difference between two deployment slots of an app. * - * @member {string} [slotDifferenceType] Type of the difference: Information, - * Warning or Error. + * @member {string} [level] Level of the difference: Information, Warning or + * Error. * @member {string} [settingType] The type of the setting: General, AppSetting * or ConnectionString. * @member {string} [diffRule] Rule that describes how to process the setting @@ -6068,7 +6106,7 @@ export interface SlotConfigNamesResource extends ProxyOnlyResource { * @member {string} [description] Description of the setting difference. */ export interface SlotDifference extends ProxyOnlyResource { - readonly slotDifferenceType?: string; + readonly level?: string; readonly settingType?: string; readonly diffRule?: string; readonly settingName?: string; @@ -6079,14 +6117,55 @@ export interface SlotDifference extends ProxyOnlyResource { /** * @class - * Initializes a new instance of the Snapshot class. + * Initializes a new instance of the SnapshotRecoverySource class. * @constructor - * A snapshot of an app. + * Specifies the web app that snapshot contents will be retrieved from. * - * @member {string} [time] The time the snapshot was taken. + * @member {string} [location] Geographical location of the source web app, + * e.g. SouthEastAsia, SouthCentralUS + * @member {string} [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. */ -export interface Snapshot extends ProxyOnlyResource { - readonly time?: string; +export interface SnapshotRecoverySource { + location?: string; + id?: string; +} + +/** + * @class + * Initializes a new instance of the SnapshotRestoreRequest class. + * @constructor + * Details about app recovery operation. + * + * @member {string} [snapshotTime] Point in time in which the app restore + * should be done, formatted as a DateTime string. + * @member {object} [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. + * @member {string} [recoverySource.location] Geographical location of the + * source web app, e.g. SouthEastAsia, SouthCentralUS + * @member {string} [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. + * @member {boolean} overwrite If true the restore operation can + * overwrite source app; otherwise, false. + * @member {boolean} [recoverConfiguration] If true, site configuration, in + * addition to content, will be reverted. + * @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. + */ +export interface SnapshotRestoreRequest extends ProxyOnlyResource { + snapshotTime?: string; + recoverySource?: SnapshotRecoverySource; + overwrite: boolean; + recoverConfiguration?: boolean; + ignoreConflictingHostNames?: boolean; } /** @@ -6136,14 +6215,32 @@ export interface StringDictionary extends ProxyOnlyResource { properties?: { [propertyName: string]: string }; } +/** + * @class + * Initializes a new instance of the SwiftVirtualNetwork class. + * @constructor + * Swift Virtual Network Contract. This is used to enable the new Swift way of + * doing virtual network integration. + * + * @member {string} [subnetResourceId] The Virtual Network subnet's resource + * ID. This is the subnet that this Web App will join. This subnet must have a + * delegation to Microsoft.Web/serverFarms defined first. + * @member {boolean} [swiftSupported] A flag that specifies if the scale unit + * this Web App is on supports Swift integration. + */ +export interface SwiftVirtualNetwork extends ProxyOnlyResource { + subnetResourceId?: string; + swiftSupported?: boolean; +} + /** * @class * Initializes a new instance of the TriggeredJobRun class. * @constructor * Triggered Web Job Run Information. * - * @member {string} [triggeredJobRunId] Job ID. - * @member {string} [triggeredJobRunName] Job name. + * @member {string} [webJobId] Job ID. + * @member {string} [webJobName] Job name. * @member {string} [status] Job status. Possible values include: 'Success', * 'Failed', 'Error' * @member {date} [startTime] Start time. @@ -6156,8 +6253,8 @@ export interface StringDictionary extends ProxyOnlyResource { * @member {string} [trigger] Job trigger. */ export interface TriggeredJobRun extends ProxyOnlyResource { - triggeredJobRunId?: string; - readonly triggeredJobRunName?: string; + webJobId?: string; + webJobName?: string; status?: string; startTime?: Date; endTime?: Date; @@ -6176,10 +6273,10 @@ export interface TriggeredJobRun extends ProxyOnlyResource { * Triggered Web Job History. List of Triggered Web Job Run Information * elements. * - * @member {array} [triggeredJobRuns] List of triggered web job runs. + * @member {array} [runs] List of triggered web job runs. */ export interface TriggeredJobHistory extends ProxyOnlyResource { - triggeredJobRuns?: TriggeredJobRun[]; + runs?: TriggeredJobRun[]; } /** @@ -6189,8 +6286,8 @@ export interface TriggeredJobHistory extends ProxyOnlyResource { * Triggered Web Job Information. * * @member {object} [latestRun] Latest job run information. - * @member {string} [latestRun.triggeredJobRunId] Job ID. - * @member {string} [latestRun.triggeredJobRunName] Job name. + * @member {string} [latestRun.webJobId] Job ID. + * @member {string} [latestRun.webJobName] Job name. * @member {string} [latestRun.status] Job status. Possible values include: * 'Success', 'Failed', 'Error' * @member {date} [latestRun.startTime] Start time. @@ -6203,13 +6300,11 @@ export interface TriggeredJobHistory extends ProxyOnlyResource { * @member {string} [latestRun.trigger] Job trigger. * @member {string} [historyUrl] History URL. * @member {string} [schedulerLogsUrl] Scheduler Logs URL. - * @member {string} [triggeredWebJobName] Job name. Used as job identifier in - * ARM resource URI. * @member {string} [runCommand] Run command. * @member {string} [url] Job URL. * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] Job type. Possible values include: 'Continuous', - * 'Triggered' + * @member {string} [webJobType] Job type. Possible values include: + * 'Continuous', 'Triggered' * @member {string} [error] Error information. * @member {boolean} [usingSdk] Using SDK? * @member {object} [settings] Job settings. @@ -6218,11 +6313,10 @@ export interface TriggeredWebJob extends ProxyOnlyResource { latestRun?: TriggeredJobRun; historyUrl?: string; schedulerLogsUrl?: string; - readonly triggeredWebJobName?: string; runCommand?: string; url?: string; extraInfoUrl?: string; - jobType?: string; + webJobType?: string; error?: string; usingSdk?: boolean; settings?: { [propertyName: string]: any }; @@ -6234,23 +6328,20 @@ export interface TriggeredWebJob extends ProxyOnlyResource { * @constructor * Web Job Information. * - * @member {string} [webJobName] Job name. Used as job identifier in ARM - * resource URI. * @member {string} [runCommand] Run command. * @member {string} [url] Job URL. * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] Job type. Possible values include: 'Continuous', - * 'Triggered' + * @member {string} [webJobType] Job type. Possible values include: + * 'Continuous', 'Triggered' * @member {string} [error] Error information. * @member {boolean} [usingSdk] Using SDK? * @member {object} [settings] Job settings. */ export interface WebJob extends ProxyOnlyResource { - readonly webJobName?: string; runCommand?: string; url?: string; extraInfoUrl?: string; - jobType?: string; + webJobType?: string; error?: string; usingSdk?: boolean; settings?: { [propertyName: string]: any }; @@ -6360,6 +6451,12 @@ export interface AddressResponse { * of the App Service Environment. * @member {array} [userWhitelistedIpRanges] User added ip ranges to whitelist * on ASE db + * @member {boolean} [hasLinuxWorkers] Flag that displays whether an ASE has + * linux workers or not + * @member {string} [sslCertKeyVaultId] Key Vault ID for ILB App Service + * Environment default SSL certificate + * @member {string} [sslCertKeyVaultSecretName] Key Vault Secret Name for ILB + * App Service Environment default SSL certificate */ export interface AppServiceEnvironmentResource extends Resource { appServiceEnvironmentResourceName: string; @@ -6398,6 +6495,9 @@ export interface AppServiceEnvironmentResource extends Resource { dynamicCacheEnabled?: boolean; clusterSettings?: NameValuePair[]; userWhitelistedIpRanges?: string[]; + hasLinuxWorkers?: boolean; + sslCertKeyVaultId?: string; + sslCertKeyVaultSecretName?: string; } /** @@ -6484,6 +6584,12 @@ export interface AppServiceEnvironmentResource extends Resource { * of the App Service Environment. * @member {array} [userWhitelistedIpRanges] User added ip ranges to whitelist * on ASE db + * @member {boolean} [hasLinuxWorkers] Flag that displays whether an ASE has + * linux workers or not + * @member {string} [sslCertKeyVaultId] Key Vault ID for ILB App Service + * Environment default SSL certificate + * @member {string} [sslCertKeyVaultSecretName] Key Vault Secret Name for ILB + * App Service Environment default SSL certificate */ export interface AppServiceEnvironmentPatchResource extends ProxyOnlyResource { appServiceEnvironmentPatchResourceName: string; @@ -6522,6 +6628,9 @@ export interface AppServiceEnvironmentPatchResource extends ProxyOnlyResource { dynamicCacheEnabled?: boolean; clusterSettings?: NameValuePair[]; userWhitelistedIpRanges?: string[]; + hasLinuxWorkers?: boolean; + sslCertKeyVaultId?: string; + sslCertKeyVaultSecretName?: string; } /** @@ -6558,7 +6667,6 @@ export interface MetricAvailabilily { * @constructor * Metadata for a metric. * - * @member {string} [metricDefinitionName] Name of the metric. * @member {string} [unit] Unit of the metric. * @member {string} [primaryAggregationType] Primary aggregation type. * @member {array} [metricAvailabilities] List of time grains supported for the @@ -6566,7 +6674,6 @@ export interface MetricAvailabilily { * @member {string} [displayName] Friendly name shown in the UI. */ export interface MetricDefinition extends ProxyOnlyResource { - readonly metricDefinitionName?: string; readonly unit?: string; readonly primaryAggregationType?: string; readonly metricAvailabilities?: MetricAvailabilily[]; @@ -6623,7 +6730,6 @@ export interface SkuInfo { * Usage of the quota resource. * * @member {string} [displayName] Friendly name shown in the UI. - * @member {string} [usageName] Name of the quota. * @member {string} [resourceName] Name of the quota resource. * @member {string} [unit] Units of measurement for the quota resource. * @member {number} [currentValue] The current value of the resource counter. @@ -6635,7 +6741,6 @@ export interface SkuInfo { */ export interface Usage extends ProxyOnlyResource { readonly displayName?: string; - readonly usageName?: string; readonly resourceName?: string; readonly unit?: string; readonly currentValue?: number; @@ -6695,8 +6800,6 @@ export interface WorkerPoolResource extends ProxyOnlyResource { * @constructor * ARM resource for a app service plan. * - * @member {string} appServicePlanPatchResourceName Name for the App Service - * plan. * @member {string} [workerTierName] Target worker tier assigned to the App * Service plan. * @member {string} [status] App Service plan status. Possible values include: @@ -6724,9 +6827,13 @@ export interface WorkerPoolResource extends ProxyOnlyResource { * spot instances. * @member {date} [spotExpirationTime] The time when the server farm expires. * Valid only if it is a spot server farm. + * @member {date} [freeOfferExpirationTime] The time when the server farm free + * offer expires. * @member {string} [resourceGroup] Resource group of the App Service plan. * @member {boolean} [reserved] If Linux app service plan true, * false otherwise. Default value: false . + * @member {boolean} [isXenon] If Hyper-V container app service plan + * true, false otherwise. Default value: false . * @member {number} [targetWorkerCount] Scaling worker count. * @member {number} [targetWorkerSizeId] Scaling worker size ID. * @member {string} [provisioningState] Provisioning state of the App Service @@ -6734,7 +6841,6 @@ export interface WorkerPoolResource extends ProxyOnlyResource { * 'InProgress', 'Deleting' */ export interface AppServicePlanPatchResource extends ProxyOnlyResource { - appServicePlanPatchResourceName: string; workerTierName?: string; readonly status?: string; readonly subscription?: string; @@ -6746,8 +6852,10 @@ export interface AppServicePlanPatchResource extends ProxyOnlyResource { readonly numberOfSites?: number; isSpot?: boolean; spotExpirationTime?: Date; + freeOfferExpirationTime?: Date; readonly resourceGroup?: string; reserved?: boolean; + isXenon?: boolean; targetWorkerCount?: number; targetWorkerSizeId?: number; readonly provisioningState?: string; @@ -6963,25 +7071,25 @@ export interface RecommendationCollection extends Array { /** * @class - * Initializes a new instance of the ResourceHealthMetadataCollection class. + * Initializes a new instance of the SourceControlCollection class. * @constructor - * Collection of resource health metadata. + * Collection of source controls. * * @member {string} [nextLink] Link to next page of resources. */ -export interface ResourceHealthMetadataCollection extends Array { +export interface SourceControlCollection extends Array { readonly nextLink?: string; } /** * @class - * Initializes a new instance of the SourceControlCollection class. + * Initializes a new instance of the BillingMeterCollection class. * @constructor - * Collection of source controls. + * Collection of Billing Meters * * @member {string} [nextLink] Link to next page of resources. */ -export interface SourceControlCollection extends Array { +export interface BillingMeterCollection extends Array { readonly nextLink?: string; } @@ -7021,18 +7129,6 @@ export interface PremierAddOnOfferCollection extends Array { readonly nextLink?: string; } -/** - * @class - * Initializes a new instance of the BillingMeterCollection class. - * @constructor - * Collection of Billing Meters - * - * @member {string} [nextLink] Link to next page of resources. - */ -export interface BillingMeterCollection extends Array { - readonly nextLink?: string; -} - /** * @class * Initializes a new instance of the WebAppCollection class. @@ -7091,7 +7187,7 @@ export interface SiteConfigurationSnapshotInfoCollection extends Array { - nextLink?: string; + readonly nextLink?: string; } /** @@ -7380,7 +7476,7 @@ export interface UsageCollection extends Array { * @member {string} [nextLink] Link to next page of resources. */ export interface AppServicePlanCollection extends Array { - nextLink?: string; + readonly nextLink?: string; } /** diff --git a/lib/services/websiteManagement2/lib/models/index.js b/lib/services/websiteManagement2/lib/models/index.js index 2e4f391d06..af3e9c3c98 100644 --- a/lib/services/websiteManagement2/lib/models/index.js +++ b/lib/services/websiteManagement2/lib/models/index.js @@ -36,10 +36,8 @@ exports.VnetRoute = require('./vnetRoute'); exports.VnetInfo = require('./vnetInfo'); exports.VnetGateway = require('./vnetGateway'); exports.User = require('./user'); -exports.SnapshotRecoveryTarget = require('./snapshotRecoveryTarget'); -exports.SnapshotRecoveryRequest = require('./snapshotRecoveryRequest'); +exports.Snapshot = require('./snapshot'); exports.ResourceMetricAvailability = require('./resourceMetricAvailability'); -exports.ResourceMetricName = require('./resourceMetricName'); exports.ResourceMetricDefinition = require('./resourceMetricDefinition'); exports.PushSettings = require('./pushSettings'); exports.Identifier = require('./identifier'); @@ -75,7 +73,11 @@ exports.Capability = require('./capability'); exports.SkuCapacity = require('./skuCapacity'); exports.SkuDescription = require('./skuDescription'); exports.AppServicePlan = require('./appServicePlan'); +exports.DefaultErrorResponseErrorDetailsItem = require('./defaultErrorResponseErrorDetailsItem'); +exports.DefaultErrorResponseError = require('./defaultErrorResponseError'); +exports.DefaultErrorResponse = require('./defaultErrorResponse'); exports.NameIdentifier = require('./nameIdentifier'); +exports.LogSpecification = require('./logSpecification'); exports.MetricAvailability = require('./metricAvailability'); exports.Dimension = require('./dimension'); exports.MetricSpecification = require('./metricSpecification'); @@ -93,7 +95,6 @@ exports.DomainControlCenterSsoRequest = require('./domainControlCenterSsoRequest exports.DomainOwnershipIdentifier = require('./domainOwnershipIdentifier'); exports.DomainPatchResource = require('./domainPatchResource'); exports.DomainRecommendationSearchParameters = require('./domainRecommendationSearchParameters'); -exports.ErrorResponse = require('./errorResponse'); exports.TldLegalAgreement = require('./tldLegalAgreement'); exports.TopLevelDomain = require('./topLevelDomain'); exports.TopLevelDomainAgreementOption = require('./topLevelDomainAgreementOption'); @@ -107,15 +108,13 @@ exports.NetworkAccessControlEntry = require('./networkAccessControlEntry'); exports.AppServiceEnvironment = require('./appServiceEnvironment'); exports.LocalizableString = require('./localizableString'); exports.CsmUsageQuota = require('./csmUsageQuota'); +exports.DeletedSite = require('./deletedSite'); exports.ErrorEntity = require('./errorEntity'); -exports.DefaultErrorResponseErrorDetailsItem = require('./defaultErrorResponseErrorDetailsItem'); -exports.DefaultErrorResponseError = require('./defaultErrorResponseError'); -exports.DefaultErrorResponse = require('./defaultErrorResponse'); exports.Operation = require('./operation'); +exports.ResourceMetricName = require('./resourceMetricName'); exports.ResourceMetricProperty = require('./resourceMetricProperty'); exports.ResourceMetricValue = require('./resourceMetricValue'); exports.ResourceMetric = require('./resourceMetric'); -exports.DeletedSite = require('./deletedSite'); exports.Solution = require('./solution'); exports.DetectorAbnormalTimePeriod = require('./detectorAbnormalTimePeriod'); exports.AbnormalTimePeriod = require('./abnormalTimePeriod'); @@ -140,7 +139,6 @@ exports.StackMajorVersion = require('./stackMajorVersion'); exports.ApplicationStack = require('./applicationStack'); exports.Recommendation = require('./recommendation'); exports.RecommendationRule = require('./recommendationRule'); -exports.ResourceHealthMetadata = require('./resourceHealthMetadata'); exports.BillingMeter = require('./billingMeter'); exports.CsmMoveResourceEnvelope = require('./csmMoveResourceEnvelope'); exports.GeoRegion = require('./geoRegion'); @@ -173,6 +171,7 @@ exports.ContinuousWebJob = require('./continuousWebJob'); exports.CsmPublishingProfileOptions = require('./csmPublishingProfileOptions'); exports.CsmSlotEntity = require('./csmSlotEntity'); exports.CustomHostnameAnalysisResult = require('./customHostnameAnalysisResult'); +exports.DeletedAppRestoreRequest = require('./deletedAppRestoreRequest'); exports.Deployment = require('./deployment'); exports.EnabledConfig = require('./enabledConfig'); exports.FileSystemHttpLogsConfig = require('./fileSystemHttpLogsConfig'); @@ -192,12 +191,15 @@ exports.PerfMonSample = require('./perfMonSample'); exports.PerfMonSet = require('./perfMonSet'); exports.PerfMonResponse = require('./perfMonResponse'); exports.PremierAddOn = require('./premierAddOn'); +exports.PremierAddOnPatchResource = require('./premierAddOnPatchResource'); +exports.PrivateAccessSubnet = require('./privateAccessSubnet'); +exports.PrivateAccessVirtualNetwork = require('./privateAccessVirtualNetwork'); +exports.PrivateAccess = require('./privateAccess'); exports.ProcessThreadInfo = require('./processThreadInfo'); exports.ProcessModuleInfo = require('./processModuleInfo'); exports.ProcessInfo = require('./processInfo'); exports.PublicCertificate = require('./publicCertificate'); exports.RestoreRequest = require('./restoreRequest'); -exports.RestoreResponse = require('./restoreResponse'); exports.SiteAuthSettings = require('./siteAuthSettings'); exports.SiteCloneabilityCriterion = require('./siteCloneabilityCriterion'); exports.SiteCloneability = require('./siteCloneability'); @@ -211,10 +213,12 @@ exports.SitePhpErrorLogFlag = require('./sitePhpErrorLogFlag'); exports.SiteSourceControl = require('./siteSourceControl'); exports.SlotConfigNamesResource = require('./slotConfigNamesResource'); exports.SlotDifference = require('./slotDifference'); -exports.Snapshot = require('./snapshot'); +exports.SnapshotRecoverySource = require('./snapshotRecoverySource'); +exports.SnapshotRestoreRequest = require('./snapshotRestoreRequest'); exports.StorageMigrationOptions = require('./storageMigrationOptions'); exports.StorageMigrationResponse = require('./storageMigrationResponse'); exports.StringDictionary = require('./stringDictionary'); +exports.SwiftVirtualNetwork = require('./swiftVirtualNetwork'); exports.TriggeredJobRun = require('./triggeredJobRun'); exports.TriggeredJobHistory = require('./triggeredJobHistory'); exports.TriggeredWebJob = require('./triggeredWebJob'); @@ -246,12 +250,11 @@ exports.DiagnosticAnalysisCollection = require('./diagnosticAnalysisCollection') exports.DiagnosticDetectorCollection = require('./diagnosticDetectorCollection'); exports.ApplicationStackCollection = require('./applicationStackCollection'); exports.RecommendationCollection = require('./recommendationCollection'); -exports.ResourceHealthMetadataCollection = require('./resourceHealthMetadataCollection'); exports.SourceControlCollection = require('./sourceControlCollection'); +exports.BillingMeterCollection = require('./billingMeterCollection'); exports.GeoRegionCollection = require('./geoRegionCollection'); exports.IdentifierCollection = require('./identifierCollection'); exports.PremierAddOnOfferCollection = require('./premierAddOnOfferCollection'); -exports.BillingMeterCollection = require('./billingMeterCollection'); exports.WebAppCollection = require('./webAppCollection'); exports.BackupItemCollection = require('./backupItemCollection'); exports.SiteConfigResourceCollection = require('./siteConfigResourceCollection'); diff --git a/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js b/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js index c9589edfc8..7442dc0ebd 100644 --- a/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js +++ b/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js @@ -19,8 +19,18 @@ class IpSecurityRestriction { * Create a IpSecurityRestriction. * @member {string} ipAddress IP address the security restriction is valid * for. + * It can be in form of pure ipv4 address (required SubnetMask property) or + * CIDR notation such as ipv4/mask (leading bit match). For CIDR, + * SubnetMask property must not be specified. * @member {string} [subnetMask] Subnet mask for the range of IP addresses * the restriction is valid for. + * @member {string} [action] Allow or Deny access for this IP range. + * @member {string} [tag] Defines what this IP filter will be used for. This + * is to support IP filtering on proxies. Possible values include: 'Default', + * 'XffProxy' + * @member {number} [priority] Priority of IP restriction rule. + * @member {string} [name] IP restriction rule name. + * @member {string} [description] IP restriction rule description. */ constructor() { } @@ -52,6 +62,42 @@ class IpSecurityRestriction { type: { name: 'String' } + }, + action: { + required: false, + serializedName: 'action', + type: { + name: 'String' + } + }, + tag: { + required: false, + serializedName: 'tag', + type: { + name: 'Enum', + allowedValues: [ 'Default', 'XffProxy' ] + } + }, + priority: { + required: false, + serializedName: 'priority', + type: { + name: 'Number' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/logSpecification.js b/lib/services/websiteManagement2/lib/models/logSpecification.js new file mode 100644 index 0000000000..afeeeca8e1 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/logSpecification.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Log Definition of a single resource metric. + * + */ +class LogSpecification { + /** + * Create a LogSpecification. + * @member {string} [name] + * @member {string} [displayName] + * @member {string} [blobDuration] + */ + constructor() { + } + + /** + * Defines the metadata of LogSpecification + * + * @returns {object} metadata of LogSpecification + * + */ + mapper() { + return { + required: false, + serializedName: 'LogSpecification', + type: { + name: 'Composite', + className: 'LogSpecification', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + displayName: { + required: false, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + blobDuration: { + required: false, + serializedName: 'blobDuration', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LogSpecification; diff --git a/lib/services/websiteManagement2/lib/models/managedServiceIdentity.js b/lib/services/websiteManagement2/lib/models/managedServiceIdentity.js index 1b38e8c693..1729031497 100644 --- a/lib/services/websiteManagement2/lib/models/managedServiceIdentity.js +++ b/lib/services/websiteManagement2/lib/models/managedServiceIdentity.js @@ -18,9 +18,11 @@ class ManagedServiceIdentity { /** * Create a ManagedServiceIdentity. * @member {string} [type] Type of managed service identity. Possible values - * include: 'SystemAssigned' + * include: 'SystemAssigned', 'UserAssigned' * @member {string} [tenantId] Tenant of managed service identity. * @member {string} [principalId] Principal Id of managed service identity. + * @member {array} [identityIds] Array of UserAssigned managed service + * identities. */ constructor() { } @@ -61,6 +63,20 @@ class ManagedServiceIdentity { type: { name: 'String' } + }, + identityIds: { + required: false, + serializedName: 'identityIds', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } } } } diff --git a/lib/services/websiteManagement2/lib/models/metricDefinition.js b/lib/services/websiteManagement2/lib/models/metricDefinition.js index 7ef23aa4c1..e42fa83b2a 100644 --- a/lib/services/websiteManagement2/lib/models/metricDefinition.js +++ b/lib/services/websiteManagement2/lib/models/metricDefinition.js @@ -20,7 +20,6 @@ const models = require('./index'); class MetricDefinition extends models['ProxyOnlyResource'] { /** * Create a MetricDefinition. - * @member {string} [metricDefinitionName] Name of the metric. * @member {string} [unit] Unit of the metric. * @member {string} [primaryAggregationType] Primary aggregation type. * @member {array} [metricAvailabilities] List of time grains supported for @@ -76,14 +75,6 @@ class MetricDefinition extends models['ProxyOnlyResource'] { name: 'String' } }, - metricDefinitionName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, unit: { required: false, readOnly: true, diff --git a/lib/services/websiteManagement2/lib/models/perfMonSample.js b/lib/services/websiteManagement2/lib/models/perfMonSample.js index f7882a7d2e..e88148d9b9 100644 --- a/lib/services/websiteManagement2/lib/models/perfMonSample.js +++ b/lib/services/websiteManagement2/lib/models/perfMonSample.js @@ -21,7 +21,6 @@ class PerfMonSample { * @member {string} [instanceName] Name of the server on which the * measurement is made. * @member {number} [value] Value of counter at a certain time. - * @member {number} [coreCount] Core Count of worker. Not a data member */ constructor() { } @@ -60,13 +59,6 @@ class PerfMonSample { type: { name: 'Number' } - }, - coreCount: { - required: false, - serializedName: 'coreCount', - type: { - name: 'Number' - } } } } diff --git a/lib/services/websiteManagement2/lib/models/premierAddOn.js b/lib/services/websiteManagement2/lib/models/premierAddOn.js index ac3d6c9e2f..c0db87d43b 100644 --- a/lib/services/websiteManagement2/lib/models/premierAddOn.js +++ b/lib/services/websiteManagement2/lib/models/premierAddOn.js @@ -23,9 +23,6 @@ class PremierAddOn extends models['Resource'] { * @member {string} [sku] Premier add on SKU. * @member {string} [product] Premier add on Product. * @member {string} [vendor] Premier add on Vendor. - * @member {string} [premierAddOnName] Premier add on Name. - * @member {string} [premierAddOnLocation] Premier add on Location. - * @member {object} [premierAddOnTags] Premier add on Tags. * @member {string} [marketplacePublisher] Premier add on Marketplace * publisher. * @member {string} [marketplaceOffer] Premier add on Marketplace offer. @@ -121,34 +118,6 @@ class PremierAddOn extends models['Resource'] { name: 'String' } }, - premierAddOnName: { - required: false, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, - premierAddOnLocation: { - required: false, - serializedName: 'properties.location', - type: { - name: 'String' - } - }, - premierAddOnTags: { - required: false, - serializedName: 'properties.tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, marketplacePublisher: { required: false, serializedName: 'properties.marketplacePublisher', diff --git a/lib/services/websiteManagement2/lib/models/premierAddOnOffer.js b/lib/services/websiteManagement2/lib/models/premierAddOnOffer.js index 2252e8969a..919328a6d8 100644 --- a/lib/services/websiteManagement2/lib/models/premierAddOnOffer.js +++ b/lib/services/websiteManagement2/lib/models/premierAddOnOffer.js @@ -23,7 +23,6 @@ class PremierAddOnOffer extends models['ProxyOnlyResource'] { * @member {string} [sku] Premier add on SKU. * @member {string} [product] Premier add on offer Product. * @member {string} [vendor] Premier add on offer Vendor. - * @member {string} [premierAddOnOfferName] Premier add on offer Name. * @member {boolean} [promoCodeRequired] true if promotion code * is required; otherwise, false. * @member {number} [quota] Premier add on offer Quota. @@ -105,13 +104,6 @@ class PremierAddOnOffer extends models['ProxyOnlyResource'] { name: 'String' } }, - premierAddOnOfferName: { - required: false, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, promoCodeRequired: { required: false, serializedName: 'properties.promoCodeRequired', diff --git a/lib/services/websiteManagement2/lib/models/premierAddOnPatchResource.js b/lib/services/websiteManagement2/lib/models/premierAddOnPatchResource.js new file mode 100644 index 0000000000..9c9e00fe7f --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/premierAddOnPatchResource.js @@ -0,0 +1,120 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * ARM resource for a PremierAddOn. + * + * @extends models['ProxyOnlyResource'] + */ +class PremierAddOnPatchResource extends models['ProxyOnlyResource'] { + /** + * Create a PremierAddOnPatchResource. + * @member {string} [sku] Premier add on SKU. + * @member {string} [product] Premier add on Product. + * @member {string} [vendor] Premier add on Vendor. + * @member {string} [marketplacePublisher] Premier add on Marketplace + * publisher. + * @member {string} [marketplaceOffer] Premier add on Marketplace offer. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PremierAddOnPatchResource + * + * @returns {object} metadata of PremierAddOnPatchResource + * + */ + mapper() { + return { + required: false, + serializedName: 'PremierAddOnPatchResource', + type: { + name: 'Composite', + className: 'PremierAddOnPatchResource', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + kind: { + required: false, + serializedName: 'kind', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + sku: { + required: false, + serializedName: 'properties.sku', + type: { + name: 'String' + } + }, + product: { + required: false, + serializedName: 'properties.product', + type: { + name: 'String' + } + }, + vendor: { + required: false, + serializedName: 'properties.vendor', + type: { + name: 'String' + } + }, + marketplacePublisher: { + required: false, + serializedName: 'properties.marketplacePublisher', + type: { + name: 'String' + } + }, + marketplaceOffer: { + required: false, + serializedName: 'properties.marketplaceOffer', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PremierAddOnPatchResource; diff --git a/lib/services/websiteManagement2/lib/models/privateAccess.js b/lib/services/websiteManagement2/lib/models/privateAccess.js new file mode 100644 index 0000000000..b85b137319 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/privateAccess.js @@ -0,0 +1,104 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Description of the parameters of Private Access for a Web Site. + * + * @extends models['ProxyOnlyResource'] + */ +class PrivateAccess extends models['ProxyOnlyResource'] { + /** + * Create a PrivateAccess. + * @member {boolean} [enabled] Whether private access is enabled or not. + * @member {array} [virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PrivateAccess + * + * @returns {object} metadata of PrivateAccess + * + */ + mapper() { + return { + required: false, + serializedName: 'PrivateAccess', + type: { + name: 'Composite', + className: 'PrivateAccess', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + kind: { + required: false, + serializedName: 'kind', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + enabled: { + required: false, + serializedName: 'properties.enabled', + type: { + name: 'Boolean' + } + }, + virtualNetworks: { + required: false, + serializedName: 'properties.virtualNetworks', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PrivateAccessVirtualNetworkElementType', + type: { + name: 'Composite', + className: 'PrivateAccessVirtualNetwork' + } + } + } + } + } + } + }; + } +} + +module.exports = PrivateAccess; diff --git a/lib/services/websiteManagement2/lib/models/privateAccessSubnet.js b/lib/services/websiteManagement2/lib/models/privateAccessSubnet.js new file mode 100644 index 0000000000..8390dc0093 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/privateAccessSubnet.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Description of a Virtual Network subnet that is useable for private site + * access. + * + */ +class PrivateAccessSubnet { + /** + * Create a PrivateAccessSubnet. + * @member {string} [name] The name of the subnet. + * @member {number} [key] The key (ID) of the subnet. + */ + constructor() { + } + + /** + * Defines the metadata of PrivateAccessSubnet + * + * @returns {object} metadata of PrivateAccessSubnet + * + */ + mapper() { + return { + required: false, + serializedName: 'PrivateAccessSubnet', + type: { + name: 'Composite', + className: 'PrivateAccessSubnet', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + key: { + required: false, + serializedName: 'key', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = PrivateAccessSubnet; diff --git a/lib/services/websiteManagement2/lib/models/privateAccessVirtualNetwork.js b/lib/services/websiteManagement2/lib/models/privateAccessVirtualNetwork.js new file mode 100644 index 0000000000..635dd40054 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/privateAccessVirtualNetwork.js @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Description of a Virtual Network that is useable for private site access. + * + */ +class PrivateAccessVirtualNetwork { + /** + * Create a PrivateAccessVirtualNetwork. + * @member {string} [name] The name of the Virtual Network. + * @member {number} [key] The key (ID) of the Virtual Network. + * @member {string} [resourceId] The ARM uri of the Virtual Network + * @member {array} [subnets] A List of subnets that access is allowed to on + * this Virtual Network. An empty array (but not null) is interpreted to mean + * that all subnets are allowed within this Virtual Network. + */ + constructor() { + } + + /** + * Defines the metadata of PrivateAccessVirtualNetwork + * + * @returns {object} metadata of PrivateAccessVirtualNetwork + * + */ + mapper() { + return { + required: false, + serializedName: 'PrivateAccessVirtualNetwork', + type: { + name: 'Composite', + className: 'PrivateAccessVirtualNetwork', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + key: { + required: false, + serializedName: 'key', + type: { + name: 'Number' + } + }, + resourceId: { + required: false, + serializedName: 'resourceId', + type: { + name: 'String' + } + }, + subnets: { + required: false, + serializedName: 'subnets', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PrivateAccessSubnetElementType', + type: { + name: 'Composite', + className: 'PrivateAccessSubnet' + } + } + } + } + } + } + }; + } +} + +module.exports = PrivateAccessVirtualNetwork; diff --git a/lib/services/websiteManagement2/lib/models/processInfo.js b/lib/services/websiteManagement2/lib/models/processInfo.js index 094583fabf..1fc4d90c98 100644 --- a/lib/services/websiteManagement2/lib/models/processInfo.js +++ b/lib/services/websiteManagement2/lib/models/processInfo.js @@ -20,10 +20,10 @@ const models = require('./index'); class ProcessInfo extends models['ProxyOnlyResource'] { /** * Create a ProcessInfo. - * @member {number} [processInfoId] ARM Identifier for deployment. - * @member {string} [processInfoName] Deployment name. + * @member {number} [identifier] ARM Identifier for deployment. + * @member {string} [deploymentName] Deployment name. * @member {string} [href] HRef URI. - * @member {string} [miniDump] Minidump URI. + * @member {string} [minidump] Minidump URI. * @member {boolean} [isProfileRunning] Is profile running? * @member {boolean} [isIisProfileRunning] Is the IIS Profile running? * @member {number} [iisProfileTimeoutInSeconds] IIS Profile timeout @@ -40,22 +40,22 @@ class ProcessInfo extends models['ProxyOnlyResource'] { * @member {number} [moduleCount] Module count. * @member {number} [threadCount] Thread count. * @member {date} [startTime] Start time. - * @member {string} [totalProcessorTime] Total CPU time. - * @member {string} [userProcessorTime] User CPU time. - * @member {string} [privilegedProcessorTime] Privileged CPU time. - * @member {number} [workingSet64] Working set. - * @member {number} [peakWorkingSet64] Peak working set. - * @member {number} [privateMemorySize64] Private memory size. - * @member {number} [virtualMemorySize64] Virtual memory size. - * @member {number} [peakVirtualMemorySize64] Peak virtual memory usage. - * @member {number} [pagedSystemMemorySize64] Paged system memory. - * @member {number} [nonpagedSystemMemorySize64] Non-paged system memory. - * @member {number} [pagedMemorySize64] Paged memory. - * @member {number} [peakPagedMemorySize64] Peak paged memory. + * @member {string} [totalCpuTime] Total CPU time. + * @member {string} [userCpuTime] User CPU time. + * @member {string} [privilegedCpuTime] Privileged CPU time. + * @member {number} [workingSet] Working set. + * @member {number} [peakWorkingSet] Peak working set. + * @member {number} [privateMemory] Private memory size. + * @member {number} [virtualMemory] Virtual memory size. + * @member {number} [peakVirtualMemory] Peak virtual memory usage. + * @member {number} [pagedSystemMemory] Paged system memory. + * @member {number} [nonPagedSystemMemory] Non-paged system memory. + * @member {number} [pagedMemory] Paged memory. + * @member {number} [peakPagedMemory] Peak paged memory. * @member {date} [timeStamp] Time stamp. * @member {object} [environmentVariables] List of environment variables. * @member {boolean} [isScmSite] Is this the SCM site? - * @member {boolean} [isWebJob] Is this a Web Job? + * @member {boolean} [isWebjob] Is this a Web Job? * @member {string} [description] Description of process. */ constructor() { @@ -107,16 +107,17 @@ class ProcessInfo extends models['ProxyOnlyResource'] { name: 'String' } }, - processInfoId: { + identifier: { required: false, - serializedName: 'properties.id', + readOnly: true, + serializedName: 'properties.identifier', type: { name: 'Number' } }, - processInfoName: { + deploymentName: { required: false, - serializedName: 'properties.name', + serializedName: 'properties.deployment_name', type: { name: 'String' } @@ -128,30 +129,30 @@ class ProcessInfo extends models['ProxyOnlyResource'] { name: 'String' } }, - miniDump: { + minidump: { required: false, - serializedName: 'properties.miniDump', + serializedName: 'properties.minidump', type: { name: 'String' } }, isProfileRunning: { required: false, - serializedName: 'properties.isProfileRunning', + serializedName: 'properties.is_profile_running', type: { name: 'Boolean' } }, isIisProfileRunning: { required: false, - serializedName: 'properties.isIisProfileRunning', + serializedName: 'properties.is_iis_profile_running', type: { name: 'Boolean' } }, iisProfileTimeoutInSeconds: { required: false, - serializedName: 'properties.iisProfileTimeoutInSeconds', + serializedName: 'properties.iis_profile_timeout_in_seconds', type: { name: 'Number' } @@ -194,7 +195,7 @@ class ProcessInfo extends models['ProxyOnlyResource'] { }, openFileHandles: { required: false, - serializedName: 'properties.openFileHandles', + serializedName: 'properties.open_file_handles', type: { name: 'Sequence', element: { @@ -223,147 +224,147 @@ class ProcessInfo extends models['ProxyOnlyResource'] { }, fileName: { required: false, - serializedName: 'properties.fileName', + serializedName: 'properties.file_name', type: { name: 'String' } }, commandLine: { required: false, - serializedName: 'properties.commandLine', + serializedName: 'properties.command_line', type: { name: 'String' } }, userName: { required: false, - serializedName: 'properties.userName', + serializedName: 'properties.user_name', type: { name: 'String' } }, handleCount: { required: false, - serializedName: 'properties.handleCount', + serializedName: 'properties.handle_count', type: { name: 'Number' } }, moduleCount: { required: false, - serializedName: 'properties.moduleCount', + serializedName: 'properties.module_count', type: { name: 'Number' } }, threadCount: { required: false, - serializedName: 'properties.threadCount', + serializedName: 'properties.thread_count', type: { name: 'Number' } }, startTime: { required: false, - serializedName: 'properties.startTime', + serializedName: 'properties.start_time', type: { name: 'DateTime' } }, - totalProcessorTime: { + totalCpuTime: { required: false, - serializedName: 'properties.totalProcessorTime', + serializedName: 'properties.total_cpu_time', type: { name: 'String' } }, - userProcessorTime: { + userCpuTime: { required: false, - serializedName: 'properties.userProcessorTime', + serializedName: 'properties.user_cpu_time', type: { name: 'String' } }, - privilegedProcessorTime: { + privilegedCpuTime: { required: false, - serializedName: 'properties.privilegedProcessorTime', + serializedName: 'properties.privileged_cpu_time', type: { name: 'String' } }, - workingSet64: { + workingSet: { required: false, - serializedName: 'properties.workingSet64', + serializedName: 'properties.working_set', type: { name: 'Number' } }, - peakWorkingSet64: { + peakWorkingSet: { required: false, - serializedName: 'properties.peakWorkingSet64', + serializedName: 'properties.peak_working_set', type: { name: 'Number' } }, - privateMemorySize64: { + privateMemory: { required: false, - serializedName: 'properties.privateMemorySize64', + serializedName: 'properties.private_memory', type: { name: 'Number' } }, - virtualMemorySize64: { + virtualMemory: { required: false, - serializedName: 'properties.virtualMemorySize64', + serializedName: 'properties.virtual_memory', type: { name: 'Number' } }, - peakVirtualMemorySize64: { + peakVirtualMemory: { required: false, - serializedName: 'properties.peakVirtualMemorySize64', + serializedName: 'properties.peak_virtual_memory', type: { name: 'Number' } }, - pagedSystemMemorySize64: { + pagedSystemMemory: { required: false, - serializedName: 'properties.pagedSystemMemorySize64', + serializedName: 'properties.paged_system_memory', type: { name: 'Number' } }, - nonpagedSystemMemorySize64: { + nonPagedSystemMemory: { required: false, - serializedName: 'properties.nonpagedSystemMemorySize64', + serializedName: 'properties.non_paged_system_memory', type: { name: 'Number' } }, - pagedMemorySize64: { + pagedMemory: { required: false, - serializedName: 'properties.pagedMemorySize64', + serializedName: 'properties.paged_memory', type: { name: 'Number' } }, - peakPagedMemorySize64: { + peakPagedMemory: { required: false, - serializedName: 'properties.peakPagedMemorySize64', + serializedName: 'properties.peak_paged_memory', type: { name: 'Number' } }, timeStamp: { required: false, - serializedName: 'properties.timeStamp', + serializedName: 'properties.time_stamp', type: { name: 'DateTime' } }, environmentVariables: { required: false, - serializedName: 'properties.environmentVariables', + serializedName: 'properties.environment_variables', type: { name: 'Dictionary', value: { @@ -377,14 +378,14 @@ class ProcessInfo extends models['ProxyOnlyResource'] { }, isScmSite: { required: false, - serializedName: 'properties.isScmSite', + serializedName: 'properties.is_scm_site', type: { name: 'Boolean' } }, - isWebJob: { + isWebjob: { required: false, - serializedName: 'properties.isWebJob', + serializedName: 'properties.is_webjob', type: { name: 'Boolean' } diff --git a/lib/services/websiteManagement2/lib/models/processModuleInfo.js b/lib/services/websiteManagement2/lib/models/processModuleInfo.js index 54334a64cf..610d4bf843 100644 --- a/lib/services/websiteManagement2/lib/models/processModuleInfo.js +++ b/lib/services/websiteManagement2/lib/models/processModuleInfo.js @@ -84,14 +84,14 @@ class ProcessModuleInfo extends models['ProxyOnlyResource'] { }, baseAddress: { required: false, - serializedName: 'properties.baseAddress', + serializedName: 'properties.base_address', type: { name: 'String' } }, fileName: { required: false, - serializedName: 'properties.fileName', + serializedName: 'properties.file_name', type: { name: 'String' } @@ -105,28 +105,28 @@ class ProcessModuleInfo extends models['ProxyOnlyResource'] { }, filePath: { required: false, - serializedName: 'properties.filePath', + serializedName: 'properties.file_path', type: { name: 'String' } }, moduleMemorySize: { required: false, - serializedName: 'properties.moduleMemorySize', + serializedName: 'properties.module_memory_size', type: { name: 'Number' } }, fileVersion: { required: false, - serializedName: 'properties.fileVersion', + serializedName: 'properties.file_version', type: { name: 'String' } }, fileDescription: { required: false, - serializedName: 'properties.fileDescription', + serializedName: 'properties.file_description', type: { name: 'String' } @@ -140,14 +140,14 @@ class ProcessModuleInfo extends models['ProxyOnlyResource'] { }, productVersion: { required: false, - serializedName: 'properties.productVersion', + serializedName: 'properties.product_version', type: { name: 'String' } }, isDebug: { required: false, - serializedName: 'properties.isDebug', + serializedName: 'properties.is_debug', type: { name: 'Boolean' } diff --git a/lib/services/websiteManagement2/lib/models/processThreadInfo.js b/lib/services/websiteManagement2/lib/models/processThreadInfo.js index ec227556b0..3594604e66 100644 --- a/lib/services/websiteManagement2/lib/models/processThreadInfo.js +++ b/lib/services/websiteManagement2/lib/models/processThreadInfo.js @@ -20,7 +20,7 @@ const models = require('./index'); class ProcessThreadInfo extends models['ProxyOnlyResource'] { /** * Create a ProcessThreadInfo. - * @member {number} [processThreadInfoId] ARM Identifier for deployment. + * @member {number} [identifier] Site extension ID. * @member {string} [href] HRef URI. * @member {string} [process] Process URI. * @member {string} [startAddress] Start address. @@ -83,9 +83,10 @@ class ProcessThreadInfo extends models['ProxyOnlyResource'] { name: 'String' } }, - processThreadInfoId: { + identifier: { required: false, - serializedName: 'properties.id', + readOnly: true, + serializedName: 'properties.identifier', type: { name: 'Number' } @@ -106,56 +107,56 @@ class ProcessThreadInfo extends models['ProxyOnlyResource'] { }, startAddress: { required: false, - serializedName: 'properties.startAddress', + serializedName: 'properties.start_address', type: { name: 'String' } }, currentPriority: { required: false, - serializedName: 'properties.currentPriority', + serializedName: 'properties.current_priority', type: { name: 'Number' } }, priorityLevel: { required: false, - serializedName: 'properties.priorityLevel', + serializedName: 'properties.priority_level', type: { name: 'String' } }, basePriority: { required: false, - serializedName: 'properties.basePriority', + serializedName: 'properties.base_priority', type: { name: 'Number' } }, startTime: { required: false, - serializedName: 'properties.startTime', + serializedName: 'properties.start_time', type: { name: 'DateTime' } }, totalProcessorTime: { required: false, - serializedName: 'properties.totalProcessorTime', + serializedName: 'properties.total_processor_time', type: { name: 'String' } }, userProcessorTime: { required: false, - serializedName: 'properties.userProcessorTime', + serializedName: 'properties.user_processor_time', type: { name: 'String' } }, priviledgedProcessorTime: { required: false, - serializedName: 'properties.priviledgedProcessorTime', + serializedName: 'properties.priviledged_processor_time', type: { name: 'String' } @@ -169,7 +170,7 @@ class ProcessThreadInfo extends models['ProxyOnlyResource'] { }, waitReason: { required: false, - serializedName: 'properties.waitReason', + serializedName: 'properties.wait_reason', type: { name: 'String' } diff --git a/lib/services/websiteManagement2/lib/models/recommendation.js b/lib/services/websiteManagement2/lib/models/recommendation.js index 665993eaba..8f61433673 100644 --- a/lib/services/websiteManagement2/lib/models/recommendation.js +++ b/lib/services/websiteManagement2/lib/models/recommendation.js @@ -38,9 +38,13 @@ class Recommendation extends models['ProxyOnlyResource'] { * @member {string} [channels] List of channels that this recommendation can * apply. Possible values include: 'Notification', 'Api', 'Email', 'Webhook', * 'All' - * @member {array} [tags] The list of category tags that this recommendation - * belongs to. + * @member {array} [categoryTags] The list of category tags that this + * recommendation belongs to. * @member {string} [actionName] Name of action recommended by this object. + * @member {number} [enabled] True if this recommendation is still valid + * (i.e. "actionable"). False if it is invalid. + * @member {array} [states] The list of states of this recommendation. If + * it's null then it shoud be considered "Active". * @member {date} [startTime] The beginning time in UTC of a range that the * recommendation refers to. * @member {date} [endTime] The end time in UTC of a range that the @@ -174,9 +178,10 @@ class Recommendation extends models['ProxyOnlyResource'] { allowedValues: [ 'Notification', 'Api', 'Email', 'Webhook', 'All' ] } }, - tags: { + categoryTags: { required: false, - serializedName: 'properties.tags', + readOnly: true, + serializedName: 'properties.categoryTags', type: { name: 'Sequence', element: { @@ -195,6 +200,27 @@ class Recommendation extends models['ProxyOnlyResource'] { name: 'String' } }, + enabled: { + required: false, + serializedName: 'properties.enabled', + type: { + name: 'Number' + } + }, + states: { + required: false, + serializedName: 'properties.states', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, startTime: { required: false, serializedName: 'properties.startTime', diff --git a/lib/services/websiteManagement2/lib/models/recommendationRule.js b/lib/services/websiteManagement2/lib/models/recommendationRule.js index 6e35b0c290..98fedcaa74 100644 --- a/lib/services/websiteManagement2/lib/models/recommendationRule.js +++ b/lib/services/websiteManagement2/lib/models/recommendationRule.js @@ -20,7 +20,7 @@ const models = require('./index'); class RecommendationRule extends models['ProxyOnlyResource'] { /** * Create a RecommendationRule. - * @member {string} [recommendationRuleName] Unique name of the rule. + * @member {string} [recommendationName] Unique name of the rule. * @member {string} [displayName] UI friendly name of the rule. * @member {string} [message] Localized name of the rule (Good for UI). * @member {uuid} [recommendationId] Recommendation ID of an associated @@ -35,7 +35,8 @@ class RecommendationRule extends models['ProxyOnlyResource'] { * @member {string} [channels] List of available channels that this rule * applies. Possible values include: 'Notification', 'Api', 'Email', * 'Webhook', 'All' - * @member {array} [tags] An array of category tags that the rule contains. + * @member {array} [categoryTags] The list of category tags that this + * recommendation rule belongs to. * @member {boolean} [isDynamic] True if this is associated with a * dynamically added rule * @member {string} [extensionName] Extension name of the portal if exists. @@ -94,9 +95,9 @@ class RecommendationRule extends models['ProxyOnlyResource'] { name: 'String' } }, - recommendationRuleName: { + recommendationName: { required: false, - serializedName: 'properties.name', + serializedName: 'properties.recommendationName', type: { name: 'String' } @@ -152,9 +153,10 @@ class RecommendationRule extends models['ProxyOnlyResource'] { allowedValues: [ 'Notification', 'Api', 'Email', 'Webhook', 'All' ] } }, - tags: { + categoryTags: { required: false, - serializedName: 'properties.tags', + readOnly: true, + serializedName: 'properties.categoryTags', type: { name: 'Sequence', element: { diff --git a/lib/services/websiteManagement2/lib/models/rendering.js b/lib/services/websiteManagement2/lib/models/rendering.js index 09e9783dbb..a2dd117840 100644 --- a/lib/services/websiteManagement2/lib/models/rendering.js +++ b/lib/services/websiteManagement2/lib/models/rendering.js @@ -17,7 +17,7 @@ class Rendering { /** * Create a Rendering. - * @member {string} [renderingType] Rendering Type. Possible values include: + * @member {string} [type] Rendering Type. Possible values include: * 'NoGraph', 'Table', 'TimeSeries', 'TimeSeriesPerInstance' * @member {string} [title] Title of data * @member {string} [description] Description of the data that will help it @@ -40,9 +40,9 @@ class Rendering { name: 'Composite', className: 'Rendering', modelProperties: { - renderingType: { + type: { required: false, - serializedName: 'renderingType', + serializedName: 'type', type: { name: 'Enum', allowedValues: [ 'NoGraph', 'Table', 'TimeSeries', 'TimeSeriesPerInstance' ] diff --git a/lib/services/websiteManagement2/lib/models/resourceMetricDefinition.js b/lib/services/websiteManagement2/lib/models/resourceMetricDefinition.js index 86464c5423..8dbe89e1bf 100644 --- a/lib/services/websiteManagement2/lib/models/resourceMetricDefinition.js +++ b/lib/services/websiteManagement2/lib/models/resourceMetricDefinition.js @@ -20,16 +20,11 @@ const models = require('./index'); class ResourceMetricDefinition extends models['ProxyOnlyResource'] { /** * Create a ResourceMetricDefinition. - * @member {object} [resourceMetricDefinitionName] Name of the metric. - * @member {string} [resourceMetricDefinitionName.value] metric name value. - * @member {string} [resourceMetricDefinitionName.localizedValue] Localized - * metric name value. * @member {string} [unit] Unit of the metric. * @member {string} [primaryAggregationType] Primary aggregation type. * @member {array} [metricAvailabilities] List of time grains supported for * the metric together with retention period. * @member {string} [resourceUri] Resource URI. - * @member {string} [resourceMetricDefinitionId] Resource ID. * @member {object} [properties] Resource metric definition properties. */ constructor() { @@ -81,15 +76,6 @@ class ResourceMetricDefinition extends models['ProxyOnlyResource'] { name: 'String' } }, - resourceMetricDefinitionName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'Composite', - className: 'ResourceMetricName' - } - }, unit: { required: false, readOnly: true, @@ -130,14 +116,6 @@ class ResourceMetricDefinition extends models['ProxyOnlyResource'] { name: 'String' } }, - resourceMetricDefinitionId: { - required: false, - readOnly: true, - serializedName: 'properties.id', - type: { - name: 'String' - } - }, properties: { required: false, readOnly: true, diff --git a/lib/services/websiteManagement2/lib/models/restoreRequest.js b/lib/services/websiteManagement2/lib/models/restoreRequest.js index ed24bafc6a..7ae8aa728c 100644 --- a/lib/services/websiteManagement2/lib/models/restoreRequest.js +++ b/lib/services/websiteManagement2/lib/models/restoreRequest.js @@ -39,7 +39,8 @@ class RestoreRequest extends models['ProxyOnlyResource'] { * @member {string} [appServicePlan] Specify app service plan that will own * restored site. * @member {string} [operationType] Operation type. Possible values include: - * 'Default', 'Clone', 'Relocation', 'Snapshot'. Default value: 'Default' . + * 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS'. Default value: + * 'Default' . * @member {boolean} [adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, * false. @@ -167,7 +168,7 @@ class RestoreRequest extends models['ProxyOnlyResource'] { defaultValue: 'Default', type: { name: 'Enum', - allowedValues: [ 'Default', 'Clone', 'Relocation', 'Snapshot' ] + allowedValues: [ 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' ] } }, adjustConnectionStrings: { diff --git a/lib/services/websiteManagement2/lib/models/serviceSpecification.js b/lib/services/websiteManagement2/lib/models/serviceSpecification.js index ebb2a7b9a3..77a9cb816e 100644 --- a/lib/services/websiteManagement2/lib/models/serviceSpecification.js +++ b/lib/services/websiteManagement2/lib/models/serviceSpecification.js @@ -20,6 +20,7 @@ class ServiceSpecification { /** * Create a ServiceSpecification. * @member {array} [metricSpecifications] + * @member {array} [logSpecifications] */ constructor() { } @@ -52,6 +53,21 @@ class ServiceSpecification { } } } + }, + logSpecifications: { + required: false, + serializedName: 'logSpecifications', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LogSpecificationElementType', + type: { + name: 'Composite', + className: 'LogSpecification' + } + } + } } } } diff --git a/lib/services/websiteManagement2/lib/models/site.js b/lib/services/websiteManagement2/lib/models/site.js index daa121c8ae..154c30bf71 100644 --- a/lib/services/websiteManagement2/lib/models/site.js +++ b/lib/services/websiteManagement2/lib/models/site.js @@ -42,6 +42,7 @@ class Site extends models['Resource'] { * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". * @member {boolean} [reserved] true if reserved; otherwise, * false. Default value: false . + * @member {boolean} [isXenon] Hyper-V sandbox. Default value: false . * @member {date} [lastModifiedTimeUtc] Last time the app was modified, in * UTC. Read-only. * @member {object} [siteConfig] Configuration of the app. @@ -53,6 +54,8 @@ class Site extends models['Resource'] { * @member {string} [siteConfig.nodeVersion] Version of Node.js. * @member {string} [siteConfig.linuxFxVersion] Linux App Framework and * version + * @member {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version * @member {boolean} [siteConfig.requestTracingEnabled] true if * request tracing is enabled; otherwise, false. * @member {date} [siteConfig.requestTracingExpirationTime] Request tracing @@ -179,6 +182,10 @@ class Site extends models['Resource'] { * @member {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. * @member {boolean} [siteConfig.localMySqlEnabled] true to * enable local MySQL; otherwise, false. + * @member {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * @member {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id * @member {array} [siteConfig.ipSecurityRestrictions] IP security * restrictions. * @member {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a @@ -186,6 +193,11 @@ class Site extends models['Resource'] { * @member {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the * minimum version of TLS required for SSL requests. Possible values include: * '1.0', '1.1', '1.2' + * @member {string} [siteConfig.ftpsState] State of FTP / FTPS service. + * Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * @member {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan * @member {array} [trafficManagerHostNames] Azure Traffic Manager hostnames * associated with the app. Read-only. * @member {boolean} [scmSiteAlsoStopped] true to stop SCM @@ -257,31 +269,6 @@ class Site extends models['Resource'] { * @member {string} [cloningInfo.trafficManagerProfileName] Name of Traffic * Manager profile to create. This is only needed if Traffic Manager profile * does not already exist. - * @member {boolean} [cloningInfo.ignoreQuotas] true if quotas - * should be ignored; otherwise, false. - * @member {object} [snapshotInfo] If specified during app creation, the app - * is created from a previous snapshot. - * @member {string} [snapshotInfo.snapshotTime] Point in time in which the - * app recovery should be attempted, formatted as a DateTime string. - * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * @member {string} [snapshotInfo.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the - * target 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. - * @member {boolean} [snapshotInfo.overwrite] If true the - * recovery operation can overwrite source app; otherwise, - * false. - * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * @member {boolean} [snapshotInfo.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 {string} [resourceGroup] Name of the resource group the app * belongs to. Read-only. * @member {boolean} [isDefaultContainer] true if the app is a @@ -300,10 +287,12 @@ class Site extends models['Resource'] { * http requests * @member {object} [identity] * @member {string} [identity.type] Type of managed service identity. - * Possible values include: 'SystemAssigned' + * Possible values include: 'SystemAssigned', 'UserAssigned' * @member {string} [identity.tenantId] Tenant of managed service identity. * @member {string} [identity.principalId] Principal Id of managed service * identity. + * @member {array} [identity.identityIds] Array of UserAssigned managed + * service identities. */ constructor() { super(); @@ -476,6 +465,14 @@ class Site extends models['Resource'] { name: 'Boolean' } }, + isXenon: { + required: false, + serializedName: 'properties.isXenon', + defaultValue: false, + type: { + name: 'Boolean' + } + }, lastModifiedTimeUtc: { required: false, readOnly: true, @@ -606,14 +603,6 @@ class Site extends models['Resource'] { className: 'CloningInfo' } }, - snapshotInfo: { - required: false, - serializedName: 'properties.snapshotInfo', - type: { - name: 'Composite', - className: 'SnapshotRecoveryRequest' - } - }, resourceGroup: { required: false, readOnly: true, diff --git a/lib/services/websiteManagement2/lib/models/siteAuthSettings.js b/lib/services/websiteManagement2/lib/models/siteAuthSettings.js index 977f86f4dc..f35b25393d 100644 --- a/lib/services/websiteManagement2/lib/models/siteAuthSettings.js +++ b/lib/services/websiteManagement2/lib/models/siteAuthSettings.js @@ -74,6 +74,8 @@ class SiteAuthSettings extends models['ProxyOnlyResource'] { * This URI is a case-sensitive identifier for the token issuer. * More information on OpenID Connect Discovery: * http://openid.net/specs/openid-connect-discovery-1_0.html + * @member {boolean} [validateIssuer] Gets a value indicating whether the + * issuer should be a valid HTTPS url and be validated as such. * @member {array} [allowedAudiences] Allowed audience values to consider * when validating JWTs issued by * Azure Active Directory. Note that the ClientID value is @@ -266,6 +268,13 @@ class SiteAuthSettings extends models['ProxyOnlyResource'] { name: 'String' } }, + validateIssuer: { + required: false, + serializedName: 'properties.validateIssuer', + type: { + name: 'Boolean' + } + }, allowedAudiences: { required: false, serializedName: 'properties.allowedAudiences', diff --git a/lib/services/websiteManagement2/lib/models/siteConfig.js b/lib/services/websiteManagement2/lib/models/siteConfig.js index 6dd3a24a75..9d2438791d 100644 --- a/lib/services/websiteManagement2/lib/models/siteConfig.js +++ b/lib/services/websiteManagement2/lib/models/siteConfig.js @@ -27,6 +27,7 @@ class SiteConfig { * @member {string} [pythonVersion] Version of Python. * @member {string} [nodeVersion] Version of Node.js. * @member {string} [linuxFxVersion] Linux App Framework and version + * @member {string} [windowsFxVersion] Xenon App Framework and version * @member {boolean} [requestTracingEnabled] true if request * tracing is enabled; otherwise, false. * @member {date} [requestTracingExpirationTime] Request tracing expiration @@ -140,12 +141,19 @@ class SiteConfig { * @member {string} [autoSwapSlotName] Auto-swap slot name. * @member {boolean} [localMySqlEnabled] true to enable local * MySQL; otherwise, false. Default value: false . + * @member {number} [managedServiceIdentityId] Managed Service Identity Id + * @member {number} [xManagedServiceIdentityId] Explicit Managed Service + * Identity Id * @member {array} [ipSecurityRestrictions] IP security restrictions. * @member {boolean} [http20Enabled] Http20Enabled: configures a web site to * allow clients to connect over http2.0. Default value: true . * @member {string} [minTlsVersion] MinTlsVersion: configures the minimum * version of TLS required for SSL requests. Possible values include: '1.0', * '1.1', '1.2' + * @member {string} [ftpsState] State of FTP / FTPS service. Possible values + * include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * @member {number} [reservedInstanceCount] Number of reserved instances. + * This setting only applies to the Consumption Plan */ constructor() { } @@ -221,6 +229,13 @@ class SiteConfig { name: 'String' } }, + windowsFxVersion: { + required: false, + serializedName: 'windowsFxVersion', + type: { + name: 'String' + } + }, requestTracingEnabled: { required: false, serializedName: 'requestTracingEnabled', @@ -509,6 +524,20 @@ class SiteConfig { name: 'Boolean' } }, + managedServiceIdentityId: { + required: false, + serializedName: 'managedServiceIdentityId', + type: { + name: 'Number' + } + }, + xManagedServiceIdentityId: { + required: false, + serializedName: 'xManagedServiceIdentityId', + type: { + name: 'Number' + } + }, ipSecurityRestrictions: { required: false, serializedName: 'ipSecurityRestrictions', @@ -538,6 +567,24 @@ class SiteConfig { type: { name: 'String' } + }, + ftpsState: { + required: false, + serializedName: 'ftpsState', + type: { + name: 'String' + } + }, + reservedInstanceCount: { + required: false, + serializedName: 'reservedInstanceCount', + constraints: { + InclusiveMaximum: 10, + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/siteConfigResource.js b/lib/services/websiteManagement2/lib/models/siteConfigResource.js index 247ba84dc6..c4f86d257f 100644 --- a/lib/services/websiteManagement2/lib/models/siteConfigResource.js +++ b/lib/services/websiteManagement2/lib/models/siteConfigResource.js @@ -28,6 +28,7 @@ class SiteConfigResource extends models['ProxyOnlyResource'] { * @member {string} [pythonVersion] Version of Python. * @member {string} [nodeVersion] Version of Node.js. * @member {string} [linuxFxVersion] Linux App Framework and version + * @member {string} [windowsFxVersion] Xenon App Framework and version * @member {boolean} [requestTracingEnabled] true if request * tracing is enabled; otherwise, false. * @member {date} [requestTracingExpirationTime] Request tracing expiration @@ -141,12 +142,19 @@ class SiteConfigResource extends models['ProxyOnlyResource'] { * @member {string} [autoSwapSlotName] Auto-swap slot name. * @member {boolean} [localMySqlEnabled] true to enable local * MySQL; otherwise, false. Default value: false . + * @member {number} [managedServiceIdentityId] Managed Service Identity Id + * @member {number} [xManagedServiceIdentityId] Explicit Managed Service + * Identity Id * @member {array} [ipSecurityRestrictions] IP security restrictions. * @member {boolean} [http20Enabled] Http20Enabled: configures a web site to * allow clients to connect over http2.0. Default value: true . * @member {string} [minTlsVersion] MinTlsVersion: configures the minimum * version of TLS required for SSL requests. Possible values include: '1.0', * '1.1', '1.2' + * @member {string} [ftpsState] State of FTP / FTPS service. Possible values + * include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * @member {number} [reservedInstanceCount] Number of reserved instances. + * This setting only applies to the Consumption Plan */ constructor() { super(); @@ -254,6 +262,13 @@ class SiteConfigResource extends models['ProxyOnlyResource'] { name: 'String' } }, + windowsFxVersion: { + required: false, + serializedName: 'properties.windowsFxVersion', + type: { + name: 'String' + } + }, requestTracingEnabled: { required: false, serializedName: 'properties.requestTracingEnabled', @@ -542,6 +557,20 @@ class SiteConfigResource extends models['ProxyOnlyResource'] { name: 'Boolean' } }, + managedServiceIdentityId: { + required: false, + serializedName: 'properties.managedServiceIdentityId', + type: { + name: 'Number' + } + }, + xManagedServiceIdentityId: { + required: false, + serializedName: 'properties.xManagedServiceIdentityId', + type: { + name: 'Number' + } + }, ipSecurityRestrictions: { required: false, serializedName: 'properties.ipSecurityRestrictions', @@ -571,6 +600,24 @@ class SiteConfigResource extends models['ProxyOnlyResource'] { type: { name: 'String' } + }, + ftpsState: { + required: false, + serializedName: 'properties.ftpsState', + type: { + name: 'String' + } + }, + reservedInstanceCount: { + required: false, + serializedName: 'properties.reservedInstanceCount', + constraints: { + InclusiveMaximum: 10, + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/siteConfigurationSnapshotInfo.js b/lib/services/websiteManagement2/lib/models/siteConfigurationSnapshotInfo.js index ab201777eb..1317cb4e81 100644 --- a/lib/services/websiteManagement2/lib/models/siteConfigurationSnapshotInfo.js +++ b/lib/services/websiteManagement2/lib/models/siteConfigurationSnapshotInfo.js @@ -21,7 +21,7 @@ class SiteConfigurationSnapshotInfo extends models['ProxyOnlyResource'] { /** * Create a SiteConfigurationSnapshotInfo. * @member {date} [time] The time the snapshot was taken. - * @member {number} [siteConfigurationSnapshotInfoId] The id of the snapshot + * @member {number} [snapshotId] The id of the snapshot */ constructor() { super(); @@ -80,10 +80,10 @@ class SiteConfigurationSnapshotInfo extends models['ProxyOnlyResource'] { name: 'DateTime' } }, - siteConfigurationSnapshotInfoId: { + snapshotId: { required: false, readOnly: true, - serializedName: 'properties.id', + serializedName: 'properties.snapshotId', type: { name: 'Number' } diff --git a/lib/services/websiteManagement2/lib/models/siteExtensionInfo.js b/lib/services/websiteManagement2/lib/models/siteExtensionInfo.js index 8cd1cf009f..a0293ee225 100644 --- a/lib/services/websiteManagement2/lib/models/siteExtensionInfo.js +++ b/lib/services/websiteManagement2/lib/models/siteExtensionInfo.js @@ -20,10 +20,10 @@ const models = require('./index'); class SiteExtensionInfo extends models['ProxyOnlyResource'] { /** * Create a SiteExtensionInfo. - * @member {string} [siteExtensionInfoId] Site extension ID. - * @member {string} [title] Site extension title. - * @member {string} [siteExtensionInfoType] Site extension type. Possible - * values include: 'Gallery', 'WebRoot' + * @member {string} [extensionId] Site extension ID. + * @member {string} [title] + * @member {string} [extensionType] Site extension type. Possible values + * include: 'Gallery', 'WebRoot' * @member {string} [summary] Summary description. * @member {string} [description] Detailed description. * @member {string} [version] Version information. @@ -33,7 +33,8 @@ class SiteExtensionInfo extends models['ProxyOnlyResource'] { * @member {string} [licenseUrl] License URL. * @member {string} [feedUrl] Feed URL. * @member {array} [authors] List of authors. - * @member {string} [installationArgs] Installer command line parameters. + * @member {string} [installerCommandLineParams] Installer command line + * parameters. * @member {date} [publishedDateTime] Published timestamp. * @member {number} [downloadCount] Count of downloads. * @member {boolean} [localIsLatestVersion] true if the local @@ -92,9 +93,9 @@ class SiteExtensionInfo extends models['ProxyOnlyResource'] { name: 'String' } }, - siteExtensionInfoId: { + extensionId: { required: false, - serializedName: 'properties.id', + serializedName: 'properties.extension_id', type: { name: 'String' } @@ -106,9 +107,9 @@ class SiteExtensionInfo extends models['ProxyOnlyResource'] { name: 'String' } }, - siteExtensionInfoType: { + extensionType: { required: false, - serializedName: 'properties.type', + serializedName: 'properties.extension_type', type: { name: 'Enum', allowedValues: [ 'Gallery', 'WebRoot' ] @@ -137,35 +138,35 @@ class SiteExtensionInfo extends models['ProxyOnlyResource'] { }, extensionUrl: { required: false, - serializedName: 'properties.extensionUrl', + serializedName: 'properties.extension_url', type: { name: 'String' } }, projectUrl: { required: false, - serializedName: 'properties.projectUrl', + serializedName: 'properties.project_url', type: { name: 'String' } }, iconUrl: { required: false, - serializedName: 'properties.iconUrl', + serializedName: 'properties.icon_url', type: { name: 'String' } }, licenseUrl: { required: false, - serializedName: 'properties.licenseUrl', + serializedName: 'properties.license_url', type: { name: 'String' } }, feedUrl: { required: false, - serializedName: 'properties.feedUrl', + serializedName: 'properties.feed_url', type: { name: 'String' } @@ -184,44 +185,44 @@ class SiteExtensionInfo extends models['ProxyOnlyResource'] { } } }, - installationArgs: { + installerCommandLineParams: { required: false, - serializedName: 'properties.installationArgs', + serializedName: 'properties.installer_command_line_params', type: { name: 'String' } }, publishedDateTime: { required: false, - serializedName: 'properties.publishedDateTime', + serializedName: 'properties.published_date_time', type: { name: 'DateTime' } }, downloadCount: { required: false, - serializedName: 'properties.downloadCount', + serializedName: 'properties.download_count', type: { name: 'Number' } }, localIsLatestVersion: { required: false, - serializedName: 'properties.localIsLatestVersion', + serializedName: 'properties.local_is_latest_version', type: { name: 'Boolean' } }, localPath: { required: false, - serializedName: 'properties.localPath', + serializedName: 'properties.local_path', type: { name: 'String' } }, installedDateTime: { required: false, - serializedName: 'properties.installedDateTime', + serializedName: 'properties.installed_date_time', type: { name: 'DateTime' } diff --git a/lib/services/websiteManagement2/lib/models/siteInstance.js b/lib/services/websiteManagement2/lib/models/siteInstance.js index 850f9772ca..72635c8844 100644 --- a/lib/services/websiteManagement2/lib/models/siteInstance.js +++ b/lib/services/websiteManagement2/lib/models/siteInstance.js @@ -74,7 +74,7 @@ class SiteInstance extends models['ProxyOnlyResource'] { siteInstanceName: { required: false, readOnly: true, - serializedName: 'properties.name', + serializedName: 'properties.siteInstanceName', type: { name: 'String' } diff --git a/lib/services/websiteManagement2/lib/models/sitePatchResource.js b/lib/services/websiteManagement2/lib/models/sitePatchResource.js index 91322a206d..575bc5a043 100644 --- a/lib/services/websiteManagement2/lib/models/sitePatchResource.js +++ b/lib/services/websiteManagement2/lib/models/sitePatchResource.js @@ -42,6 +42,7 @@ class SitePatchResource extends models['ProxyOnlyResource'] { * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". * @member {boolean} [reserved] true if reserved; otherwise, * false. Default value: false . + * @member {boolean} [isXenon] Hyper-V sandbox. Default value: false . * @member {date} [lastModifiedTimeUtc] Last time the app was modified, in * UTC. Read-only. * @member {object} [siteConfig] Configuration of the app. @@ -53,6 +54,8 @@ class SitePatchResource extends models['ProxyOnlyResource'] { * @member {string} [siteConfig.nodeVersion] Version of Node.js. * @member {string} [siteConfig.linuxFxVersion] Linux App Framework and * version + * @member {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version * @member {boolean} [siteConfig.requestTracingEnabled] true if * request tracing is enabled; otherwise, false. * @member {date} [siteConfig.requestTracingExpirationTime] Request tracing @@ -179,6 +182,10 @@ class SitePatchResource extends models['ProxyOnlyResource'] { * @member {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. * @member {boolean} [siteConfig.localMySqlEnabled] true to * enable local MySQL; otherwise, false. + * @member {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * @member {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id * @member {array} [siteConfig.ipSecurityRestrictions] IP security * restrictions. * @member {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a @@ -186,6 +193,11 @@ class SitePatchResource extends models['ProxyOnlyResource'] { * @member {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the * minimum version of TLS required for SSL requests. Possible values include: * '1.0', '1.1', '1.2' + * @member {string} [siteConfig.ftpsState] State of FTP / FTPS service. + * Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * @member {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan * @member {array} [trafficManagerHostNames] Azure Traffic Manager hostnames * associated with the app. Read-only. * @member {boolean} [scmSiteAlsoStopped] true to stop SCM @@ -257,31 +269,6 @@ class SitePatchResource extends models['ProxyOnlyResource'] { * @member {string} [cloningInfo.trafficManagerProfileName] Name of Traffic * Manager profile to create. This is only needed if Traffic Manager profile * does not already exist. - * @member {boolean} [cloningInfo.ignoreQuotas] true if quotas - * should be ignored; otherwise, false. - * @member {object} [snapshotInfo] If specified during app creation, the app - * is created from a previous snapshot. - * @member {string} [snapshotInfo.snapshotTime] Point in time in which the - * app recovery should be attempted, formatted as a DateTime string. - * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * @member {string} [snapshotInfo.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the - * target 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. - * @member {boolean} [snapshotInfo.overwrite] If true the - * recovery operation can overwrite source app; otherwise, - * false. - * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * @member {boolean} [snapshotInfo.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 {string} [resourceGroup] Name of the resource group the app * belongs to. Read-only. * @member {boolean} [isDefaultContainer] true if the app is a @@ -449,6 +436,14 @@ class SitePatchResource extends models['ProxyOnlyResource'] { name: 'Boolean' } }, + isXenon: { + required: false, + serializedName: 'properties.isXenon', + defaultValue: false, + type: { + name: 'Boolean' + } + }, lastModifiedTimeUtc: { required: false, readOnly: true, @@ -579,14 +574,6 @@ class SitePatchResource extends models['ProxyOnlyResource'] { className: 'CloningInfo' } }, - snapshotInfo: { - required: false, - serializedName: 'properties.snapshotInfo', - type: { - name: 'Composite', - className: 'SnapshotRecoveryRequest' - } - }, resourceGroup: { required: false, readOnly: true, diff --git a/lib/services/websiteManagement2/lib/models/slotDifference.js b/lib/services/websiteManagement2/lib/models/slotDifference.js index f20bdff1da..49d154fc4c 100644 --- a/lib/services/websiteManagement2/lib/models/slotDifference.js +++ b/lib/services/websiteManagement2/lib/models/slotDifference.js @@ -20,8 +20,8 @@ const models = require('./index'); class SlotDifference extends models['ProxyOnlyResource'] { /** * Create a SlotDifference. - * @member {string} [slotDifferenceType] Type of the difference: Information, - * Warning or Error. + * @member {string} [level] Level of the difference: Information, Warning or + * Error. * @member {string} [settingType] The type of the setting: General, * AppSetting or ConnectionString. * @member {string} [diffRule] Rule that describes how to process the setting @@ -82,10 +82,10 @@ class SlotDifference extends models['ProxyOnlyResource'] { name: 'String' } }, - slotDifferenceType: { + level: { required: false, readOnly: true, - serializedName: 'properties.type', + serializedName: 'properties.level', type: { name: 'String' } diff --git a/lib/services/websiteManagement2/lib/models/snapshotRecoverySource.js b/lib/services/websiteManagement2/lib/models/snapshotRecoverySource.js new file mode 100644 index 0000000000..e545007e99 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/snapshotRecoverySource.js @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Specifies the web app that snapshot contents will be retrieved from. + * + */ +class SnapshotRecoverySource { + /** + * Create a SnapshotRecoverySource. + * @member {string} [location] Geographical location of the source web app, + * e.g. SouthEastAsia, SouthCentralUS + * @member {string} [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. + */ + constructor() { + } + + /** + * Defines the metadata of SnapshotRecoverySource + * + * @returns {object} metadata of SnapshotRecoverySource + * + */ + mapper() { + return { + required: false, + serializedName: 'SnapshotRecoverySource', + type: { + name: 'Composite', + className: 'SnapshotRecoverySource', + modelProperties: { + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SnapshotRecoverySource; diff --git a/lib/services/websiteManagement2/lib/models/snapshotRestoreRequest.js b/lib/services/websiteManagement2/lib/models/snapshotRestoreRequest.js new file mode 100644 index 0000000000..ad5d840c8a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/snapshotRestoreRequest.js @@ -0,0 +1,134 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Details about app recovery operation. + * + * @extends models['ProxyOnlyResource'] + */ +class SnapshotRestoreRequest extends models['ProxyOnlyResource'] { + /** + * Create a SnapshotRestoreRequest. + * @member {string} [snapshotTime] Point in time in which the app restore + * should be done, formatted as a DateTime string. + * @member {object} [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. + * @member {string} [recoverySource.location] Geographical location of the + * source web app, e.g. SouthEastAsia, SouthCentralUS + * @member {string} [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. + * @member {boolean} overwrite If true the restore operation can + * overwrite source app; otherwise, false. + * @member {boolean} [recoverConfiguration] If true, site configuration, in + * addition to content, will be reverted. + * @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. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SnapshotRestoreRequest + * + * @returns {object} metadata of SnapshotRestoreRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'SnapshotRestoreRequest', + type: { + name: 'Composite', + className: 'SnapshotRestoreRequest', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + kind: { + required: false, + serializedName: 'kind', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + snapshotTime: { + required: false, + serializedName: 'properties.snapshotTime', + type: { + name: 'String' + } + }, + recoverySource: { + required: false, + serializedName: 'properties.recoverySource', + type: { + name: 'Composite', + className: 'SnapshotRecoverySource' + } + }, + overwrite: { + required: true, + serializedName: 'properties.overwrite', + type: { + name: 'Boolean' + } + }, + recoverConfiguration: { + required: false, + serializedName: 'properties.recoverConfiguration', + type: { + name: 'Boolean' + } + }, + ignoreConflictingHostNames: { + required: false, + serializedName: 'properties.ignoreConflictingHostNames', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = SnapshotRestoreRequest; diff --git a/lib/services/websiteManagement2/lib/models/sourceControl.js b/lib/services/websiteManagement2/lib/models/sourceControl.js index 0c0d72a318..3e7a294e88 100644 --- a/lib/services/websiteManagement2/lib/models/sourceControl.js +++ b/lib/services/websiteManagement2/lib/models/sourceControl.js @@ -20,7 +20,6 @@ const models = require('./index'); class SourceControl extends models['ProxyOnlyResource'] { /** * Create a SourceControl. - * @member {string} [sourceControlName] Name or source control type. * @member {string} [token] OAuth access token. * @member {string} [tokenSecret] OAuth access token secret. * @member {string} [refreshToken] OAuth refresh token. @@ -75,13 +74,6 @@ class SourceControl extends models['ProxyOnlyResource'] { name: 'String' } }, - sourceControlName: { - required: false, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, token: { required: false, serializedName: 'properties.token', diff --git a/lib/services/websiteManagement2/lib/models/stampCapacity.js b/lib/services/websiteManagement2/lib/models/stampCapacity.js index 8cb844d445..9227735918 100644 --- a/lib/services/websiteManagement2/lib/models/stampCapacity.js +++ b/lib/services/websiteManagement2/lib/models/stampCapacity.js @@ -26,7 +26,7 @@ class StampCapacity { * @member {string} [computeMode] Shared/dedicated workers. Possible values * include: 'Shared', 'Dedicated', 'Dynamic' * @member {string} [workerSize] Size of the machines. Possible values - * include: 'Default', 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3' + * include: 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'Default' * @member {number} [workerSizeId] Size ID of machines: * 0 - Small * 1 - Medium @@ -37,6 +37,7 @@ class StampCapacity { * @member {boolean} [isApplicableForAllComputeModes] true if * capacity is applicable for all apps; otherwise, false. * @member {string} [siteMode] Shared or Dedicated. + * @member {boolean} [isLinux] Is this a linux stamp capacity */ constructor() { } @@ -96,7 +97,7 @@ class StampCapacity { serializedName: 'workerSize', type: { name: 'Enum', - allowedValues: [ 'Default', 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3' ] + allowedValues: [ 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'Default' ] } }, workerSizeId: { @@ -126,6 +127,13 @@ class StampCapacity { type: { name: 'String' } + }, + isLinux: { + required: false, + serializedName: 'isLinux', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/swiftVirtualNetwork.js b/lib/services/websiteManagement2/lib/models/swiftVirtualNetwork.js new file mode 100644 index 0000000000..7001e790fd --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/swiftVirtualNetwork.js @@ -0,0 +1,99 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Swift Virtual Network Contract. This is used to enable the new Swift way of + * doing virtual network integration. + * + * @extends models['ProxyOnlyResource'] + */ +class SwiftVirtualNetwork extends models['ProxyOnlyResource'] { + /** + * Create a SwiftVirtualNetwork. + * @member {string} [subnetResourceId] The Virtual Network subnet's resource + * ID. This is the subnet that this Web App will join. This subnet must have + * a delegation to Microsoft.Web/serverFarms defined first. + * @member {boolean} [swiftSupported] A flag that specifies if the scale unit + * this Web App is on supports Swift integration. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SwiftVirtualNetwork + * + * @returns {object} metadata of SwiftVirtualNetwork + * + */ + mapper() { + return { + required: false, + serializedName: 'SwiftVirtualNetwork', + type: { + name: 'Composite', + className: 'SwiftVirtualNetwork', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + kind: { + required: false, + serializedName: 'kind', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + subnetResourceId: { + required: false, + serializedName: 'properties.subnetResourceId', + type: { + name: 'String' + } + }, + swiftSupported: { + required: false, + serializedName: 'properties.swiftSupported', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = SwiftVirtualNetwork; diff --git a/lib/services/websiteManagement2/lib/models/topLevelDomain.js b/lib/services/websiteManagement2/lib/models/topLevelDomain.js index 76d8577eaf..d5e0a3c95c 100644 --- a/lib/services/websiteManagement2/lib/models/topLevelDomain.js +++ b/lib/services/websiteManagement2/lib/models/topLevelDomain.js @@ -20,7 +20,6 @@ const models = require('./index'); class TopLevelDomain extends models['ProxyOnlyResource'] { /** * Create a TopLevelDomain. - * @member {string} [domainName] Name of the top level domain. * @member {boolean} [privacy] If true, then the top level * domain supports domain privacy; otherwise, false. */ @@ -73,14 +72,6 @@ class TopLevelDomain extends models['ProxyOnlyResource'] { name: 'String' } }, - domainName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, privacy: { required: false, serializedName: 'properties.privacy', diff --git a/lib/services/websiteManagement2/lib/models/triggeredJobHistory.js b/lib/services/websiteManagement2/lib/models/triggeredJobHistory.js index dda09c1cae..7623db0417 100644 --- a/lib/services/websiteManagement2/lib/models/triggeredJobHistory.js +++ b/lib/services/websiteManagement2/lib/models/triggeredJobHistory.js @@ -21,7 +21,7 @@ const models = require('./index'); class TriggeredJobHistory extends models['ProxyOnlyResource'] { /** * Create a TriggeredJobHistory. - * @member {array} [triggeredJobRuns] List of triggered web job runs. + * @member {array} [runs] List of triggered web job runs. */ constructor() { super(); @@ -72,9 +72,9 @@ class TriggeredJobHistory extends models['ProxyOnlyResource'] { name: 'String' } }, - triggeredJobRuns: { + runs: { required: false, - serializedName: 'properties.triggeredJobRuns', + serializedName: 'properties.runs', type: { name: 'Sequence', element: { diff --git a/lib/services/websiteManagement2/lib/models/triggeredJobRun.js b/lib/services/websiteManagement2/lib/models/triggeredJobRun.js index dafb649e30..ef4774b6e4 100644 --- a/lib/services/websiteManagement2/lib/models/triggeredJobRun.js +++ b/lib/services/websiteManagement2/lib/models/triggeredJobRun.js @@ -20,8 +20,8 @@ const models = require('./index'); class TriggeredJobRun extends models['ProxyOnlyResource'] { /** * Create a TriggeredJobRun. - * @member {string} [triggeredJobRunId] Job ID. - * @member {string} [triggeredJobRunName] Job name. + * @member {string} [webJobId] Job ID. + * @member {string} [webJobName] Job name. * @member {string} [status] Job status. Possible values include: 'Success', * 'Failed', 'Error' * @member {date} [startTime] Start time. @@ -82,17 +82,16 @@ class TriggeredJobRun extends models['ProxyOnlyResource'] { name: 'String' } }, - triggeredJobRunId: { + webJobId: { required: false, - serializedName: 'properties.id', + serializedName: 'properties.web_job_id', type: { name: 'String' } }, - triggeredJobRunName: { + webJobName: { required: false, - readOnly: true, - serializedName: 'properties.name', + serializedName: 'properties.web_job_name', type: { name: 'String' } @@ -107,14 +106,14 @@ class TriggeredJobRun extends models['ProxyOnlyResource'] { }, startTime: { required: false, - serializedName: 'properties.startTime', + serializedName: 'properties.start_time', type: { name: 'DateTime' } }, endTime: { required: false, - serializedName: 'properties.endTime', + serializedName: 'properties.end_time', type: { name: 'DateTime' } @@ -128,14 +127,14 @@ class TriggeredJobRun extends models['ProxyOnlyResource'] { }, outputUrl: { required: false, - serializedName: 'properties.outputUrl', + serializedName: 'properties.output_url', type: { name: 'String' } }, errorUrl: { required: false, - serializedName: 'properties.errorUrl', + serializedName: 'properties.error_url', type: { name: 'String' } @@ -149,7 +148,7 @@ class TriggeredJobRun extends models['ProxyOnlyResource'] { }, jobName: { required: false, - serializedName: 'properties.jobName', + serializedName: 'properties.job_name', type: { name: 'String' } diff --git a/lib/services/websiteManagement2/lib/models/triggeredWebJob.js b/lib/services/websiteManagement2/lib/models/triggeredWebJob.js index 076ffffe05..b062eb3eb4 100644 --- a/lib/services/websiteManagement2/lib/models/triggeredWebJob.js +++ b/lib/services/websiteManagement2/lib/models/triggeredWebJob.js @@ -21,8 +21,8 @@ class TriggeredWebJob extends models['ProxyOnlyResource'] { /** * Create a TriggeredWebJob. * @member {object} [latestRun] Latest job run information. - * @member {string} [latestRun.triggeredJobRunId] Job ID. - * @member {string} [latestRun.triggeredJobRunName] Job name. + * @member {string} [latestRun.webJobId] Job ID. + * @member {string} [latestRun.webJobName] Job name. * @member {string} [latestRun.status] Job status. Possible values include: * 'Success', 'Failed', 'Error' * @member {date} [latestRun.startTime] Start time. @@ -35,12 +35,10 @@ class TriggeredWebJob extends models['ProxyOnlyResource'] { * @member {string} [latestRun.trigger] Job trigger. * @member {string} [historyUrl] History URL. * @member {string} [schedulerLogsUrl] Scheduler Logs URL. - * @member {string} [triggeredWebJobName] Job name. Used as job identifier in - * ARM resource URI. * @member {string} [runCommand] Run command. * @member {string} [url] Job URL. * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] Job type. Possible values include: + * @member {string} [webJobType] Job type. Possible values include: * 'Continuous', 'Triggered' * @member {string} [error] Error information. * @member {boolean} [usingSdk] Using SDK? @@ -97,7 +95,7 @@ class TriggeredWebJob extends models['ProxyOnlyResource'] { }, latestRun: { required: false, - serializedName: 'properties.latestRun', + serializedName: 'properties.latest_run', type: { name: 'Composite', className: 'TriggeredJobRun' @@ -105,29 +103,21 @@ class TriggeredWebJob extends models['ProxyOnlyResource'] { }, historyUrl: { required: false, - serializedName: 'properties.historyUrl', + serializedName: 'properties.history_url', type: { name: 'String' } }, schedulerLogsUrl: { required: false, - serializedName: 'properties.schedulerLogsUrl', - type: { - name: 'String' - } - }, - triggeredWebJobName: { - required: false, - readOnly: true, - serializedName: 'properties.name', + serializedName: 'properties.scheduler_logs_url', type: { name: 'String' } }, runCommand: { required: false, - serializedName: 'properties.runCommand', + serializedName: 'properties.run_command', type: { name: 'String' } @@ -141,14 +131,14 @@ class TriggeredWebJob extends models['ProxyOnlyResource'] { }, extraInfoUrl: { required: false, - serializedName: 'properties.extraInfoUrl', + serializedName: 'properties.extra_info_url', type: { name: 'String' } }, - jobType: { + webJobType: { required: false, - serializedName: 'properties.jobType', + serializedName: 'properties.web_job_type', type: { name: 'Enum', allowedValues: [ 'Continuous', 'Triggered' ] @@ -163,7 +153,7 @@ class TriggeredWebJob extends models['ProxyOnlyResource'] { }, usingSdk: { required: false, - serializedName: 'properties.usingSdk', + serializedName: 'properties.using_sdk', type: { name: 'Boolean' } diff --git a/lib/services/websiteManagement2/lib/models/usage.js b/lib/services/websiteManagement2/lib/models/usage.js index a8bb508dd5..b030fdbfde 100644 --- a/lib/services/websiteManagement2/lib/models/usage.js +++ b/lib/services/websiteManagement2/lib/models/usage.js @@ -21,7 +21,6 @@ class Usage extends models['ProxyOnlyResource'] { /** * Create a Usage. * @member {string} [displayName] Friendly name shown in the UI. - * @member {string} [usageName] Name of the quota. * @member {string} [resourceName] Name of the quota resource. * @member {string} [unit] Units of measurement for the quota resource. * @member {number} [currentValue] The current value of the resource counter. @@ -88,14 +87,6 @@ class Usage extends models['ProxyOnlyResource'] { name: 'String' } }, - usageName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, resourceName: { required: false, readOnly: true, diff --git a/lib/services/websiteManagement2/lib/models/user.js b/lib/services/websiteManagement2/lib/models/user.js index 8f3d0fbad6..ec8071fce3 100644 --- a/lib/services/websiteManagement2/lib/models/user.js +++ b/lib/services/websiteManagement2/lib/models/user.js @@ -20,13 +20,13 @@ const models = require('./index'); class User extends models['ProxyOnlyResource'] { /** * Create a User. - * @member {string} [userName] Username * @member {string} publishingUserName Username used for publishing. * @member {string} [publishingPassword] Password used for publishing. * @member {string} [publishingPasswordHash] Password hash used for * publishing. * @member {string} [publishingPasswordHashSalt] Password hash salt used for * publishing. + * @member {string} [scmUri] Url of SCM site. */ constructor() { super(); @@ -77,13 +77,6 @@ class User extends models['ProxyOnlyResource'] { name: 'String' } }, - userName: { - required: false, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, publishingUserName: { required: true, serializedName: 'properties.publishingUserName', @@ -111,6 +104,13 @@ class User extends models['ProxyOnlyResource'] { type: { name: 'String' } + }, + scmUri: { + required: false, + serializedName: 'properties.scmUri', + type: { + name: 'String' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/validateRequest.js b/lib/services/websiteManagement2/lib/models/validateRequest.js index 479983a00f..3ca18ee528 100644 --- a/lib/services/websiteManagement2/lib/models/validateRequest.js +++ b/lib/services/websiteManagement2/lib/models/validateRequest.js @@ -33,6 +33,8 @@ class ValidateRequest { * (number of VM's). * @member {string} [hostingEnvironment] Name of App Service Environment * where app or App Service plan should be created. + * @member {boolean} [isXenon] true if App Service plan is + * running as a windows container */ constructor() { } @@ -116,6 +118,13 @@ class ValidateRequest { type: { name: 'String' } + }, + isXenon: { + required: false, + serializedName: 'properties.isXenon', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/vnetRoute.js b/lib/services/websiteManagement2/lib/models/vnetRoute.js index 5df4cf5959..5dfe8a762e 100644 --- a/lib/services/websiteManagement2/lib/models/vnetRoute.js +++ b/lib/services/websiteManagement2/lib/models/vnetRoute.js @@ -21,8 +21,6 @@ const models = require('./index'); class VnetRoute extends models['ProxyOnlyResource'] { /** * Create a VnetRoute. - * @member {string} [vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. * @member {string} [startAddress] The starting address for this route. This * may also include a CIDR notation, in which case the end address must not * be specified. @@ -86,13 +84,6 @@ class VnetRoute extends models['ProxyOnlyResource'] { name: 'String' } }, - vnetRouteName: { - required: false, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, startAddress: { required: false, serializedName: 'properties.startAddress', diff --git a/lib/services/websiteManagement2/lib/models/webJob.js b/lib/services/websiteManagement2/lib/models/webJob.js index 8f2ed44730..071625ad9b 100644 --- a/lib/services/websiteManagement2/lib/models/webJob.js +++ b/lib/services/websiteManagement2/lib/models/webJob.js @@ -20,12 +20,10 @@ const models = require('./index'); class WebJob extends models['ProxyOnlyResource'] { /** * Create a WebJob. - * @member {string} [webJobName] Job name. Used as job identifier in ARM - * resource URI. * @member {string} [runCommand] Run command. * @member {string} [url] Job URL. * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] Job type. Possible values include: + * @member {string} [webJobType] Job type. Possible values include: * 'Continuous', 'Triggered' * @member {string} [error] Error information. * @member {boolean} [usingSdk] Using SDK? @@ -80,17 +78,9 @@ class WebJob extends models['ProxyOnlyResource'] { name: 'String' } }, - webJobName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, runCommand: { required: false, - serializedName: 'properties.runCommand', + serializedName: 'properties.run_command', type: { name: 'String' } @@ -104,14 +94,14 @@ class WebJob extends models['ProxyOnlyResource'] { }, extraInfoUrl: { required: false, - serializedName: 'properties.extraInfoUrl', + serializedName: 'properties.extra_info_url', type: { name: 'String' } }, - jobType: { + webJobType: { required: false, - serializedName: 'properties.jobType', + serializedName: 'properties.web_job_type', type: { name: 'Enum', allowedValues: [ 'Continuous', 'Triggered' ] @@ -126,7 +116,7 @@ class WebJob extends models['ProxyOnlyResource'] { }, usingSdk: { required: false, - serializedName: 'properties.usingSdk', + serializedName: 'properties.using_sdk', type: { name: 'Boolean' } diff --git a/lib/services/websiteManagement2/lib/operations/appServiceCertificateOrders.js b/lib/services/websiteManagement2/lib/operations/appServiceCertificateOrders.js index 66ac67f507..c61d1b4c3d 100644 --- a/lib/services/websiteManagement2/lib/operations/appServiceCertificateOrders.js +++ b/lib/services/websiteManagement2/lib/operations/appServiceCertificateOrders.js @@ -48,12 +48,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { 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.'); } @@ -66,7 +68,7 @@ function _list(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/certificateOrders'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -108,12 +110,13 @@ function _list(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) { @@ -211,7 +214,6 @@ function _validatePurchaseInformation(appServiceCertificateOrder, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (appServiceCertificateOrder === null || appServiceCertificateOrder === undefined) { @@ -220,6 +222,9 @@ function _validatePurchaseInformation(appServiceCertificateOrder, options, callb 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.'); } @@ -232,7 +237,7 @@ function _validatePurchaseInformation(appServiceCertificateOrder, options, callb let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/validateCertificateRegistrationInformation'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -348,7 +353,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -371,6 +375,9 @@ function _listByResourceGroup(resourceGroupName, options, callback) { 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.'); } @@ -384,7 +391,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -426,12 +433,13 @@ function _listByResourceGroup(resourceGroupName, 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) { @@ -505,7 +513,6 @@ function _get(resourceGroupName, certificateOrderName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -531,6 +538,9 @@ function _get(resourceGroupName, certificateOrderName, options, callback) { 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.'); } @@ -545,7 +555,7 @@ function _get(resourceGroupName, certificateOrderName, options, callback) { requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -587,12 +597,13 @@ function _get(resourceGroupName, certificateOrderName, 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) { @@ -777,7 +788,6 @@ function _deleteMethod(resourceGroupName, certificateOrderName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -803,6 +813,9 @@ function _deleteMethod(resourceGroupName, certificateOrderName, options, callbac 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.'); } @@ -817,7 +830,7 @@ function _deleteMethod(resourceGroupName, certificateOrderName, options, callbac requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -948,7 +961,6 @@ function _update(resourceGroupName, certificateOrderName, certificateDistinguish if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -977,6 +989,9 @@ function _update(resourceGroupName, certificateOrderName, certificateDistinguish 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.'); } @@ -991,7 +1006,7 @@ function _update(resourceGroupName, certificateOrderName, certificateDistinguish requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1047,12 +1062,13 @@ function _update(resourceGroupName, certificateOrderName, certificateDistinguish 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) { @@ -1143,7 +1159,6 @@ function _listCertificates(resourceGroupName, certificateOrderName, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1169,6 +1184,9 @@ function _listCertificates(resourceGroupName, certificateOrderName, options, cal 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.'); } @@ -1183,7 +1201,7 @@ function _listCertificates(resourceGroupName, certificateOrderName, options, cal requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1225,12 +1243,13 @@ function _listCertificates(resourceGroupName, certificateOrderName, options, cal 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) { @@ -1306,7 +1325,6 @@ function _getCertificate(resourceGroupName, certificateOrderName, name, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1335,6 +1353,9 @@ function _getCertificate(resourceGroupName, certificateOrderName, name, options, 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.'); } @@ -1350,7 +1371,7 @@ function _getCertificate(resourceGroupName, certificateOrderName, name, options, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1392,12 +1413,13 @@ function _getCertificate(resourceGroupName, certificateOrderName, name, 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) { @@ -1569,7 +1591,6 @@ function _deleteCertificate(resourceGroupName, certificateOrderName, name, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1598,6 +1619,9 @@ function _deleteCertificate(resourceGroupName, certificateOrderName, name, optio 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.'); } @@ -1613,7 +1637,7 @@ function _deleteCertificate(resourceGroupName, certificateOrderName, name, optio requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1729,7 +1753,6 @@ function _updateCertificate(resourceGroupName, certificateOrderName, name, keyVa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1761,6 +1784,9 @@ function _updateCertificate(resourceGroupName, certificateOrderName, name, keyVa 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.'); } @@ -1776,7 +1802,7 @@ function _updateCertificate(resourceGroupName, certificateOrderName, name, keyVa requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1832,12 +1858,13 @@ function _updateCertificate(resourceGroupName, certificateOrderName, name, keyVa 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) { @@ -1944,7 +1971,6 @@ function _reissue(resourceGroupName, certificateOrderName, reissueCertificateOrd if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1973,6 +1999,9 @@ function _reissue(resourceGroupName, certificateOrderName, reissueCertificateOrd 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.'); } @@ -1987,7 +2016,7 @@ function _reissue(resourceGroupName, certificateOrderName, reissueCertificateOrd requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2116,7 +2145,6 @@ function _renew(resourceGroupName, certificateOrderName, renewCertificateOrderRe if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2145,6 +2173,9 @@ function _renew(resourceGroupName, certificateOrderName, renewCertificateOrderRe 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.'); } @@ -2159,7 +2190,7 @@ function _renew(resourceGroupName, certificateOrderName, renewCertificateOrderRe requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2275,7 +2306,6 @@ function _resendEmail(resourceGroupName, certificateOrderName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2301,6 +2331,9 @@ function _resendEmail(resourceGroupName, certificateOrderName, options, callback 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.'); } @@ -2315,7 +2348,7 @@ function _resendEmail(resourceGroupName, certificateOrderName, options, callback requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2420,7 +2453,6 @@ function _resendRequestEmails(resourceGroupName, certificateOrderName, options, throw new Error('callback cannot be null.'); } let name = (options && options.name !== undefined) ? options.name : undefined; - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2446,6 +2478,9 @@ function _resendRequestEmails(resourceGroupName, certificateOrderName, options, 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 (name !== null && name !== undefined && typeof name.valueOf() !== 'string') { throw new Error('name must be of type string.'); } @@ -2468,7 +2503,7 @@ function _resendRequestEmails(resourceGroupName, certificateOrderName, options, requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2592,7 +2627,6 @@ function _retrieveSiteSeal(resourceGroupName, certificateOrderName, siteSealRequ if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2621,6 +2655,9 @@ function _retrieveSiteSeal(resourceGroupName, certificateOrderName, siteSealRequ 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.'); } @@ -2635,7 +2672,7 @@ function _retrieveSiteSeal(resourceGroupName, certificateOrderName, siteSealRequ requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2691,12 +2728,13 @@ function _retrieveSiteSeal(resourceGroupName, certificateOrderName, siteSealRequ 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) { @@ -2768,7 +2806,6 @@ function _verifyDomainOwnership(resourceGroupName, certificateOrderName, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2794,6 +2831,9 @@ function _verifyDomainOwnership(resourceGroupName, certificateOrderName, options 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.'); } @@ -2808,7 +2848,7 @@ function _verifyDomainOwnership(resourceGroupName, certificateOrderName, options requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2910,7 +2950,6 @@ function _retrieveCertificateActions(resourceGroupName, name, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2936,6 +2975,9 @@ function _retrieveCertificateActions(resourceGroupName, name, options, callback) 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.'); } @@ -2950,7 +2992,7 @@ function _retrieveCertificateActions(resourceGroupName, name, options, callback) requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2992,12 +3034,13 @@ function _retrieveCertificateActions(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) { @@ -3083,7 +3126,6 @@ function _retrieveCertificateEmailHistory(resourceGroupName, name, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3109,6 +3151,9 @@ function _retrieveCertificateEmailHistory(resourceGroupName, name, options, call 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.'); } @@ -3123,7 +3168,7 @@ function _retrieveCertificateEmailHistory(resourceGroupName, name, options, call requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3165,12 +3210,13 @@ function _retrieveCertificateEmailHistory(resourceGroupName, name, 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) { @@ -3289,7 +3335,6 @@ function _beginCreateOrUpdate(resourceGroupName, certificateOrderName, certifica if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3318,6 +3363,9 @@ function _beginCreateOrUpdate(resourceGroupName, certificateOrderName, certifica 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.'); } @@ -3332,7 +3380,7 @@ function _beginCreateOrUpdate(resourceGroupName, certificateOrderName, certifica requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3388,12 +3436,13 @@ function _beginCreateOrUpdate(resourceGroupName, certificateOrderName, certifica 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) { @@ -3500,7 +3549,6 @@ function _beginCreateOrUpdateCertificate(resourceGroupName, certificateOrderName if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3532,6 +3580,9 @@ function _beginCreateOrUpdateCertificate(resourceGroupName, certificateOrderName 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.'); } @@ -3547,7 +3598,7 @@ function _beginCreateOrUpdateCertificate(resourceGroupName, certificateOrderName requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3603,12 +3654,13 @@ function _beginCreateOrUpdateCertificate(resourceGroupName, certificateOrderName 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) { @@ -3750,12 +3802,13 @@ function _listNext(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) { @@ -3880,12 +3933,13 @@ function _listByResourceGroupNext(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) { @@ -4010,12 +4064,13 @@ function _listCertificatesNext(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) { diff --git a/lib/services/websiteManagement2/lib/operations/appServiceEnvironments.js b/lib/services/websiteManagement2/lib/operations/appServiceEnvironments.js index ad008a5ab6..4e8dcefbed 100644 --- a/lib/services/websiteManagement2/lib/operations/appServiceEnvironments.js +++ b/lib/services/websiteManagement2/lib/operations/appServiceEnvironments.js @@ -48,12 +48,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { 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.'); } @@ -66,7 +68,7 @@ function _list(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/hostingEnvironments'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -108,12 +110,13 @@ function _list(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) { @@ -185,7 +188,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -208,6 +210,9 @@ function _listByResourceGroup(resourceGroupName, options, callback) { 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.'); } @@ -221,7 +226,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -263,12 +268,13 @@ function _listByResourceGroup(resourceGroupName, 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) { @@ -342,7 +348,6 @@ function _get(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -368,6 +373,9 @@ function _get(resourceGroupName, name, options, callback) { 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.'); } @@ -382,7 +390,7 @@ function _get(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -424,12 +432,13 @@ function _get(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) { @@ -549,6 +558,15 @@ function _get(resourceGroupName, name, options, callback) { * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User * added ip ranges to whitelist on ASE db * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. * * @param {string} hostingEnvironmentEnvelope.location Resource Location. @@ -780,6 +798,15 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User * added ip ranges to whitelist on ASE db * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -811,7 +838,6 @@ function _update(resourceGroupName, name, hostingEnvironmentEnvelope, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -840,6 +866,9 @@ function _update(resourceGroupName, name, hostingEnvironmentEnvelope, options, c 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.'); } @@ -854,7 +883,7 @@ function _update(resourceGroupName, name, hostingEnvironmentEnvelope, options, c requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1008,7 +1037,6 @@ function _listCapacities(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1034,6 +1062,9 @@ function _listCapacities(resourceGroupName, name, options, callback) { 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.'); } @@ -1048,7 +1079,7 @@ function _listCapacities(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1090,12 +1121,13 @@ function _listCapacities(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) { @@ -1168,7 +1200,6 @@ function _listVips(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1194,6 +1225,9 @@ function _listVips(resourceGroupName, name, options, callback) { 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.'); } @@ -1208,7 +1242,7 @@ function _listVips(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1250,12 +1284,13 @@ function _listVips(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) { @@ -1290,6 +1325,93 @@ function _listVips(resourceGroupName, name, options, callback) { }); } + +/** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} vnetInfo Details for the new virtual network. + * + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. + * + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. + * + * @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 _changeVnet(resourceGroupName, name, vnetInfo, 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.beginChangeVnet(resourceGroupName, name, vnetInfo, 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['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 Get diagnostic information for an App Service Environment. * @@ -1327,7 +1449,6 @@ function _listDiagnostics(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1353,6 +1474,9 @@ function _listDiagnostics(resourceGroupName, name, options, callback) { 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.'); } @@ -1367,7 +1491,7 @@ function _listDiagnostics(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1409,12 +1533,13 @@ function _listDiagnostics(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) { @@ -1504,7 +1629,6 @@ function _getDiagnosticsItem(resourceGroupName, name, diagnosticsName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1533,6 +1657,9 @@ function _getDiagnosticsItem(resourceGroupName, name, diagnosticsName, options, 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.'); } @@ -1548,7 +1675,7 @@ function _getDiagnosticsItem(resourceGroupName, name, diagnosticsName, options, requestUrl = requestUrl.replace('{diagnosticsName}', encodeURIComponent(diagnosticsName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1590,12 +1717,13 @@ function _getDiagnosticsItem(resourceGroupName, name, diagnosticsName, 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) { @@ -1668,7 +1796,6 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1694,6 +1821,9 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { 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.'); } @@ -1708,7 +1838,7 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1750,12 +1880,13 @@ function _listMetricDefinitions(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) { @@ -1840,7 +1971,6 @@ function _listMetrics(resourceGroupName, name, options, callback) { } let details = (options && options.details !== undefined) ? options.details : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1872,6 +2002,9 @@ function _listMetrics(resourceGroupName, name, options, callback) { 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.'); } @@ -1892,7 +2025,7 @@ function _listMetrics(resourceGroupName, name, options, callback) { if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1934,12 +2067,13 @@ function _listMetrics(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) { @@ -2012,7 +2146,6 @@ function _listMultiRolePools(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2038,6 +2171,9 @@ function _listMultiRolePools(resourceGroupName, name, options, callback) { 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.'); } @@ -2052,7 +2188,7 @@ function _listMultiRolePools(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2094,12 +2230,13 @@ function _listMultiRolePools(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) { @@ -2172,7 +2309,6 @@ function _getMultiRolePool(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2198,6 +2334,9 @@ function _getMultiRolePool(resourceGroupName, name, options, callback) { 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.'); } @@ -2212,7 +2351,7 @@ function _getMultiRolePool(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2254,12 +2393,13 @@ function _getMultiRolePool(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) { @@ -2517,7 +2657,6 @@ function _updateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2546,6 +2685,9 @@ function _updateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, op 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.'); } @@ -2560,7 +2702,7 @@ function _updateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, op requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2716,7 +2858,6 @@ function _listMultiRolePoolInstanceMetricDefinitions(resourceGroupName, name, in if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2745,6 +2886,9 @@ function _listMultiRolePoolInstanceMetricDefinitions(resourceGroupName, name, in 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.'); } @@ -2760,7 +2904,7 @@ function _listMultiRolePoolInstanceMetricDefinitions(resourceGroupName, name, in requestUrl = requestUrl.replace('{instance}', encodeURIComponent(instance)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2802,12 +2946,13 @@ function _listMultiRolePoolInstanceMetricDefinitions(resourceGroupName, name, in 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) { @@ -2889,7 +3034,6 @@ function _listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, op throw new Error('callback cannot be null.'); } let details = (options && options.details !== undefined) ? options.details : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2921,6 +3065,9 @@ function _listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, op 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.'); } @@ -2939,7 +3086,7 @@ function _listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, op if (details !== null && details !== undefined) { queryParameters.push('details=' + encodeURIComponent(details.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2981,12 +3128,13 @@ function _listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, op 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) { @@ -3061,7 +3209,6 @@ function _listMultiRoleMetricDefinitions(resourceGroupName, name, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3087,6 +3234,9 @@ function _listMultiRoleMetricDefinitions(resourceGroupName, name, options, callb 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.'); } @@ -3101,7 +3251,7 @@ function _listMultiRoleMetricDefinitions(resourceGroupName, name, options, callb requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3143,12 +3293,13 @@ function _listMultiRoleMetricDefinitions(resourceGroupName, name, 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) { @@ -3242,7 +3393,6 @@ function _listMultiRoleMetrics(resourceGroupName, name, options, callback) { let timeGrain = (options && options.timeGrain !== undefined) ? options.timeGrain : undefined; let details = (options && options.details !== undefined) ? options.details : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3283,6 +3433,9 @@ function _listMultiRoleMetrics(resourceGroupName, name, options, callback) { 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.'); } @@ -3312,7 +3465,7 @@ function _listMultiRoleMetrics(resourceGroupName, name, options, callback) { if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3354,12 +3507,13 @@ function _listMultiRoleMetrics(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) { @@ -3432,7 +3586,6 @@ function _listMultiRolePoolSkus(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3458,6 +3611,9 @@ function _listMultiRolePoolSkus(resourceGroupName, name, options, callback) { 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.'); } @@ -3472,7 +3628,7 @@ function _listMultiRolePoolSkus(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3514,12 +3670,13 @@ function _listMultiRolePoolSkus(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) { @@ -3593,7 +3750,6 @@ function _listMultiRoleUsages(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3619,6 +3775,9 @@ function _listMultiRoleUsages(resourceGroupName, name, options, callback) { 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.'); } @@ -3633,7 +3792,7 @@ function _listMultiRoleUsages(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3675,12 +3834,13 @@ function _listMultiRoleUsages(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) { @@ -3753,7 +3913,6 @@ function _listOperations(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3779,6 +3938,9 @@ function _listOperations(resourceGroupName, name, options, callback) { 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.'); } @@ -3793,7 +3955,7 @@ function _listOperations(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3835,12 +3997,13 @@ function _listOperations(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) { @@ -3926,7 +4089,6 @@ function _reboot(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3952,6 +4114,9 @@ function _reboot(resourceGroupName, name, options, callback) { 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.'); } @@ -3966,7 +4131,7 @@ function _reboot(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4151,7 +4316,6 @@ function _listAppServicePlans(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4177,6 +4341,9 @@ function _listAppServicePlans(resourceGroupName, name, options, callback) { 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.'); } @@ -4191,7 +4358,7 @@ function _listAppServicePlans(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4233,12 +4400,13 @@ function _listAppServicePlans(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) { @@ -4315,7 +4483,6 @@ function _listWebApps(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let propertiesToInclude = (options && options.propertiesToInclude !== undefined) ? options.propertiesToInclude : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4344,6 +4511,9 @@ function _listWebApps(resourceGroupName, name, options, callback) { 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.'); } @@ -4361,7 +4531,7 @@ function _listWebApps(resourceGroupName, name, options, callback) { if (propertiesToInclude !== null && propertiesToInclude !== undefined) { queryParameters.push('propertiesToInclude=' + encodeURIComponent(propertiesToInclude)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4403,12 +4573,13 @@ function _listWebApps(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) { @@ -4570,7 +4741,6 @@ function _listUsages(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4599,6 +4769,9 @@ function _listUsages(resourceGroupName, name, options, callback) { 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.'); } @@ -4616,7 +4789,7 @@ function _listUsages(resourceGroupName, name, options, callback) { if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4658,12 +4831,13 @@ function _listUsages(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) { @@ -4736,7 +4910,6 @@ function _listWorkerPools(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4762,6 +4935,9 @@ function _listWorkerPools(resourceGroupName, name, options, callback) { 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.'); } @@ -4776,7 +4952,7 @@ function _listWorkerPools(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4818,12 +4994,13 @@ function _listWorkerPools(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) { @@ -4898,7 +5075,6 @@ function _getWorkerPool(resourceGroupName, name, workerPoolName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4927,6 +5103,9 @@ function _getWorkerPool(resourceGroupName, name, workerPoolName, options, callba 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.'); } @@ -4942,7 +5121,7 @@ function _getWorkerPool(resourceGroupName, name, workerPoolName, options, callba requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4984,12 +5163,13 @@ function _getWorkerPool(resourceGroupName, name, workerPoolName, 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) { @@ -5251,7 +5431,6 @@ function _updateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEn if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5283,6 +5462,9 @@ function _updateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEn 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.'); } @@ -5298,7 +5480,7 @@ function _updateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEn requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5456,7 +5638,6 @@ function _listWorkerPoolInstanceMetricDefinitions(resourceGroupName, name, worke if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5488,6 +5669,9 @@ function _listWorkerPoolInstanceMetricDefinitions(resourceGroupName, name, worke 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.'); } @@ -5504,7 +5688,7 @@ function _listWorkerPoolInstanceMetricDefinitions(resourceGroupName, name, worke requestUrl = requestUrl.replace('{instance}', encodeURIComponent(instance)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5546,12 +5730,13 @@ function _listWorkerPoolInstanceMetricDefinitions(resourceGroupName, name, worke 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) { @@ -5642,7 +5827,6 @@ function _listWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, } let details = (options && options.details !== undefined) ? options.details : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5680,6 +5864,9 @@ function _listWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, 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.'); } @@ -5702,7 +5889,7 @@ function _listWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5744,12 +5931,13 @@ function _listWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, 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) { @@ -5826,7 +6014,6 @@ function _listWebWorkerMetricDefinitions(resourceGroupName, name, workerPoolName if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5855,6 +6042,9 @@ function _listWebWorkerMetricDefinitions(resourceGroupName, name, workerPoolName 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.'); } @@ -5870,7 +6060,7 @@ function _listWebWorkerMetricDefinitions(resourceGroupName, name, workerPoolName requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5912,12 +6102,13 @@ function _listWebWorkerMetricDefinitions(resourceGroupName, name, workerPoolName 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) { @@ -6006,7 +6197,6 @@ function _listWebWorkerMetrics(resourceGroupName, name, workerPoolName, options, } let details = (options && options.details !== undefined) ? options.details : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6041,6 +6231,9 @@ function _listWebWorkerMetrics(resourceGroupName, name, workerPoolName, options, 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.'); } @@ -6062,7 +6255,7 @@ function _listWebWorkerMetrics(resourceGroupName, name, workerPoolName, options, if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6104,12 +6297,13 @@ function _listWebWorkerMetrics(resourceGroupName, name, workerPoolName, 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) { @@ -6184,7 +6378,6 @@ function _listWorkerPoolSkus(resourceGroupName, name, workerPoolName, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6213,6 +6406,9 @@ function _listWorkerPoolSkus(resourceGroupName, name, workerPoolName, options, c 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.'); } @@ -6228,7 +6424,7 @@ function _listWorkerPoolSkus(resourceGroupName, name, workerPoolName, options, c requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6270,12 +6466,13 @@ function _listWorkerPoolSkus(resourceGroupName, name, workerPoolName, options, c 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) { @@ -6350,7 +6547,6 @@ function _listWebWorkerUsages(resourceGroupName, name, workerPoolName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6379,6 +6575,9 @@ function _listWebWorkerUsages(resourceGroupName, name, workerPoolName, options, 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.'); } @@ -6394,7 +6593,7 @@ function _listWebWorkerUsages(resourceGroupName, name, workerPoolName, options, requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6436,12 +6635,13 @@ function _listWebWorkerUsages(resourceGroupName, name, workerPoolName, 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) { @@ -6560,6 +6760,15 @@ function _listWebWorkerUsages(resourceGroupName, name, workerPoolName, options, * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User * added ip ranges to whitelist on ASE db * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. * * @param {string} hostingEnvironmentEnvelope.location Resource Location. @@ -6595,7 +6804,6 @@ function _beginCreateOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelop if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6624,6 +6832,9 @@ function _beginCreateOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelop 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.'); } @@ -6638,7 +6849,7 @@ function _beginCreateOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelop requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6793,7 +7004,6 @@ function _beginDeleteMethod(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let forceDelete = (options && options.forceDelete !== undefined) ? options.forceDelete : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6822,6 +7032,9 @@ function _beginDeleteMethod(resourceGroupName, name, options, callback) { 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.'); } @@ -6839,7 +7052,7 @@ function _beginDeleteMethod(resourceGroupName, name, options, callback) { if (forceDelete !== null && forceDelete !== undefined) { queryParameters.push('forceDelete=' + encodeURIComponent(forceDelete.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6905,30 +7118,233 @@ function _beginDeleteMethod(resourceGroupName, name, options, callback) { } /** - * @summary Create or update a multi-role pool. + * @summary Move an App Service Environment to a different VNET. * - * Create or update a multi-role pool. + * Move an App Service Environment to a different VNET. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the App Service Environment. * - * @param {object} multiRolePoolEnvelope Properties of the multi-role pool. + * @param {object} vnetInfo Details for the new virtual network. * - * @param {number} [multiRolePoolEnvelope.workerSizeId] Worker size ID for - * referencing this worker pool. + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. * - * @param {string} [multiRolePoolEnvelope.computeMode] Shared or dedicated app - * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. * - * @param {string} [multiRolePoolEnvelope.workerSize] VM size of the worker - * pool instances. + * @param {object} [options] Optional Parameters. * - * @param {number} [multiRolePoolEnvelope.workerCount] Number of instances in - * the worker pool. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [multiRolePoolEnvelope.sku] + * @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 _beginChangeVnet(resourceGroupName, name, vnetInfo, 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 (vnetInfo === null || vnetInfo === undefined) { + throw new Error('vnetInfo 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/hostingEnvironments/{name}/changeVirtualNetwork'; + 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]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (vnetInfo !== null && vnetInfo !== undefined) { + let requestModelMapper = new client.models['VirtualNetworkProfile']().mapper(); + requestModel = client.serialize(requestModelMapper, vnetInfo, 'vnetInfo'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(vnetInfo, 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) { + 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); + } + } + // 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['WebAppCollection']().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 Create or update a multi-role pool. + * + * Create or update a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} multiRolePoolEnvelope Properties of the multi-role pool. + * + * @param {number} [multiRolePoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [multiRolePoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [multiRolePoolEnvelope.workerSize] VM size of the worker + * pool instances. + * + * @param {number} [multiRolePoolEnvelope.workerCount] Number of instances in + * the worker pool. + * + * @param {object} [multiRolePoolEnvelope.sku] * * @param {string} [multiRolePoolEnvelope.sku.name] Name of the resource SKU. * @@ -6994,7 +7410,6 @@ function _beginCreateOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoo if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7023,6 +7438,9 @@ function _beginCreateOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoo 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.'); } @@ -7037,7 +7455,7 @@ function _beginCreateOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoo requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -7188,7 +7606,6 @@ function _beginResume(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7214,6 +7631,9 @@ function _beginResume(resourceGroupName, name, options, callback) { 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.'); } @@ -7228,7 +7648,7 @@ function _beginResume(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -7270,12 +7690,13 @@ function _beginResume(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) { @@ -7365,7 +7786,6 @@ function _beginSuspend(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7391,6 +7811,9 @@ function _beginSuspend(resourceGroupName, name, options, callback) { 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.'); } @@ -7405,7 +7828,7 @@ function _beginSuspend(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -7447,12 +7870,13 @@ function _beginSuspend(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) { @@ -7596,7 +8020,6 @@ function _beginCreateOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7628,6 +8051,9 @@ function _beginCreateOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, 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.'); } @@ -7643,7 +8069,7 @@ function _beginCreateOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -7846,12 +8272,13 @@ function _listNext(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) { @@ -7976,12 +8403,13 @@ function _listByResourceGroupNext(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) { @@ -8108,12 +8536,13 @@ function _listCapacitiesNext(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) { @@ -8148,6 +8577,85 @@ function _listCapacitiesNext(nextPageLink, options, callback) { }); } + +/** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @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 _changeVnetNext(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.'); + } + + // Send request + this.beginChangeVnetNext(nextPageLink, 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['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 Get global metrics of an App Service Environment. * @@ -8238,12 +8746,13 @@ function _listMetricsNext(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) { @@ -8367,12 +8876,13 @@ function _listMultiRolePoolsNext(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) { @@ -8499,12 +9009,13 @@ function _listMultiRolePoolInstanceMetricDefinitionsNext(nextPageLink, 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) { @@ -8631,12 +9142,13 @@ function _listMultiRolePoolInstanceMetricsNext(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) { @@ -8762,12 +9274,13 @@ function _listMultiRoleMetricDefinitionsNext(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) { @@ -8892,12 +9405,13 @@ function _listMultiRoleMetricsNext(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) { @@ -9021,12 +9535,13 @@ function _listMultiRolePoolSkusNext(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) { @@ -9151,12 +9666,13 @@ function _listMultiRoleUsagesNext(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) { @@ -9360,12 +9876,13 @@ function _listAppServicePlansNext(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) { @@ -9489,12 +10006,13 @@ function _listWebAppsNext(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) { @@ -9628,14 +10146,144 @@ function _suspendNext(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 CsmUsageQuotaCollection} 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 _listUsagesNext(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['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 Get all worker pools of an App Service Environment. + * + * Get all worker pools of an App Service Environment. + * + * @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 WorkerPoolCollection} 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 _listUsagesNext(nextPageLink, options, callback) { +function _listWorkerPoolsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9698,12 +10346,13 @@ function _listUsagesNext(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) { @@ -9723,7 +10372,7 @@ function _listUsagesNext(nextPageLink, 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['WorkerPoolCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -9739,9 +10388,11 @@ function _listUsagesNext(nextPageLink, options, callback) { } /** - * @summary Get all worker pools of an App Service Environment. + * @summary Get metric definitions for a specific instance of a worker pool of + * an App Service Environment. * - * Get all worker pools of an App Service Environment. + * Get metric definitions for a specific instance of a worker pool of an App + * Service Environment. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -9758,13 +10409,14 @@ function _listUsagesNext(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 WorkerPoolCollection} for more information. + * 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 _listWorkerPoolsNext(nextPageLink, options, callback) { +function _listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9827,12 +10479,13 @@ function _listWorkerPoolsNext(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) { @@ -9852,7 +10505,7 @@ function _listWorkerPoolsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WorkerPoolCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -9868,12 +10521,12 @@ function _listWorkerPoolsNext(nextPageLink, options, callback) { } /** - * @summary Get metric definitions for a specific instance of a worker pool of - * an App Service Environment. - * - * Get metric definitions for a specific instance of a worker pool of an App + * @summary Get metrics for a specific instance of a worker pool of an App * Service Environment. * + * Get metrics for a specific instance of a worker pool of an App Service + * Environment. + * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * @@ -9889,14 +10542,14 @@ function _listWorkerPoolsNext(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 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 _listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink, options, callback) { +function _listWorkerPoolInstanceMetricsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9959,12 +10612,13 @@ function _listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink, options, cal 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) { @@ -9984,7 +10638,7 @@ function _listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink, options, cal 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['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10000,12 +10654,11 @@ function _listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink, options, cal } /** - * @summary Get metrics for a specific instance of a worker pool of an App - * Service Environment. - * - * Get metrics for a specific instance of a worker pool of an App Service + * @summary Get metric definitions for a worker pool of an App Service * Environment. * + * Get metric definitions for a worker pool of an App Service Environment. + * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * @@ -10021,14 +10674,14 @@ function _listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink, 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 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 _listWorkerPoolInstanceMetricsNext(nextPageLink, options, callback) { +function _listWebWorkerMetricDefinitionsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10091,12 +10744,13 @@ function _listWorkerPoolInstanceMetricsNext(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) { @@ -10116,7 +10770,7 @@ function _listWorkerPoolInstanceMetricsNext(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) { @@ -10132,10 +10786,11 @@ function _listWorkerPoolInstanceMetricsNext(nextPageLink, options, callback) { } /** - * @summary Get metric definitions for a worker pool of an App Service - * Environment. + * @summary Get metrics for a worker pool of a AppServiceEnvironment (App + * Service Environment). * - * Get metric definitions for a worker pool of an App Service Environment. + * Get metrics for a worker pool of a AppServiceEnvironment (App Service + * Environment). * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -10152,14 +10807,14 @@ function _listWorkerPoolInstanceMetricsNext(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 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 _listWebWorkerMetricDefinitionsNext(nextPageLink, options, callback) { +function _listWebWorkerMetricsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10222,12 +10877,13 @@ function _listWebWorkerMetricDefinitionsNext(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) { @@ -10247,7 +10903,7 @@ function _listWebWorkerMetricDefinitionsNext(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['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10263,11 +10919,9 @@ function _listWebWorkerMetricDefinitionsNext(nextPageLink, options, callback) { } /** - * @summary Get metrics for a worker pool of a AppServiceEnvironment (App - * Service Environment). + * @summary Get available SKUs for scaling a worker pool. * - * Get metrics for a worker pool of a AppServiceEnvironment (App Service - * Environment). + * Get available SKUs for scaling a worker pool. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -10284,14 +10938,13 @@ function _listWebWorkerMetricDefinitionsNext(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 SkuInfoCollection} 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 _listWebWorkerMetricsNext(nextPageLink, options, callback) { +function _listWorkerPoolSkusNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10354,12 +11007,13 @@ function _listWebWorkerMetricsNext(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) { @@ -10379,7 +11033,7 @@ function _listWebWorkerMetricsNext(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['SkuInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10395,9 +11049,9 @@ function _listWebWorkerMetricsNext(nextPageLink, options, callback) { } /** - * @summary Get available SKUs for scaling a worker pool. + * @summary Get usage metrics for a worker pool of an App Service Environment. * - * Get available SKUs for scaling a worker pool. + * Get usage metrics for a worker pool of an App Service Environment. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -10414,13 +11068,13 @@ function _listWebWorkerMetricsNext(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 SkuInfoCollection} for more information. + * See {@link UsageCollection} 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 _listWorkerPoolSkusNext(nextPageLink, options, callback) { +function _listWebWorkerUsagesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10483,12 +11137,13 @@ function _listWorkerPoolSkusNext(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) { @@ -10508,7 +11163,7 @@ function _listWorkerPoolSkusNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SkuInfoCollection']().mapper(); + let resultMapper = new client.models['UsageCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10524,9 +11179,9 @@ function _listWorkerPoolSkusNext(nextPageLink, options, callback) { } /** - * @summary Get usage metrics for a worker pool of an App Service Environment. + * @summary Move an App Service Environment to a different VNET. * - * Get usage metrics for a worker pool of an App Service Environment. + * Move an App Service Environment to a different VNET. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -10543,13 +11198,13 @@ function _listWorkerPoolSkusNext(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 UsageCollection} 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 _listWebWorkerUsagesNext(nextPageLink, options, callback) { +function _beginChangeVnetNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10577,7 +11232,7 @@ function _listWebWorkerUsagesNext(nextPageLink, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -10602,7 +11257,7 @@ function _listWebWorkerUsagesNext(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); @@ -10612,12 +11267,13 @@ function _listWebWorkerUsagesNext(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) { @@ -10637,7 +11293,7 @@ function _listWebWorkerUsagesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['UsageCollection']().mapper(); + let resultMapper = new client.models['WebAppCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10647,6 +11303,23 @@ function _listWebWorkerUsagesNext(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 = new client.models['WebAppCollection']().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); }); @@ -10741,12 +11414,13 @@ function _beginResumeNext(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) { @@ -10887,12 +11561,13 @@ function _beginSuspendNext(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) { @@ -10960,6 +11635,7 @@ class AppServiceEnvironments { this._update = _update; this._listCapacities = _listCapacities; this._listVips = _listVips; + this._changeVnet = _changeVnet; this._listDiagnostics = _listDiagnostics; this._getDiagnosticsItem = _getDiagnosticsItem; this._listMetricDefinitions = _listMetricDefinitions; @@ -10993,6 +11669,7 @@ class AppServiceEnvironments { this._listWebWorkerUsages = _listWebWorkerUsages; this._beginCreateOrUpdate = _beginCreateOrUpdate; this._beginDeleteMethod = _beginDeleteMethod; + this._beginChangeVnet = _beginChangeVnet; this._beginCreateOrUpdateMultiRolePool = _beginCreateOrUpdateMultiRolePool; this._beginResume = _beginResume; this._beginSuspend = _beginSuspend; @@ -11000,6 +11677,7 @@ class AppServiceEnvironments { this._listNext = _listNext; this._listByResourceGroupNext = _listByResourceGroupNext; this._listCapacitiesNext = _listCapacitiesNext; + this._changeVnetNext = _changeVnetNext; this._listMetricsNext = _listMetricsNext; this._listMultiRolePoolsNext = _listMultiRolePoolsNext; this._listMultiRolePoolInstanceMetricDefinitionsNext = _listMultiRolePoolInstanceMetricDefinitionsNext; @@ -11020,6 +11698,7 @@ class AppServiceEnvironments { this._listWebWorkerMetricsNext = _listWebWorkerMetricsNext; this._listWorkerPoolSkusNext = _listWorkerPoolSkusNext; this._listWebWorkerUsagesNext = _listWebWorkerUsagesNext; + this._beginChangeVnetNext = _beginChangeVnetNext; this._beginResumeNext = _beginResumeNext; this._beginSuspendNext = _beginSuspendNext; } @@ -11373,6 +12052,15 @@ class AppServiceEnvironments { * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User * added ip ranges to whitelist on ASE db * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. * * @param {string} hostingEnvironmentEnvelope.location Resource Location. @@ -11488,6 +12176,15 @@ class AppServiceEnvironments { * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User * added ip ranges to whitelist on ASE db * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. * * @param {string} hostingEnvironmentEnvelope.location Resource Location. @@ -11725,6 +12422,15 @@ class AppServiceEnvironments { * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User * added ip ranges to whitelist on ASE db * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -11836,6 +12542,15 @@ class AppServiceEnvironments { * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User * added ip ranges to whitelist on ASE db * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -12055,7 +12770,111 @@ class AppServiceEnvironments { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listVips(resourceGroupName, name, options, optionalCallback) { + listVips(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._listVips(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listVips(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} vnetInfo Details for the new virtual network. + * + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. + * + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. + * + * @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. + */ + changeVnetWithHttpOperationResponse(resourceGroupName, name, vnetInfo, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._changeVnet(resourceGroupName, name, vnetInfo, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} vnetInfo Details for the new virtual network. + * + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. + * + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. + * + * @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 {WebAppCollection} - 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 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. + */ + changeVnet(resourceGroupName, name, vnetInfo, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -12064,14 +12883,14 @@ class AppServiceEnvironments { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listVips(resourceGroupName, name, options, (err, result, request, response) => { + self._changeVnet(resourceGroupName, name, vnetInfo, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listVips(resourceGroupName, name, options, optionalCallback); + return self._changeVnet(resourceGroupName, name, vnetInfo, options, optionalCallback); } } @@ -15628,6 +16447,15 @@ class AppServiceEnvironments { * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User * added ip ranges to whitelist on ASE db * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. * * @param {string} hostingEnvironmentEnvelope.location Resource Location. @@ -15743,6 +16571,15 @@ class AppServiceEnvironments { * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User * added ip ranges to whitelist on ASE db * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. * * @param {string} hostingEnvironmentEnvelope.location Resource Location. @@ -15896,6 +16733,110 @@ class AppServiceEnvironments { } } + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} vnetInfo Details for the new virtual network. + * + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. + * + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. + * + * @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. + */ + beginChangeVnetWithHttpOperationResponse(resourceGroupName, name, vnetInfo, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginChangeVnet(resourceGroupName, name, vnetInfo, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} vnetInfo Details for the new virtual network. + * + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. + * + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. + * + * @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 {WebAppCollection} - 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 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. + */ + beginChangeVnet(resourceGroupName, name, vnetInfo, 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._beginChangeVnet(resourceGroupName, name, vnetInfo, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginChangeVnet(resourceGroupName, name, vnetInfo, options, optionalCallback); + } + } + /** * @summary Create or update a multi-role pool. * @@ -16747,6 +17688,94 @@ class AppServiceEnvironments { } } + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @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. + */ + changeVnetNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._changeVnetNext(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 Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @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 {WebAppCollection} - 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 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. + */ + changeVnetNext(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._changeVnetNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._changeVnetNext(nextPageLink, options, optionalCallback); + } + } + /** * @summary Get global metrics of an App Service Environment. * @@ -18544,6 +19573,94 @@ class AppServiceEnvironments { } } + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @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. + */ + beginChangeVnetNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginChangeVnetNext(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 Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @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 {WebAppCollection} - 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 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. + */ + beginChangeVnetNext(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._beginChangeVnetNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginChangeVnetNext(nextPageLink, options, optionalCallback); + } + } + /** * @summary Resume an App Service Environment. * diff --git a/lib/services/websiteManagement2/lib/operations/appServicePlans.js b/lib/services/websiteManagement2/lib/operations/appServicePlans.js index 418daf0d0c..edd4f486a6 100644 --- a/lib/services/websiteManagement2/lib/operations/appServicePlans.js +++ b/lib/services/websiteManagement2/lib/operations/appServicePlans.js @@ -54,7 +54,6 @@ function _list(options, callback) { throw new Error('callback cannot be null.'); } let detailed = (options && options.detailed !== undefined) ? options.detailed : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (detailed !== null && detailed !== undefined && typeof detailed !== 'boolean') { @@ -63,6 +62,9 @@ function _list(options, callback) { 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.'); } @@ -78,7 +80,7 @@ function _list(options, callback) { if (detailed !== null && detailed !== undefined) { queryParameters.push('detailed=' + encodeURIComponent(detailed.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -120,12 +122,13 @@ function _list(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) { @@ -197,7 +200,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -220,6 +222,9 @@ function _listByResourceGroup(resourceGroupName, options, callback) { 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.'); } @@ -233,7 +238,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -275,12 +280,13 @@ function _listByResourceGroup(resourceGroupName, 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) { @@ -353,7 +359,6 @@ function _get(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -379,6 +384,9 @@ function _get(resourceGroupName, name, options, callback) { 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.'); } @@ -393,7 +401,7 @@ function _get(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -488,9 +496,6 @@ function _get(resourceGroupName, name, options, callback) { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -514,9 +519,15 @@ function _get(resourceGroupName, name, options, callback) { * @param {date} [appServicePlan.spotExpirationTime] The time when the server * farm expires. Valid only if it is a spot server farm. * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * * @param {boolean} [appServicePlan.reserved] If Linux app service plan * true, false otherwise. * + * @param {boolean} [appServicePlan.isXenon] If Hyper-V container app service + * plan true, false otherwise. + * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. @@ -668,7 +679,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -694,6 +704,9 @@ function _deleteMethod(resourceGroupName, name, options, callback) { 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.'); } @@ -708,7 +721,7 @@ function _deleteMethod(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -785,9 +798,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanPatchResourceName Name for the - * App Service plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -811,9 +821,15 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * @param {date} [appServicePlan.spotExpirationTime] The time when the server * farm expires. Valid only if it is a spot server farm. * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * * @param {boolean} [appServicePlan.reserved] If Linux app service plan * true, false otherwise. * + * @param {boolean} [appServicePlan.isXenon] If Hyper-V container app service + * plan true, false otherwise. + * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. @@ -848,7 +864,6 @@ function _update(resourceGroupName, name, appServicePlan, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -877,6 +892,9 @@ function _update(resourceGroupName, name, appServicePlan, options, callback) { 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.'); } @@ -891,7 +909,7 @@ function _update(resourceGroupName, name, appServicePlan, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -947,12 +965,13 @@ function _update(resourceGroupName, name, appServicePlan, 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) { @@ -1041,7 +1060,6 @@ function _listCapabilities(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1067,6 +1085,9 @@ function _listCapabilities(resourceGroupName, name, options, callback) { 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.'); } @@ -1081,7 +1102,7 @@ function _listCapabilities(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1123,12 +1144,13 @@ function _listCapabilities(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) { @@ -1219,7 +1241,6 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1251,6 +1272,9 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, 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.'); } @@ -1267,7 +1291,7 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1309,12 +1333,13 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, 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) { @@ -1390,7 +1415,6 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1422,6 +1446,9 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa 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.'); } @@ -1438,7 +1465,7 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1545,7 +1572,6 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1577,6 +1603,9 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay 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.'); } @@ -1593,7 +1622,7 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1635,12 +1664,13 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay 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) { @@ -1717,7 +1747,6 @@ function _listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1749,6 +1778,9 @@ function _listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, 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.'); } @@ -1765,7 +1797,7 @@ function _listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1807,12 +1839,13 @@ function _listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, 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) { @@ -1887,7 +1920,6 @@ function _getHybridConnectionPlanLimit(resourceGroupName, name, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1913,6 +1945,9 @@ function _getHybridConnectionPlanLimit(resourceGroupName, name, options, callbac 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.'); } @@ -1927,7 +1962,7 @@ function _getHybridConnectionPlanLimit(resourceGroupName, name, options, callbac requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1969,12 +2004,13 @@ function _getHybridConnectionPlanLimit(resourceGroupName, name, options, callbac 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) { @@ -2048,7 +2084,6 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2074,6 +2109,9 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { 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.'); } @@ -2088,7 +2126,7 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2130,12 +2168,13 @@ function _listHybridConnections(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) { @@ -2211,7 +2250,6 @@ function _listMetricDefintions(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2237,6 +2275,9 @@ function _listMetricDefintions(resourceGroupName, name, options, callback) { 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.'); } @@ -2251,7 +2292,7 @@ function _listMetricDefintions(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2293,12 +2334,13 @@ function _listMetricDefintions(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) { @@ -2383,7 +2425,6 @@ function _listMetrics(resourceGroupName, name, options, callback) { } let details = (options && options.details !== undefined) ? options.details : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2415,6 +2456,9 @@ function _listMetrics(resourceGroupName, name, options, callback) { 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.'); } @@ -2435,7 +2479,7 @@ function _listMetrics(resourceGroupName, name, options, callback) { if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2477,12 +2521,13 @@ function _listMetrics(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) { @@ -2560,7 +2605,6 @@ function _restartWebApps(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let softRestart = (options && options.softRestart !== undefined) ? options.softRestart : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2589,6 +2633,9 @@ function _restartWebApps(resourceGroupName, name, options, callback) { 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.'); } @@ -2606,7 +2653,7 @@ function _restartWebApps(resourceGroupName, name, options, callback) { if (softRestart !== null && softRestart !== undefined) { queryParameters.push('softRestart=' + encodeURIComponent(softRestart.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2723,7 +2770,6 @@ function _listWebApps(resourceGroupName, name, options, callback) { let skipToken = (options && options.skipToken !== undefined) ? options.skipToken : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; let top = (options && options.top !== undefined) ? options.top : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2758,6 +2804,9 @@ function _listWebApps(resourceGroupName, name, options, callback) { 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.'); } @@ -2781,7 +2830,7 @@ function _listWebApps(resourceGroupName, name, options, callback) { if (top !== null && top !== undefined) { queryParameters.push('$top=' + encodeURIComponent(top)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2823,12 +2872,13 @@ function _listWebApps(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) { @@ -2900,7 +2950,6 @@ function _getServerFarmSkus(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2926,6 +2975,9 @@ function _getServerFarmSkus(resourceGroupName, name, options, callback) { 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.'); } @@ -2940,7 +2992,7 @@ function _getServerFarmSkus(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2982,12 +3034,13 @@ function _getServerFarmSkus(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) { @@ -3072,7 +3125,6 @@ function _listUsages(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3101,6 +3153,9 @@ function _listUsages(resourceGroupName, name, options, callback) { 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.'); } @@ -3118,7 +3173,7 @@ function _listUsages(resourceGroupName, name, options, callback) { if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3160,12 +3215,13 @@ function _listUsages(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) { @@ -3237,7 +3293,6 @@ function _listVnets(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3263,6 +3318,9 @@ function _listVnets(resourceGroupName, name, options, callback) { 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.'); } @@ -3277,7 +3335,7 @@ function _listVnets(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3319,12 +3377,13 @@ function _listVnets(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) { @@ -3413,7 +3472,6 @@ function _getVnetFromServerFarm(resourceGroupName, name, vnetName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3442,6 +3500,9 @@ function _getVnetFromServerFarm(resourceGroupName, name, vnetName, options, call 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.'); } @@ -3457,7 +3518,7 @@ function _getVnetFromServerFarm(resourceGroupName, name, vnetName, options, call requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3582,7 +3643,6 @@ function _getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3614,6 +3674,9 @@ function _getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options 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.'); } @@ -3630,7 +3693,7 @@ function _getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3672,12 +3735,13 @@ function _getVnetGateway(resourceGroupName, name, vnetName, gatewayName, 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) { @@ -3764,7 +3828,6 @@ function _updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, conn if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3799,6 +3862,9 @@ function _updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, conn 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.'); } @@ -3815,7 +3881,7 @@ function _updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, conn requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3871,12 +3937,13 @@ function _updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, conn 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) { @@ -3952,7 +4019,6 @@ function _listRoutesForVnet(resourceGroupName, name, vnetName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3981,6 +4047,9 @@ function _listRoutesForVnet(resourceGroupName, name, vnetName, options, callback 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.'); } @@ -3996,7 +4065,7 @@ function _listRoutesForVnet(resourceGroupName, name, vnetName, options, callback requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4038,12 +4107,13 @@ function _listRoutesForVnet(resourceGroupName, name, vnetName, 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) { @@ -4133,7 +4203,6 @@ function _getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4165,6 +4234,9 @@ function _getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, 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.'); } @@ -4181,7 +4253,7 @@ function _getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4293,9 +4365,6 @@ function _getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @param {string} [route.startAddress] The starting address for this route. * This may also include a CIDR notation, in which case the end address must * not be specified. @@ -4342,7 +4411,6 @@ function _createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4377,6 +4445,9 @@ function _createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, 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.'); } @@ -4393,7 +4464,7 @@ function _createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4530,7 +4601,6 @@ function _deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4562,6 +4632,9 @@ function _deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, 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.'); } @@ -4578,7 +4651,7 @@ function _deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4659,9 +4732,6 @@ function _deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @param {string} [route.startAddress] The starting address for this route. * This may also include a CIDR notation, in which case the end address must * not be specified. @@ -4708,7 +4778,6 @@ function _updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4743,6 +4812,9 @@ function _updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, o 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.'); } @@ -4759,7 +4831,7 @@ function _updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, o requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4895,7 +4967,6 @@ function _rebootWorker(resourceGroupName, name, workerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4924,6 +4995,9 @@ function _rebootWorker(resourceGroupName, name, workerName, options, callback) { 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.'); } @@ -4939,7 +5013,7 @@ function _rebootWorker(resourceGroupName, name, workerName, options, callback) { requestUrl = requestUrl.replace('{workerName}', encodeURIComponent(workerName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5016,9 +5090,6 @@ function _rebootWorker(resourceGroupName, name, workerName, options, callback) { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -5042,9 +5113,15 @@ function _rebootWorker(resourceGroupName, name, workerName, options, callback) { * @param {date} [appServicePlan.spotExpirationTime] The time when the server * farm expires. Valid only if it is a spot server farm. * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * * @param {boolean} [appServicePlan.reserved] If Linux app service plan * true, false otherwise. * + * @param {boolean} [appServicePlan.isXenon] If Hyper-V container app service + * plan true, false otherwise. + * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. @@ -5117,7 +5194,6 @@ function _beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5146,6 +5222,9 @@ function _beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, 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.'); } @@ -5160,7 +5239,7 @@ function _beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5216,12 +5295,13 @@ function _beginCreateOrUpdate(resourceGroupName, name, appServicePlan, 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) { @@ -5363,12 +5443,13 @@ function _listNext(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) { @@ -5493,12 +5574,13 @@ function _listByResourceGroupNext(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) { @@ -5622,12 +5704,13 @@ function _listWebAppsByHybridConnectionNext(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) { @@ -5752,12 +5835,13 @@ function _listHybridConnectionsNext(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) { @@ -5884,12 +5968,13 @@ function _listMetricDefintionsNext(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) { @@ -6014,12 +6099,13 @@ function _listMetricsNext(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) { @@ -6143,12 +6229,13 @@ function _listWebAppsNext(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) { @@ -6273,12 +6360,13 @@ function _listUsagesNext(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) { @@ -6647,9 +6735,6 @@ class AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -6673,9 +6758,15 @@ class AppServicePlans { * @param {date} [appServicePlan.spotExpirationTime] The time when the server * farm expires. Valid only if it is a spot server farm. * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * * @param {boolean} [appServicePlan.reserved] If Linux app service plan * true, false otherwise. * + * @param {boolean} [appServicePlan.isXenon] If Hyper-V container app service + * plan true, false otherwise. + * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. @@ -6757,9 +6848,6 @@ class AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -6783,9 +6871,15 @@ class AppServicePlans { * @param {date} [appServicePlan.spotExpirationTime] The time when the server * farm expires. Valid only if it is a spot server farm. * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * * @param {boolean} [appServicePlan.reserved] If Linux app service plan * true, false otherwise. * + * @param {boolean} [appServicePlan.isXenon] If Hyper-V container app service + * plan true, false otherwise. + * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. @@ -6980,9 +7074,6 @@ class AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanPatchResourceName Name for the - * App Service plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -7006,9 +7097,15 @@ class AppServicePlans { * @param {date} [appServicePlan.spotExpirationTime] The time when the server * farm expires. Valid only if it is a spot server farm. * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * * @param {boolean} [appServicePlan.reserved] If Linux app service plan * true, false otherwise. * + * @param {boolean} [appServicePlan.isXenon] If Hyper-V container app service + * plan true, false otherwise. + * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. @@ -7052,9 +7149,6 @@ class AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanPatchResourceName Name for the - * App Service plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -7078,9 +7172,15 @@ class AppServicePlans { * @param {date} [appServicePlan.spotExpirationTime] The time when the server * farm expires. Valid only if it is a spot server farm. * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * * @param {boolean} [appServicePlan.reserved] If Linux app service plan * true, false otherwise. * + * @param {boolean} [appServicePlan.isXenon] If Hyper-V container app service + * plan true, false otherwise. + * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. @@ -9050,9 +9150,6 @@ class AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @param {string} [route.startAddress] The starting address for this route. * This may also include a CIDR notation, in which case the end address must * not be specified. @@ -9112,9 +9209,6 @@ class AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @param {string} [route.startAddress] The starting address for this route. * This may also include a CIDR notation, in which case the end address must * not be specified. @@ -9295,9 +9389,6 @@ class AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @param {string} [route.startAddress] The starting address for this route. * This may also include a CIDR notation, in which case the end address must * not be specified. @@ -9357,9 +9448,6 @@ class AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @param {string} [route.startAddress] The starting address for this route. * This may also include a CIDR notation, in which case the end address must * not be specified. @@ -9534,9 +9622,6 @@ class AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -9560,9 +9645,15 @@ class AppServicePlans { * @param {date} [appServicePlan.spotExpirationTime] The time when the server * farm expires. Valid only if it is a spot server farm. * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * * @param {boolean} [appServicePlan.reserved] If Linux app service plan * true, false otherwise. * + * @param {boolean} [appServicePlan.isXenon] If Hyper-V container app service + * plan true, false otherwise. + * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. @@ -9644,9 +9735,6 @@ class AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -9670,9 +9758,15 @@ class AppServicePlans { * @param {date} [appServicePlan.spotExpirationTime] The time when the server * farm expires. Valid only if it is a spot server farm. * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * * @param {boolean} [appServicePlan.reserved] If Linux app service plan * true, false otherwise. * + * @param {boolean} [appServicePlan.isXenon] If Hyper-V container app service + * plan true, false otherwise. + * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. diff --git a/lib/services/websiteManagement2/lib/operations/certificateRegistrationProvider.js b/lib/services/websiteManagement2/lib/operations/certificateRegistrationProvider.js index d46700b376..14e286327f 100644 --- a/lib/services/websiteManagement2/lib/operations/certificateRegistrationProvider.js +++ b/lib/services/websiteManagement2/lib/operations/certificateRegistrationProvider.js @@ -50,9 +50,11 @@ function _listOperations(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { + 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.'); } @@ -64,7 +66,7 @@ function _listOperations(options, callback) { let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.CertificateRegistration/operations'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -106,12 +108,13 @@ function _listOperations(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) { @@ -238,12 +241,13 @@ function _listOperationsNext(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) { diff --git a/lib/services/websiteManagement2/lib/operations/certificates.js b/lib/services/websiteManagement2/lib/operations/certificates.js index 601943e575..5bda762528 100644 --- a/lib/services/websiteManagement2/lib/operations/certificates.js +++ b/lib/services/websiteManagement2/lib/operations/certificates.js @@ -47,12 +47,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { 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.'); } @@ -65,7 +67,7 @@ function _list(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/certificates'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -107,12 +109,13 @@ function _list(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) { @@ -183,7 +186,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -206,6 +208,9 @@ function _listByResourceGroup(resourceGroupName, options, callback) { 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.'); } @@ -219,7 +224,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -261,12 +266,13 @@ function _listByResourceGroup(resourceGroupName, 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) { @@ -339,7 +345,6 @@ function _get(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -365,6 +370,9 @@ function _get(resourceGroupName, name, options, callback) { 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.'); } @@ -379,7 +387,7 @@ function _get(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -421,12 +429,13 @@ function _get(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) { @@ -524,7 +533,6 @@ function _createOrUpdate(resourceGroupName, name, certificateEnvelope, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -553,6 +561,9 @@ function _createOrUpdate(resourceGroupName, name, certificateEnvelope, options, 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.'); } @@ -567,7 +578,7 @@ function _createOrUpdate(resourceGroupName, name, certificateEnvelope, options, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -623,12 +634,13 @@ function _createOrUpdate(resourceGroupName, name, certificateEnvelope, 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) { @@ -700,7 +712,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -726,6 +737,9 @@ function _deleteMethod(resourceGroupName, name, options, callback) { 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.'); } @@ -740,7 +754,7 @@ function _deleteMethod(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -864,7 +878,6 @@ function _update(resourceGroupName, name, certificateEnvelope, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -893,6 +906,9 @@ function _update(resourceGroupName, name, certificateEnvelope, options, callback 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.'); } @@ -907,7 +923,7 @@ function _update(resourceGroupName, name, certificateEnvelope, options, callback requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -963,12 +979,13 @@ function _update(resourceGroupName, name, certificateEnvelope, 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) { @@ -1092,12 +1109,13 @@ function _listNext(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) { @@ -1221,12 +1239,13 @@ function _listByResourceGroupNext(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) { diff --git a/lib/services/websiteManagement2/lib/operations/deletedWebApps.js b/lib/services/websiteManagement2/lib/operations/deletedWebApps.js index 50d8c1e457..e8f1fec2a2 100644 --- a/lib/services/websiteManagement2/lib/operations/deletedWebApps.js +++ b/lib/services/websiteManagement2/lib/operations/deletedWebApps.js @@ -48,12 +48,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { 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.'); } @@ -66,7 +68,7 @@ function _list(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -108,12 +110,13 @@ function _list(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) { @@ -238,12 +241,13 @@ function _listNext(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) { diff --git a/lib/services/websiteManagement2/lib/operations/diagnostics.js b/lib/services/websiteManagement2/lib/operations/diagnostics.js index c33b53260b..92f387cbf1 100644 --- a/lib/services/websiteManagement2/lib/operations/diagnostics.js +++ b/lib/services/websiteManagement2/lib/operations/diagnostics.js @@ -53,7 +53,6 @@ function _listHostingEnvironmentDetectorResponses(resourceGroupName, name, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -79,6 +78,9 @@ function _listHostingEnvironmentDetectorResponses(resourceGroupName, name, optio 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.'); } @@ -93,7 +95,7 @@ function _listHostingEnvironmentDetectorResponses(resourceGroupName, name, optio requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -135,12 +137,13 @@ function _listHostingEnvironmentDetectorResponses(resourceGroupName, name, optio 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) { @@ -224,7 +227,6 @@ function _getHostingEnvironmentDetectorResponse(resourceGroupName, name, detecto let startTime = (options && options.startTime !== undefined) ? options.startTime : undefined; let endTime = (options && options.endTime !== undefined) ? options.endTime : undefined; let timeGrain = (options && options.timeGrain !== undefined) ? options.timeGrain : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -270,6 +272,9 @@ function _getHostingEnvironmentDetectorResponse(resourceGroupName, name, detecto 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.'); } @@ -294,7 +299,7 @@ function _getHostingEnvironmentDetectorResponse(resourceGroupName, name, detecto if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -336,12 +341,13 @@ function _getHostingEnvironmentDetectorResponse(resourceGroupName, name, detecto 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) { @@ -415,7 +421,6 @@ function _listSiteDetectorResponses(resourceGroupName, siteName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -441,6 +446,9 @@ function _listSiteDetectorResponses(resourceGroupName, siteName, options, callba 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.'); } @@ -455,7 +463,7 @@ function _listSiteDetectorResponses(resourceGroupName, siteName, options, callba requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -497,12 +505,13 @@ function _listSiteDetectorResponses(resourceGroupName, siteName, 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) { @@ -586,7 +595,6 @@ function _getSiteDetectorResponse(resourceGroupName, siteName, detectorName, opt let startTime = (options && options.startTime !== undefined) ? options.startTime : undefined; let endTime = (options && options.endTime !== undefined) ? options.endTime : undefined; let timeGrain = (options && options.timeGrain !== undefined) ? options.timeGrain : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -632,6 +640,9 @@ function _getSiteDetectorResponse(resourceGroupName, siteName, detectorName, opt 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.'); } @@ -656,7 +667,7 @@ function _getSiteDetectorResponse(resourceGroupName, siteName, detectorName, opt if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -698,12 +709,13 @@ function _getSiteDetectorResponse(resourceGroupName, siteName, detectorName, opt 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) { @@ -777,7 +789,6 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -803,6 +814,9 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, cal 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.'); } @@ -817,7 +831,7 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, cal requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -859,12 +873,13 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, cal 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) { @@ -939,7 +954,6 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -968,6 +982,9 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg 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.'); } @@ -983,7 +1000,7 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1025,12 +1042,13 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg 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) { @@ -1106,7 +1124,6 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1135,6 +1152,9 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, opti 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.'); } @@ -1150,7 +1170,7 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, opti requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1192,12 +1212,13 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, 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) { @@ -1274,7 +1295,6 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1306,6 +1326,9 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy 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.'); } @@ -1322,7 +1345,7 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy requestUrl = requestUrl.replace('{analysisName}', encodeURIComponent(analysisName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1364,12 +1387,13 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy 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) { @@ -1455,7 +1479,6 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a let startTime = (options && options.startTime !== undefined) ? options.startTime : undefined; let endTime = (options && options.endTime !== undefined) ? options.endTime : undefined; let timeGrain = (options && options.timeGrain !== undefined) ? options.timeGrain : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1504,6 +1527,9 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a 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.'); } @@ -1529,7 +1555,7 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1571,12 +1597,13 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a 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) { @@ -1652,7 +1679,6 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1681,6 +1707,9 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, opt 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.'); } @@ -1696,7 +1725,7 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, opt requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1738,12 +1767,13 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, opt 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) { @@ -1821,7 +1851,6 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1853,6 +1882,9 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec 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.'); } @@ -1869,7 +1901,7 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec requestUrl = requestUrl.replace('{detectorName}', encodeURIComponent(detectorName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1911,12 +1943,13 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec 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) { @@ -2003,7 +2036,6 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos let startTime = (options && options.startTime !== undefined) ? options.startTime : undefined; let endTime = (options && options.endTime !== undefined) ? options.endTime : undefined; let timeGrain = (options && options.timeGrain !== undefined) ? options.timeGrain : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2052,6 +2084,9 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos 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.'); } @@ -2077,7 +2112,7 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2119,12 +2154,13 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos 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) { @@ -2200,7 +2236,6 @@ function _listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2229,6 +2264,9 @@ function _listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, optio 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.'); } @@ -2244,7 +2282,7 @@ function _listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, optio requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2286,12 +2324,13 @@ function _listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, optio 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) { @@ -2377,7 +2416,6 @@ function _getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, let startTime = (options && options.startTime !== undefined) ? options.startTime : undefined; let endTime = (options && options.endTime !== undefined) ? options.endTime : undefined; let timeGrain = (options && options.timeGrain !== undefined) ? options.timeGrain : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2426,6 +2464,9 @@ function _getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, 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.'); } @@ -2451,7 +2492,7 @@ function _getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2493,12 +2534,13 @@ function _getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, 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) { @@ -2574,7 +2616,6 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2603,6 +2644,9 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op 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.'); } @@ -2618,7 +2662,7 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2660,12 +2704,13 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op 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) { @@ -2742,7 +2787,6 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2774,6 +2818,9 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC 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.'); } @@ -2790,7 +2837,7 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2832,12 +2879,13 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC 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) { @@ -2915,7 +2963,6 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2947,6 +2994,9 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, 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.'); } @@ -2963,7 +3013,7 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3005,12 +3055,13 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, 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) { @@ -3089,7 +3140,6 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3124,6 +3174,9 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a 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.'); } @@ -3141,7 +3194,7 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3183,12 +3236,13 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a 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) { @@ -3276,7 +3330,6 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor let startTime = (options && options.startTime !== undefined) ? options.startTime : undefined; let endTime = (options && options.endTime !== undefined) ? options.endTime : undefined; let timeGrain = (options && options.timeGrain !== undefined) ? options.timeGrain : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3328,6 +3381,9 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor 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.'); } @@ -3354,7 +3410,7 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3396,12 +3452,13 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor 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) { @@ -3479,7 +3536,6 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3511,6 +3567,9 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, 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.'); } @@ -3527,7 +3586,7 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3569,12 +3628,13 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, 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) { @@ -3654,7 +3714,6 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3689,6 +3748,9 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d 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.'); } @@ -3706,7 +3768,7 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3748,12 +3810,13 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d 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) { @@ -3842,7 +3905,6 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia let startTime = (options && options.startTime !== undefined) ? options.startTime : undefined; let endTime = (options && options.endTime !== undefined) ? options.endTime : undefined; let timeGrain = (options && options.timeGrain !== undefined) ? options.timeGrain : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3894,6 +3956,9 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia 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.'); } @@ -3920,7 +3985,7 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3962,12 +4027,13 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia 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) { @@ -4092,12 +4158,13 @@ function _listHostingEnvironmentDetectorResponsesNext(nextPageLink, options, cal 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) { @@ -4222,12 +4289,13 @@ function _listSiteDetectorResponsesNext(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) { @@ -4352,12 +4420,13 @@ function _listSiteDiagnosticCategoriesNext(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) { @@ -4482,12 +4551,13 @@ function _listSiteAnalysesNext(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) { @@ -4612,12 +4682,13 @@ function _listSiteDetectorsNext(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) { @@ -4742,12 +4813,13 @@ function _getSiteDetectorNext(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) { @@ -4872,12 +4944,13 @@ function _listSiteDetectorResponsesSlotNext(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) { @@ -5002,12 +5075,13 @@ function _listSiteDiagnosticCategoriesSlotNext(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) { @@ -5132,12 +5206,13 @@ function _listSiteAnalysesSlotNext(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) { @@ -5262,12 +5337,13 @@ function _listSiteDetectorsSlotNext(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) { @@ -5392,12 +5468,13 @@ function _getSiteDetectorSlotNext(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) { diff --git a/lib/services/websiteManagement2/lib/operations/domainRegistrationProvider.js b/lib/services/websiteManagement2/lib/operations/domainRegistrationProvider.js index 6de060c6f0..15f1b4c10e 100644 --- a/lib/services/websiteManagement2/lib/operations/domainRegistrationProvider.js +++ b/lib/services/websiteManagement2/lib/operations/domainRegistrationProvider.js @@ -50,9 +50,11 @@ function _listOperations(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { + 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.'); } @@ -64,7 +66,7 @@ function _listOperations(options, callback) { let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.DomainRegistration/operations'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -106,12 +108,13 @@ function _listOperations(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) { @@ -238,12 +241,13 @@ function _listOperationsNext(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) { diff --git a/lib/services/websiteManagement2/lib/operations/domains.js b/lib/services/websiteManagement2/lib/operations/domains.js index 87984bef5e..a1222e1242 100644 --- a/lib/services/websiteManagement2/lib/operations/domains.js +++ b/lib/services/websiteManagement2/lib/operations/domains.js @@ -51,12 +51,14 @@ function _checkAvailability(options, callback) { throw new Error('callback cannot be null.'); } let name = (options && options.name !== undefined) ? options.name : undefined; - let apiVersion = '2015-04-01'; // Validate try { 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 (name !== null && name !== undefined && typeof name.valueOf() !== 'string') { throw new Error('name must be of type string.'); } @@ -77,7 +79,7 @@ function _checkAvailability(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -133,12 +135,13 @@ function _checkAvailability(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) { @@ -206,12 +209,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { 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.'); } @@ -224,7 +229,7 @@ function _list(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/domains'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -266,12 +271,13 @@ function _list(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) { @@ -340,12 +346,14 @@ function _getControlCenterSsoRequest(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { 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.'); } @@ -358,7 +366,7 @@ function _getControlCenterSsoRequest(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/generateSsoRequest'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -400,12 +408,13 @@ function _getControlCenterSsoRequest(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) { @@ -483,7 +492,6 @@ function _listRecommendations(parameters, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (parameters === null || parameters === undefined) { @@ -492,6 +500,9 @@ function _listRecommendations(parameters, options, callback) { 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.'); } @@ -504,7 +515,7 @@ function _listRecommendations(parameters, options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -560,12 +571,13 @@ function _listRecommendations(parameters, 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) { @@ -636,7 +648,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -659,6 +670,9 @@ function _listByResourceGroup(resourceGroupName, options, callback) { 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.'); } @@ -672,7 +686,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -714,12 +728,13 @@ function _listByResourceGroup(resourceGroupName, 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) { @@ -792,7 +807,6 @@ function _get(resourceGroupName, domainName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -818,6 +832,9 @@ function _get(resourceGroupName, domainName, options, callback) { 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.'); } @@ -832,7 +849,7 @@ function _get(resourceGroupName, domainName, options, callback) { requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -874,12 +891,13 @@ function _get(resourceGroupName, domainName, 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) { @@ -1117,7 +1135,6 @@ function _deleteMethod(resourceGroupName, domainName, options, callback) { throw new Error('callback cannot be null.'); } let forceHardDeleteDomain = (options && options.forceHardDeleteDomain !== undefined) ? options.forceHardDeleteDomain : undefined; - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1146,6 +1163,9 @@ function _deleteMethod(resourceGroupName, domainName, options, callback) { 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.'); } @@ -1163,7 +1183,7 @@ function _deleteMethod(resourceGroupName, domainName, options, callback) { if (forceHardDeleteDomain !== null && forceHardDeleteDomain !== undefined) { queryParameters.push('forceHardDeleteDomain=' + encodeURIComponent(forceHardDeleteDomain.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1342,7 +1362,6 @@ function _update(resourceGroupName, domainName, domain, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1377,6 +1396,9 @@ function _update(resourceGroupName, domainName, domain, options, callback) { 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.'); } @@ -1391,7 +1413,7 @@ function _update(resourceGroupName, domainName, domain, options, callback) { requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1447,12 +1469,13 @@ function _update(resourceGroupName, domainName, domain, 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) { @@ -1543,7 +1566,6 @@ function _listOwnershipIdentifiers(resourceGroupName, domainName, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1569,6 +1591,9 @@ function _listOwnershipIdentifiers(resourceGroupName, domainName, options, callb 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.'); } @@ -1583,7 +1608,7 @@ function _listOwnershipIdentifiers(resourceGroupName, domainName, options, callb requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1625,12 +1650,13 @@ function _listOwnershipIdentifiers(resourceGroupName, domainName, 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) { @@ -1706,7 +1732,6 @@ function _getOwnershipIdentifier(resourceGroupName, domainName, name, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1735,6 +1760,9 @@ function _getOwnershipIdentifier(resourceGroupName, domainName, name, options, c 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.'); } @@ -1750,7 +1778,7 @@ function _getOwnershipIdentifier(resourceGroupName, domainName, name, options, c requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1792,12 +1820,13 @@ function _getOwnershipIdentifier(resourceGroupName, domainName, name, options, c 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) { @@ -1882,7 +1911,6 @@ function _createOrUpdateOwnershipIdentifier(resourceGroupName, domainName, name, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1914,6 +1942,9 @@ function _createOrUpdateOwnershipIdentifier(resourceGroupName, domainName, name, 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.'); } @@ -1929,7 +1960,7 @@ function _createOrUpdateOwnershipIdentifier(resourceGroupName, domainName, name, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1985,12 +2016,13 @@ function _createOrUpdateOwnershipIdentifier(resourceGroupName, domainName, name, 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) { @@ -2064,7 +2096,6 @@ function _deleteOwnershipIdentifier(resourceGroupName, domainName, name, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2093,6 +2124,9 @@ function _deleteOwnershipIdentifier(resourceGroupName, domainName, name, options 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.'); } @@ -2108,7 +2142,7 @@ function _deleteOwnershipIdentifier(resourceGroupName, domainName, name, options requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2223,7 +2257,6 @@ function _updateOwnershipIdentifier(resourceGroupName, domainName, name, domainO if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2255,6 +2288,9 @@ function _updateOwnershipIdentifier(resourceGroupName, domainName, name, domainO 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.'); } @@ -2270,7 +2306,7 @@ function _updateOwnershipIdentifier(resourceGroupName, domainName, name, domainO requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2326,12 +2362,13 @@ function _updateOwnershipIdentifier(resourceGroupName, domainName, name, domainO 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) { @@ -2403,7 +2440,6 @@ function _renew(resourceGroupName, domainName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2429,6 +2465,9 @@ function _renew(resourceGroupName, domainName, options, callback) { 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.'); } @@ -2443,7 +2482,7 @@ function _renew(resourceGroupName, domainName, options, callback) { requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2475,7 +2514,7 @@ function _renew(resourceGroupName, domainName, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204 && statusCode !== 400 && statusCode !== 500) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2485,13 +2524,12 @@ function _renew(resourceGroupName, domainName, 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['ErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2627,7 +2665,6 @@ function _beginCreateOrUpdate(resourceGroupName, domainName, domain, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2662,6 +2699,9 @@ function _beginCreateOrUpdate(resourceGroupName, domainName, domain, options, ca 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.'); } @@ -2676,7 +2716,7 @@ function _beginCreateOrUpdate(resourceGroupName, domainName, domain, options, ca requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2732,12 +2772,13 @@ function _beginCreateOrUpdate(resourceGroupName, domainName, domain, options, ca 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) { @@ -2878,12 +2919,13 @@ function _listNext(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) { @@ -3008,12 +3050,13 @@ function _listRecommendationsNext(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) { @@ -3137,12 +3180,13 @@ function _listByResourceGroupNext(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) { @@ -3267,12 +3311,13 @@ function _listOwnershipIdentifiersNext(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) { diff --git a/lib/services/websiteManagement2/lib/operations/index.d.ts b/lib/services/websiteManagement2/lib/operations/index.d.ts index 6a0a06d829..6383b5e281 100644 --- a/lib/services/websiteManagement2/lib/operations/index.d.ts +++ b/lib/services/websiteManagement2/lib/operations/index.d.ts @@ -8124,6 +8124,10 @@ export interface Recommendations { * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.expiredOnly] Specify false to return + * all recommendations. The default is true, which returns only + * expired recommendations. + * * @param {string} [options.filter] Filter is specified by using OData syntax. * Example: $filter=channels eq 'Api' or channel eq 'Notification' and * startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' @@ -8138,7 +8142,7 @@ export interface Recommendations { * * @reject {Error|ServiceError} - The error object. */ - listHistoryForWebAppWithHttpOperationResponse(resourceGroupName: string, siteName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listHistoryForWebAppWithHttpOperationResponse(resourceGroupName: string, siteName: string, options?: { expiredOnly? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Get past recommendations for an app, optionally specified by the @@ -8153,6 +8157,10 @@ export interface Recommendations { * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.expiredOnly] Specify false to return + * all recommendations. The default is true, which returns only + * expired recommendations. + * * @param {string} [options.filter] Filter is specified by using OData syntax. * Example: $filter=channels eq 'Api' or channel eq 'Notification' and * startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' @@ -8184,9 +8192,9 @@ export interface Recommendations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listHistoryForWebApp(resourceGroupName: string, siteName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listHistoryForWebApp(resourceGroupName: string, siteName: string, options?: { expiredOnly? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; listHistoryForWebApp(resourceGroupName: string, siteName: string, callback: ServiceCallback): void; - listHistoryForWebApp(resourceGroupName: string, siteName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listHistoryForWebApp(resourceGroupName: string, siteName: string, options: { expiredOnly? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -8738,818 +8746,6 @@ export interface Recommendations { listRecommendedRulesForWebAppNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } -/** - * @class - * ResourceHealthMetadataOperations - * __NOTE__: An instance of this class is automatically created for an - * instance of the WebSiteManagementClient. - */ -export interface ResourceHealthMetadataOperations { - - - /** - * @summary List all ResourceHealthMetadata for all sites in the subscription. - * - * List all ResourceHealthMetadata for all sites in the subscription. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary List all ResourceHealthMetadata for all sites in the subscription. - * - * List all ResourceHealthMetadata for all sites in the subscription. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ResourceHealthMetadataCollection} - 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. - * - * {ResourceHealthMetadataCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceHealthMetadataCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary List all ResourceHealthMetadata for all sites in the resource group - * in the subscription. - * - * List all ResourceHealthMetadata for all sites in the resource group in the - * subscription. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary List all ResourceHealthMetadata for all sites in the resource group - * in the subscription. - * - * List all ResourceHealthMetadata for all sites in the resource group in the - * subscription. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @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 {ResourceHealthMetadataCollection} - 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. - * - * {ResourceHealthMetadataCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceHealthMetadataCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets the category of ResourceHealthMetadata to use for the given - * site as a collection - * - * Gets the category of ResourceHealthMetadata to use for the given site as a - * collection - * - * @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 {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. - */ - listBySiteWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets the category of ResourceHealthMetadata to use for the given - * site as a collection - * - * Gets the category of ResourceHealthMetadata to use for the given site as a - * collection - * - * @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 {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 {ResourceHealthMetadataCollection} - 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. - * - * {ResourceHealthMetadataCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceHealthMetadataCollection} 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. - */ - listBySite(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBySite(resourceGroupName: string, name: string, callback: ServiceCallback): void; - listBySite(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets the category of ResourceHealthMetadata to use for the given - * site - * - * Gets the category of ResourceHealthMetadata to use for the given site - * - * @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 {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. - */ - getBySiteWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets the category of ResourceHealthMetadata to use for the given - * site - * - * Gets the category of ResourceHealthMetadata to use for the given site - * - * @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 {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 {ResourceHealthMetadata} - 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. - * - * {ResourceHealthMetadata} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceHealthMetadata} 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. - */ - getBySite(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getBySite(resourceGroupName: string, name: string, callback: ServiceCallback): void; - getBySite(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets the category of ResourceHealthMetadata to use for the given - * site as a collection - * - * Gets the category of ResourceHealthMetadata to use for the given site as a - * collection - * - * @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. - */ - listBySiteSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets the category of ResourceHealthMetadata to use for the given - * site as a collection - * - * Gets the category of ResourceHealthMetadata to use for the given site as a - * collection - * - * @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 - * - * @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 {ResourceHealthMetadataCollection} - 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. - * - * {ResourceHealthMetadataCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceHealthMetadataCollection} 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. - */ - listBySiteSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBySiteSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - listBySiteSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets the category of ResourceHealthMetadata to use for the given - * site - * - * Gets the category of ResourceHealthMetadata to use for the given site - * - * @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. - */ - getBySiteSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets the category of ResourceHealthMetadata to use for the given - * site - * - * Gets the category of ResourceHealthMetadata to use for the given site - * - * @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 - * - * @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 {ResourceHealthMetadata} - 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. - * - * {ResourceHealthMetadata} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceHealthMetadata} 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. - */ - getBySiteSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getBySiteSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - getBySiteSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary List all ResourceHealthMetadata for all sites in the subscription. - * - * List all ResourceHealthMetadata for all sites in the subscription. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary List all ResourceHealthMetadata for all sites in the subscription. - * - * List all ResourceHealthMetadata for all sites in the subscription. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ResourceHealthMetadataCollection} - 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. - * - * {ResourceHealthMetadataCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceHealthMetadataCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary List all ResourceHealthMetadata for all sites in the resource group - * in the subscription. - * - * List all ResourceHealthMetadata for all sites in the resource group in the - * subscription. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary List all ResourceHealthMetadata for all sites in the resource group - * in the subscription. - * - * List all ResourceHealthMetadata for all sites in the resource group in the - * subscription. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ResourceHealthMetadataCollection} - 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. - * - * {ResourceHealthMetadataCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceHealthMetadataCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets the category of ResourceHealthMetadata to use for the given - * site as a collection - * - * Gets the category of ResourceHealthMetadata to use for the given site as a - * collection - * - * @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. - */ - listBySiteNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets the category of ResourceHealthMetadata to use for the given - * site as a collection - * - * Gets the category of ResourceHealthMetadata to use for the given site as a - * collection - * - * @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 {ResourceHealthMetadataCollection} - 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. - * - * {ResourceHealthMetadataCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceHealthMetadataCollection} 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. - */ - listBySiteNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBySiteNext(nextPageLink: string, callback: ServiceCallback): void; - listBySiteNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets the category of ResourceHealthMetadata to use for the given - * site as a collection - * - * Gets the category of ResourceHealthMetadata to use for the given site as a - * collection - * - * @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. - */ - listBySiteSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets the category of ResourceHealthMetadata to use for the given - * site as a collection - * - * Gets the category of ResourceHealthMetadata to use for the given site as a - * collection - * - * @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 {ResourceHealthMetadataCollection} - 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. - * - * {ResourceHealthMetadataCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceHealthMetadataCollection} 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. - */ - listBySiteSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBySiteSlotNext(nextPageLink: string, callback: ServiceCallback): void; - listBySiteSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * BillingMeters - * __NOTE__: An instance of this class is automatically created for an - * instance of the WebSiteManagementClient. - */ -export interface BillingMeters { - - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.billingLocation] Azure Location of billable - * resource - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listWithHttpOperationResponse(options?: { billingLocation? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.billingLocation] Azure Location of billable - * resource - * - * @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 {BillingMeterCollection} - 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. - * - * {BillingMeterCollection} [result] - The deserialized result object if an error did not occur. - * See {@link BillingMeterCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(options?: { billingLocation? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { billingLocation? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @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 {BillingMeterCollection} - 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. - * - * {BillingMeterCollection} [result] - The deserialized result object if an error did not occur. - * See {@link BillingMeterCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - /** * @class * WebApps @@ -9778,6 +8974,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -9796,6 +8994,9 @@ export interface WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -9994,6 +9195,12 @@ export interface WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -10004,6 +9211,13 @@ export interface WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -10079,43 +9293,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -10123,7 +9300,10 @@ export interface WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -10174,6 +9354,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -10192,6 +9374,9 @@ export interface WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -10390,6 +9575,12 @@ export interface WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -10400,6 +9591,13 @@ export interface WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -10475,43 +9673,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -10519,7 +9680,10 @@ export interface WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -10669,6 +9833,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -10687,6 +9853,9 @@ export interface WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -10885,6 +10054,12 @@ export interface WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -10895,6 +10070,13 @@ export interface WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -10970,43 +10152,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -11056,6 +10201,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -11074,6 +10221,9 @@ export interface WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -11272,6 +10422,12 @@ export interface WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -11282,6 +10438,13 @@ export interface WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -11357,43 +10520,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -11601,8 +10727,6 @@ export interface WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -11633,9 +10757,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -11664,450 +10785,6 @@ export interface WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName Name of the backup. - * - * @param {boolean} [request.enabled] True if the backup schedule is enabled - * (must be included in that case), false if the backup schedule should be - * disabled. - * - * @param {string} request.storageAccountUrl SAS URL to the container. - * - * @param {object} [request.backupSchedule] Schedule for the backup if it is - * executed periodically. - * - * @param {number} request.backupSchedule.frequencyInterval How often the - * backup should be executed (e.g. for weekly backup, this should be set to 7 - * and FrequencyUnit should be set to Day) - * - * @param {string} request.backupSchedule.frequencyUnit The unit of time for - * how often the backup should be executed (e.g. for weekly backup, this should - * be set to Day and FrequencyInterval should be set to 7). Possible values - * include: 'Day', 'Hour' - * - * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the - * retention policy should always keep at least one backup in the storage - * account, regardless how old it is; false otherwise. - * - * @param {number} request.backupSchedule.retentionPeriodInDays After how many - * days backups should be deleted. - * - * @param {date} [request.backupSchedule.startTime] When the schedule should - * start working. - * - * @param {array} [request.databases] Databases included in the backup. - * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @param {string} [request.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 {BackupItem} - 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. - * - * {BackupItem} [result] - The deserialized result object if an error did not occur. - * See {@link BackupItem} 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. - */ - backup(resourceGroupName: string, name: string, request: models.BackupRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - backup(resourceGroupName: string, name: string, request: models.BackupRequest, callback: ServiceCallback): void; - backup(resourceGroupName: string, name: string, request: models.BackupRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets existing backups of an app. - * - * Gets existing backups 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 - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listBackupsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets existing backups of an app. - * - * Gets existing backups 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 {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 {BackupItemCollection} - 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. - * - * {BackupItemCollection} [result] - The deserialized result object if an error did not occur. - * See {@link BackupItemCollection} 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. - */ - listBackups(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBackups(resourceGroupName: string, name: string, callback: ServiceCallback): void; - listBackups(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Discovers an existing app backup that can be restored from a blob - * in Azure storage. - * - * Discovers an existing app backup that can be restored from a blob in Azure - * storage. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} request A RestoreRequest object that includes Azure storage - * URL and blog name for discovery of backup. - * - * @param {string} request.storageAccountUrl SAS URL to the container. - * - * @param {string} [request.blobName] Name of a blob which contains the backup. - * - * @param {boolean} request.overwrite true if the restore - * operation can overwrite target app; otherwise, false. - * true is needed if trying to restore over an existing app. - * - * @param {string} [request.siteName] Name of an app. - * - * @param {array} [request.databases] Collection of databases which should be - * restored. This list has to match the list of databases included in the - * backup. - * - * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when - * restoring an app with custom domains. true to remove custom - * domains automatically. If false, custom domains are added to - * the app's object when it is being restored, but that might fail due to - * conflicts during the operation. - * - * @param {boolean} [request.ignoreDatabases] Ignore the databases and only - * restore the site content - * - * @param {string} [request.appServicePlan] Specify app service plan that will - * own restored site. - * - * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @param {boolean} [request.adjustConnectionStrings] true if - * SiteConfig.ConnectionStrings should be set in new app; otherwise, - * false. - * - * @param {string} [request.hostingEnvironment] App Service Environment name, - * if needed (only when restoring an app to an App Service Environment). - * - * @param {string} [request.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. - */ - discoverRestoreWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Discovers an existing app backup that can be restored from a blob - * in Azure storage. - * - * Discovers an existing app backup that can be restored from a blob in Azure - * storage. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} request A RestoreRequest object that includes Azure storage - * URL and blog name for discovery of backup. - * - * @param {string} request.storageAccountUrl SAS URL to the container. - * - * @param {string} [request.blobName] Name of a blob which contains the backup. - * - * @param {boolean} request.overwrite true if the restore - * operation can overwrite target app; otherwise, false. - * true is needed if trying to restore over an existing app. - * - * @param {string} [request.siteName] Name of an app. - * - * @param {array} [request.databases] Collection of databases which should be - * restored. This list has to match the list of databases included in the - * backup. - * - * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when - * restoring an app with custom domains. true to remove custom - * domains automatically. If false, custom domains are added to - * the app's object when it is being restored, but that might fail due to - * conflicts during the operation. - * - * @param {boolean} [request.ignoreDatabases] Ignore the databases and only - * restore the site content - * - * @param {string} [request.appServicePlan] Specify app service plan that will - * own restored site. - * - * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @param {boolean} [request.adjustConnectionStrings] true if - * SiteConfig.ConnectionStrings should be set in new app; otherwise, - * false. - * - * @param {string} [request.hostingEnvironment] App Service Environment name, - * if needed (only when restoring an app to an App Service Environment). - * - * @param {string} [request.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 {RestoreRequest} - 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. - * - * {RestoreRequest} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreRequest} 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. - */ - discoverRestore(resourceGroupName: string, name: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - discoverRestore(resourceGroupName: string, name: string, request: models.RestoreRequest, callback: ServiceCallback): void; - discoverRestore(resourceGroupName: string, name: string, request: models.RestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets a backup of an app by its ID. - * - * Gets a backup of an app by its ID. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} backupId ID of the backup. - * - * @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. - */ - getBackupStatusWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets a backup of an app by its ID. - * - * Gets a backup of an app by its ID. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} backupId ID of the backup. - * - * @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 {BackupItem} - 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. - * - * {BackupItem} [result] - The deserialized result object if an error did not occur. - * See {@link BackupItem} 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. - */ - getBackupStatus(resourceGroupName: string, name: string, backupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getBackupStatus(resourceGroupName: string, name: string, backupId: string, callback: ServiceCallback): void; - getBackupStatus(resourceGroupName: string, name: string, backupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Deletes a backup of an app by its ID. - * - * Deletes a backup of an app by its ID. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} backupId ID of the backup. - * - * @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. - */ - deleteBackupWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Deletes a backup of an app by its ID. - * - * Deletes a backup of an app by its ID. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} backupId ID of the backup. - * - * @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. - */ - deleteBackup(resourceGroupName: string, name: string, backupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteBackup(resourceGroupName: string, name: string, backupId: string, callback: ServiceCallback): void; - deleteBackup(resourceGroupName: string, name: string, backupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets status of a web app backup that may be in progress, including - * secrets associated with the backup, such as the Azure Storage SAS URL. Also - * can be used to update the SAS URL for the backup if a new URL is passed in - * the request body. - * - * Gets status of a web app backup that may be in progress, including secrets - * associated with the backup, such as the Azure Storage SAS URL. Also can be - * used to update the SAS URL for the backup if a new URL is passed in the - * request body. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} backupId ID of backup. - * - * @param {object} request Information on backup request. - * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -12138,8 +10815,291 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * @param {string} [request.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 {BackupItem} - 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. + * + * {BackupItem} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItem} 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. + */ + backup(resourceGroupName: string, name: string, request: models.BackupRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + backup(resourceGroupName: string, name: string, request: models.BackupRequest, callback: ServiceCallback): void; + backup(resourceGroupName: string, name: string, request: models.BackupRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets existing backups of an app. + * + * Gets existing backups 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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listBackupsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets existing backups of an app. + * + * Gets existing backups 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 {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 {BackupItemCollection} - 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. + * + * {BackupItemCollection} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItemCollection} 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. + */ + listBackups(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBackups(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listBackups(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a backup of an app by its ID. + * + * Gets a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @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. + */ + getBackupStatusWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a backup of an app by its ID. + * + * Gets a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @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 {BackupItem} - 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. + * + * {BackupItem} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItem} 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. + */ + getBackupStatus(resourceGroupName: string, name: string, backupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getBackupStatus(resourceGroupName: string, name: string, backupId: string, callback: ServiceCallback): void; + getBackupStatus(resourceGroupName: string, name: string, backupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a backup of an app by its ID. + * + * Deletes a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @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. + */ + deleteBackupWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a backup of an app by its ID. + * + * Deletes a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @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. + */ + deleteBackup(resourceGroupName: string, name: string, backupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteBackup(resourceGroupName: string, name: string, backupId: string, callback: ServiceCallback): void; + deleteBackup(resourceGroupName: string, name: string, backupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets status of a web app backup that may be in progress, including + * secrets associated with the backup, such as the Azure Storage SAS URL. Also + * can be used to update the SAS URL for the backup if a new URL is passed in + * the request body. + * + * Gets status of a web app backup that may be in progress, including secrets + * associated with the backup, such as the Azure Storage SAS URL. Also can be + * used to update the SAS URL for the backup if a new URL is passed in the + * request body. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} backupId ID of backup. + * + * @param {object} request Information on backup request. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. * * @param {string} [request.kind] Kind of resource. * @@ -12176,8 +11136,6 @@ export interface WebApps { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -12208,9 +11166,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -12288,7 +11243,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -12306,11 +11261,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. */ - restoreWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + restoreWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Restores a specific backup to another app (or deployment slot, if @@ -12355,7 +11310,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -12378,7 +11333,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12386,16 +11341,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestoreResponse} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} for more information. + * {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. */ - restore(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - restore(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, callback: ServiceCallback): void; - restore(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + restore(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restore(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, callback: ServiceCallback): void; + restore(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -12681,6 +11635,9 @@ export interface WebApps { * More information on OpenID Connect Discovery: * http://openid.net/specs/openid-connect-discovery-1_0.html * + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. + * * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values * to consider when validating JWTs issued by * Azure Active Directory. Note that the ClientID value is always @@ -12847,6 +11804,9 @@ export interface WebApps { * More information on OpenID Connect Discovery: * http://openid.net/specs/openid-connect-discovery-1_0.html * + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. + * * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values * to consider when validating JWTs issued by * Azure Active Directory. Note that the ClientID value is always @@ -13034,8 +11994,6 @@ export interface WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -13066,9 +12024,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -13096,8 +12051,6 @@ export interface WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -13128,9 +12081,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -14283,6 +13233,339 @@ export interface WebApps { updateSlotConfigurationNames(resourceGroupName: string, name: string, slotConfigNames: models.SlotConfigNamesResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Gets a Swift Virtual Network connection. + * + * Gets a Swift Virtual Network connection. + * + * @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. + */ + getSwiftVirtualNetworkConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a Swift Virtual Network connection. + * + * Gets a Swift Virtual Network connection. + * + * @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 {SwiftVirtualNetwork} - 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. + * + * {SwiftVirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link SwiftVirtualNetwork} 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. + */ + getSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.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. + */ + createOrUpdateSwiftVirtualNetworkConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.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 {SwiftVirtualNetwork} - 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. + * + * {SwiftVirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link SwiftVirtualNetwork} 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. + */ + createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, callback: ServiceCallback): void; + createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). + * + * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * + * @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. + */ + deleteSwiftVirtualNetworkWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). + * + * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * + * @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. + */ + deleteSwiftVirtualNetwork(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteSwiftVirtualNetwork(resourceGroupName: string, name: string, callback: ServiceCallback): void; + deleteSwiftVirtualNetwork(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.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. + */ + updateSwiftVirtualNetworkConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.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 {SwiftVirtualNetwork} - 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. + * + * {SwiftVirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link SwiftVirtualNetwork} 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. + */ + updateSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, callback: ServiceCallback): void; + updateSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Gets the configuration of an app, such as platform version and * bitness, default documents, virtual applications, Always On, etc. @@ -14379,6 +13662,9 @@ export interface WebApps { * * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * * @param {boolean} [siteConfig.requestTracingEnabled] true if * request tracing is enabled; otherwise, false. * @@ -14556,6 +13842,12 @@ export interface WebApps { * @param {boolean} [siteConfig.localMySqlEnabled] true to enable * local MySQL; otherwise, false. * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web @@ -14565,6 +13857,13 @@ export interface WebApps { * minimum version of TLS required for SSL requests. Possible values include: * '1.0', '1.1', '1.2' * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * * @param {string} [siteConfig.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -14607,6 +13906,272 @@ export interface WebApps { * * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.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 {SiteConfigResource} - 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. + * + * {SiteConfigResource} [result] - The deserialized result object if an error did not occur. + * See {@link SiteConfigResource} 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. + */ + createOrUpdateConfiguration(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateConfiguration(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, callback: ServiceCallback): void; + createOrUpdateConfiguration(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the configuration of an app. + * + * Updates the 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} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * * @param {boolean} [siteConfig.requestTracingEnabled] true if * request tracing is enabled; otherwise, false. * @@ -14784,252 +14349,11 @@ export interface WebApps { * @param {boolean} [siteConfig.localMySqlEnabled] true to enable * local MySQL; otherwise, false. * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. - * - * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web - * site to allow clients to connect over http2.0 - * - * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the - * minimum version of TLS required for SSL requests. Possible values include: - * '1.0', '1.1', '1.2' + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id * - * @param {string} [siteConfig.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 {SiteConfigResource} - 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. - * - * {SiteConfigResource} [result] - The deserialized result object if an error did not occur. - * See {@link SiteConfigResource} 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. - */ - createOrUpdateConfiguration(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdateConfiguration(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, callback: ServiceCallback): void; - createOrUpdateConfiguration(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Updates the configuration of an app. - * - * Updates the 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} siteConfig JSON representation of a SiteConfig object. See - * example. - * - * @param {number} [siteConfig.numberOfWorkers] Number of workers. - * - * @param {array} [siteConfig.defaultDocuments] Default documents. - * - * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. - * - * @param {string} [siteConfig.phpVersion] Version of PHP. - * - * @param {string} [siteConfig.pythonVersion] Version of Python. - * - * @param {string} [siteConfig.nodeVersion] Version of Node.js. - * - * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version - * - * @param {boolean} [siteConfig.requestTracingEnabled] true if - * request tracing is enabled; otherwise, false. - * - * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing - * expiration time. - * - * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if - * remote debugging is enabled; otherwise, false. - * - * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging - * version. - * - * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP - * logging is enabled; otherwise, false. - * - * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size - * limit. - * - * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true - * if detailed error logging is enabled; otherwise, false. - * - * @param {string} [siteConfig.publishingUsername] Publishing user name. - * - * @param {array} [siteConfig.appSettings] Application settings. - * - * @param {array} [siteConfig.connectionStrings] Connection strings. - * - * @param {array} [siteConfig.handlerMappings] Handler mappings. - * - * @param {string} [siteConfig.documentRoot] Document root. - * - * @param {string} [siteConfig.scmType] SCM type. Possible values include: - * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', - * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', - * 'VSO' - * - * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use - * 32-bit worker process; otherwise, false. - * - * @param {boolean} [siteConfig.webSocketsEnabled] true if - * WebSocket is enabled; otherwise, false. - * - * @param {boolean} [siteConfig.alwaysOn] true if Always On is - * enabled; otherwise, false. - * - * @param {string} [siteConfig.javaVersion] Java version. - * - * @param {string} [siteConfig.javaContainer] Java container. - * - * @param {string} [siteConfig.javaContainerVersion] Java container version. - * - * @param {string} [siteConfig.appCommandLine] App command line to launch. - * - * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. - * Possible values include: 'Integrated', 'Classic' - * - * @param {array} [siteConfig.virtualApplications] Virtual applications. - * - * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible - * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', - * 'WeightedTotalTraffic', 'RequestHash' - * - * @param {object} [siteConfig.experiments] This is work around for polymophic - * types. - * - * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. - * - * @param {object} [siteConfig.limits] Site limits. - * - * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU - * usage percentage. - * - * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory - * usage in MB. - * - * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk - * size usage in MB. - * - * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal - * is enabled; otherwise, false. - * - * @param {object} [siteConfig.autoHealRules] Auto Heal rules. - * - * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe - * when to execute the auto-heal actions. - * - * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on - * total requests. - * - * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request - * Count. - * - * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] - * Time interval. - * - * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule - * based on private bytes. - * - * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based - * on status codes. - * - * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule - * based on request execution time. - * - * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] - * Time taken. - * - * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] - * Request Count. - * - * @param {string} - * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. - * - * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed - * when a rule is triggered. - * - * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined - * action to be taken. Possible values include: 'Recycle', 'LogEvent', - * 'CustomAction' - * - * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom - * action to be taken. - * - * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] - * Executable to be run. - * - * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] - * Parameters for the executable. - * - * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] - * Minimum time the process must execute - * before taking the action - * - * @param {string} [siteConfig.tracingOptions] Tracing options. - * - * @param {string} [siteConfig.vnetName] Virtual Network name. - * - * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) - * settings. - * - * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of - * origins that should be allowed to make cross-origin - * calls (for example: http://example.com:12345). Use "*" to allow all. - * - * @param {object} [siteConfig.push] Push endpoint settings. - * - * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag - * indicating whether the Push endpoint is enabled. - * - * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON - * string containing a list of tags that are whitelisted for use by the push - * registration endpoint. - * - * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON - * string containing a list of tags that require user authentication to be used - * in the push registration endpoint. - * Tags can consist of alphanumeric characters and the following: - * '_', '@', '#', '.', ':', '-'. - * Validation should be performed at the PushRequestHandler. - * - * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string - * containing a list of dynamic tags that will be evaluated from user claims in - * the push registration endpoint. - * - * @param {string} [siteConfig.push.kind] Kind of resource. - * - * @param {object} [siteConfig.apiDefinition] Information about the formal API - * definition for the app. - * - * @param {string} [siteConfig.apiDefinition.url] The URL of the API - * definition. - * - * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. - * - * @param {boolean} [siteConfig.localMySqlEnabled] true to enable - * local MySQL; otherwise, false. + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id * * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. * @@ -15040,6 +14364,13 @@ export interface WebApps { * minimum version of TLS required for SSL requests. Possible values include: * '1.0', '1.1', '1.2' * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * * @param {string} [siteConfig.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -15082,6 +14413,9 @@ export interface WebApps { * * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * * @param {boolean} [siteConfig.requestTracingEnabled] true if * request tracing is enabled; otherwise, false. * @@ -15259,6 +14593,12 @@ export interface WebApps { * @param {boolean} [siteConfig.localMySqlEnabled] true to enable * local MySQL; otherwise, false. * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web @@ -15268,6 +14608,13 @@ export interface WebApps { * minimum version of TLS required for SSL requests. Possible values include: * '1.0', '1.1', '1.2' * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * * @param {string} [siteConfig.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -15596,7 +14943,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - getWebSiteContainerLogsZipWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getContainerLogsZipWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Gets the ZIP archived docker log files for the given site @@ -15634,9 +14981,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getWebSiteContainerLogsZip(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getWebSiteContainerLogsZip(resourceGroupName: string, name: string, callback: ServiceCallback): void; - getWebSiteContainerLogsZip(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getContainerLogsZip(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getContainerLogsZip(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getContainerLogsZip(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -16130,8 +15477,6 @@ export interface WebApps { * * @param {object} deployment Deployment details. * - * @param {string} [deployment.deploymentId] Identifier for deployment. - * * @param {number} [deployment.status] Deployment status. * * @param {string} [deployment.message] Details about deployment status. @@ -16180,8 +15525,6 @@ export interface WebApps { * * @param {object} deployment Deployment details. * - * @param {string} [deployment.deploymentId] Identifier for deployment. - * * @param {number} [deployment.status] Deployment status. * * @param {string} [deployment.message] Details about deployment status. @@ -16380,6 +15723,159 @@ export interface WebApps { listDeploymentLog(resourceGroupName: string, name: string, id: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Discovers an existing app backup that can be restored from a blob + * in Azure storage. Use this to get information about the databases stored in + * a backup. + * + * Discovers an existing app backup that can be restored from a blob in Azure + * storage. Use this to get information about the databases stored in a backup. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.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. + */ + discoverBackupWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Discovers an existing app backup that can be restored from a blob + * in Azure storage. Use this to get information about the databases stored in + * a backup. + * + * Discovers an existing app backup that can be restored from a blob in Azure + * storage. Use this to get information about the databases stored in a backup. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.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 {RestoreRequest} - 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. + * + * {RestoreRequest} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreRequest} 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. + */ + discoverBackup(resourceGroupName: string, name: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + discoverBackup(resourceGroupName: string, name: string, request: models.RestoreRequest, callback: ServiceCallback): void; + discoverBackup(resourceGroupName: string, name: string, request: models.RestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Lists ownership identifiers for domain associated with web app. * @@ -17234,6 +16730,8 @@ export interface WebApps { * * @param {object} functionEnvelope Function details. * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * * @param {string} [functionEnvelope.scriptHref] Script URI. @@ -17280,6 +16778,8 @@ export interface WebApps { * * @param {object} functionEnvelope Function details. * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * * @param {string} [functionEnvelope.scriptHref] Script URI. @@ -20885,12 +20385,6 @@ export interface WebApps { * * @param {string} [premierAddOn.vendor] Premier add on Vendor. * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * * @param {string} [premierAddOn.marketplacePublisher] Premier add on * Marketplace publisher. * @@ -20937,12 +20431,6 @@ export interface WebApps { * * @param {string} [premierAddOn.vendor] Premier add on Vendor. * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * * @param {string} [premierAddOn.marketplacePublisher] Premier add on * Marketplace publisher. * @@ -21055,6 +20543,265 @@ export interface WebApps { deletePremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @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 {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. + */ + updatePremierAddOnWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOnPatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @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 {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 {PremierAddOn} - 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. + * + * {PremierAddOn} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} 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. + */ + updatePremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOnPatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updatePremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOnPatchResource, callback: ServiceCallback): void; + updatePremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOnPatchResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the 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 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|ServiceError} - The error object. + */ + getPrivateAccessWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the 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 The name of the 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 {PrivateAccess} - 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. + * + * {PrivateAccess} [result] - The deserialized result object if an error did not occur. + * See {@link PrivateAccess} 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. + */ + getPrivateAccess(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getPrivateAccess(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getPrivateAccess(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the 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 The name of the web app. + * + * @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. + * + * @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. + */ + putPrivateAccessVnetWithHttpOperationResponse(resourceGroupName: string, name: string, access: models.PrivateAccess, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the 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 The name of the web app. + * + * @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. + * + * @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 {PrivateAccess} - 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. + * + * {PrivateAccess} [result] - The deserialized result object if an error did not occur. + * See {@link PrivateAccess} 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. + */ + putPrivateAccessVnet(resourceGroupName: string, name: string, access: models.PrivateAccess, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + putPrivateAccessVnet(resourceGroupName: string, name: string, access: models.PrivateAccess, callback: ServiceCallback): void; + putPrivateAccessVnet(resourceGroupName: string, name: string, access: models.PrivateAccess, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Get list of processes for a web site, or a deployment slot, or for * a specific scaled-out instance in a web site. @@ -21936,57 +21683,443 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deletePublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deletePublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, callback: ServiceCallback): void; - deletePublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deletePublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deletePublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, callback: ServiceCallback): void; + deletePublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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} [options] Optional Parameters. + * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @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. + */ + listPublishingProfileXmlWithSecretsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { format? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @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} [options] Optional Parameters. + * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @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 {Object} - 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. + * + * {Object} [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. + */ + listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, options?: { format? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, options: { format? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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 {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. + */ + resetProductionSlotConfigWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @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 {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. + */ + resetProductionSlotConfig(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + resetProductionSlotConfig(resourceGroupName: string, name: string, callback: ServiceCallback): void; + resetProductionSlotConfig(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restarts an app (or deployment slot, if specified). + * + * Restarts 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 {boolean} [options.softRestart] Specify true to apply the + * configuration settings and restarts the app only if necessary. By default, + * the API always restarts and reprovisions the app. + * + * @param {boolean} [options.synchronous] Specify true to block until the app + * is restarted. By default, it is set to false, and the API responds + * immediately (asynchronous). + * + * @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. + */ + restartWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { softRestart? : boolean, synchronous? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restarts an app (or deployment slot, if specified). + * + * Restarts 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 {boolean} [options.softRestart] Specify true to apply the + * configuration settings and restarts the app only if necessary. By default, + * the API always restarts and reprovisions the app. + * + * @param {boolean} [options.synchronous] Specify true to block until the app + * is restarted. By default, it is set to false, and the API responds + * immediately (asynchronous). + * + * @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. + */ + restart(resourceGroupName: string, name: string, options?: { softRestart? : boolean, synchronous? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + restart(resourceGroupName: string, name: string, callback: ServiceCallback): void; + restart(resourceGroupName: string, name: string, options: { softRestart? : boolean, synchronous? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.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. + */ + restoreFromBackupBlobWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.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 {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. + */ + restoreFromBackupBlob(resourceGroupName: string, name: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restoreFromBackupBlob(resourceGroupName: string, name: string, request: models.RestoreRequest, callback: ServiceCallback): void; + restoreFromBackupBlob(resourceGroupName: string, name: string, request: models.RestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Gets the publishing profile for an app (or deployment slot, if - * specified). + * @summary Restores a deleted web app to this web app. * - * Gets the publishing profile for an app (or deployment slot, if specified). + * 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 the app. + * @param {string} name Name of web app. * - * @param {object} [options] Optional Parameters. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * @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} [restoreRequest.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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listPublishingProfileXmlWithSecretsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { format? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + restoreFromDeletedAppWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets the publishing profile for an app (or deployment slot, if - * specified). + * @summary Restores a deleted web app to this web app. * - * Gets the publishing profile for an app (or deployment slot, if specified). + * 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 the app. + * @param {string} name Name of web app. * - * @param {object} [options] Optional Parameters. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * @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} [restoreRequest.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -21998,7 +22131,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22006,58 +22139,59 @@ 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. + * {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. */ - listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, options?: { format? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, callback: ServiceCallback): void; - listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, options: { format? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + restoreFromDeletedApp(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restoreFromDeletedApp(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, callback: ServiceCallback): void; + restoreFromDeletedApp(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -22070,200 +22204,53 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - recoverWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + restoreSnapshotWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.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 {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. - */ - recover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - recover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, callback: ServiceCallback): void; - recover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @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 {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. - */ - resetProductionSlotConfigWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @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 {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. - */ - resetProductionSlotConfig(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - resetProductionSlotConfig(resourceGroupName: string, name: string, callback: ServiceCallback): void; - resetProductionSlotConfig(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Restarts an app (or deployment slot, if specified). - * - * Restarts 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 {boolean} [options.softRestart] Specify true to apply the - * configuration settings and restarts the app only if necessary. By default, - * the API always restarts and reprovisions the app. - * - * @param {boolean} [options.synchronous] Specify true to block until the app - * is restarted. By default, it is set to false, and the API responds - * immediately (asynchronous). - * - * @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. - */ - restartWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { softRestart? : boolean, synchronous? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Restarts an app (or deployment slot, if specified). - * - * Restarts 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} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.softRestart] Specify true to apply the - * configuration settings and restarts the app only if necessary. By default, - * the API always restarts and reprovisions the app. - * - * @param {boolean} [options.synchronous] Specify true to block until the app - * is restarted. By default, it is set to false, and the API responds - * immediately (asynchronous). - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -22288,9 +22275,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - restart(resourceGroupName: string, name: string, options?: { softRestart? : boolean, synchronous? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; - restart(resourceGroupName: string, name: string, callback: ServiceCallback): void; - restart(resourceGroupName: string, name: string, options: { softRestart? : boolean, synchronous? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + restoreSnapshot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restoreSnapshot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, callback: ServiceCallback): void; + restoreSnapshot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -22735,6 +22722,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -22753,6 +22742,9 @@ export interface WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -22951,6 +22943,12 @@ export interface WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -22961,6 +22959,13 @@ export interface WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -23036,43 +23041,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -23080,7 +23048,10 @@ export interface WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -23093,19 +23064,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -23115,7 +23073,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Creates a new web, mobile, or API app in an existing resource @@ -23147,6 +23105,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -23165,6 +23125,9 @@ export interface WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -23363,6 +23326,12 @@ export interface WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -23373,6 +23342,13 @@ export interface WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -23448,43 +23424,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -23492,7 +23431,10 @@ export interface WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -23505,19 +23447,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -23543,9 +23472,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; createOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, callback: ServiceCallback): void; - createOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -23571,9 +23500,6 @@ export interface WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -23583,7 +23509,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - deleteSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Deletes a web, mobile, or API app, or one of the deployment slots. @@ -23608,9 +23534,6 @@ export interface WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -23635,9 +23558,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteSlot(resourceGroupName: string, name: string, slot: string, options?: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + deleteSlot(resourceGroupName: string, name: string, slot: string, options?: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; deleteSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - deleteSlot(resourceGroupName: string, name: string, slot: string, options: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteSlot(resourceGroupName: string, name: string, slot: string, options: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -23670,6 +23593,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -23688,6 +23613,9 @@ export interface WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -23886,6 +23814,12 @@ export interface WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -23896,6 +23830,13 @@ export interface WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -23971,43 +23912,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -24019,19 +23923,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -24041,7 +23932,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - updateSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, slot: string, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + updateSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Creates a new web, mobile, or API app in an existing resource @@ -24073,6 +23964,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -24091,6 +23984,9 @@ export interface WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -24289,6 +24185,12 @@ export interface WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -24299,6 +24201,13 @@ export interface WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -24374,43 +24283,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -24422,19 +24294,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -24460,9 +24319,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - updateSlot(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, slot: string, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + updateSlot(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; updateSlot(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, slot: string, callback: ServiceCallback): void; - updateSlot(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, slot: string, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateSlot(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -24646,8 +24505,6 @@ export interface WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -24678,9 +24535,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -24712,8 +24566,6 @@ export interface WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -24744,9 +24596,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -24855,163 +24704,6 @@ export interface WebApps { listBackupsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - /** - * @summary Discovers an existing app backup that can be restored from a blob - * in Azure storage. - * - * Discovers an existing app backup that can be restored from a blob in Azure - * storage. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} request A RestoreRequest object that includes Azure storage - * URL and blog name for discovery of backup. - * - * @param {string} request.storageAccountUrl SAS URL to the container. - * - * @param {string} [request.blobName] Name of a blob which contains the backup. - * - * @param {boolean} request.overwrite true if the restore - * operation can overwrite target app; otherwise, false. - * true is needed if trying to restore over an existing app. - * - * @param {string} [request.siteName] Name of an app. - * - * @param {array} [request.databases] Collection of databases which should be - * restored. This list has to match the list of databases included in the - * backup. - * - * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when - * restoring an app with custom domains. true to remove custom - * domains automatically. If false, custom domains are added to - * the app's object when it is being restored, but that might fail due to - * conflicts during the operation. - * - * @param {boolean} [request.ignoreDatabases] Ignore the databases and only - * restore the site content - * - * @param {string} [request.appServicePlan] Specify app service plan that will - * own restored site. - * - * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @param {boolean} [request.adjustConnectionStrings] true if - * SiteConfig.ConnectionStrings should be set in new app; otherwise, - * false. - * - * @param {string} [request.hostingEnvironment] App Service Environment name, - * if needed (only when restoring an app to an App Service Environment). - * - * @param {string} [request.kind] Kind of resource. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will perform discovery 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|ServiceError} - The error object. - */ - discoverRestoreSlotWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Discovers an existing app backup that can be restored from a blob - * in Azure storage. - * - * Discovers an existing app backup that can be restored from a blob in Azure - * storage. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} request A RestoreRequest object that includes Azure storage - * URL and blog name for discovery of backup. - * - * @param {string} request.storageAccountUrl SAS URL to the container. - * - * @param {string} [request.blobName] Name of a blob which contains the backup. - * - * @param {boolean} request.overwrite true if the restore - * operation can overwrite target app; otherwise, false. - * true is needed if trying to restore over an existing app. - * - * @param {string} [request.siteName] Name of an app. - * - * @param {array} [request.databases] Collection of databases which should be - * restored. This list has to match the list of databases included in the - * backup. - * - * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when - * restoring an app with custom domains. true to remove custom - * domains automatically. If false, custom domains are added to - * the app's object when it is being restored, but that might fail due to - * conflicts during the operation. - * - * @param {boolean} [request.ignoreDatabases] Ignore the databases and only - * restore the site content - * - * @param {string} [request.appServicePlan] Specify app service plan that will - * own restored site. - * - * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @param {boolean} [request.adjustConnectionStrings] true if - * SiteConfig.ConnectionStrings should be set in new app; otherwise, - * false. - * - * @param {string} [request.hostingEnvironment] App Service Environment name, - * if needed (only when restoring an app to an App Service Environment). - * - * @param {string} [request.kind] Kind of resource. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will perform discovery 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 {RestoreRequest} - 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. - * - * {RestoreRequest} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreRequest} 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. - */ - discoverRestoreSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - discoverRestoreSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, callback: ServiceCallback): void; - discoverRestoreSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - /** * @summary Gets a backup of an app by its ID. * @@ -25181,8 +24873,6 @@ export interface WebApps { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -25213,9 +24903,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -25254,8 +24941,6 @@ export interface WebApps { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -25286,9 +24971,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -25369,7 +25051,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -25390,11 +25072,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. */ - restoreSlotWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + restoreSlotWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Restores a specific backup to another app (or deployment slot, if @@ -25439,7 +25121,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -25465,7 +25147,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -25473,16 +25155,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestoreResponse} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} for more information. + * {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. */ - restoreSlot(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - restoreSlot(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, callback: ServiceCallback): void; - restoreSlot(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + restoreSlot(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restoreSlot(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, callback: ServiceCallback): void; + restoreSlot(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -25790,6 +25471,9 @@ export interface WebApps { * More information on OpenID Connect Discovery: * http://openid.net/specs/openid-connect-discovery-1_0.html * + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. + * * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values * to consider when validating JWTs issued by * Azure Active Directory. Note that the ClientID value is always @@ -25959,6 +25643,9 @@ export interface WebApps { * More information on OpenID Connect Discovery: * http://openid.net/specs/openid-connect-discovery-1_0.html * + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. + * * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values * to consider when validating JWTs issued by * Azure Active Directory. Note that the ClientID value is always @@ -26155,8 +25842,6 @@ export interface WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -26187,9 +25872,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -26221,8 +25903,6 @@ export interface WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -26253,9 +25933,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -27252,23 +26929,95 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - updateSitePushSettingsSlot(resourceGroupName: string, name: string, pushSettings: models.PushSettings, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateSitePushSettingsSlot(resourceGroupName: string, name: string, pushSettings: models.PushSettings, slot: string, callback: ServiceCallback): void; - updateSitePushSettingsSlot(resourceGroupName: string, name: string, pushSettings: models.PushSettings, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateSitePushSettingsSlot(resourceGroupName: string, name: string, pushSettings: models.PushSettings, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateSitePushSettingsSlot(resourceGroupName: string, name: string, pushSettings: models.PushSettings, slot: string, callback: ServiceCallback): void; + updateSitePushSettingsSlot(resourceGroupName: string, name: string, pushSettings: models.PushSettings, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the Push settings associated with web app. + * + * Gets the Push settings associated with 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 {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. + */ + listSitePushSettingsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the Push settings associated with web app. + * + * Gets the Push settings associated with 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 {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 {PushSettings} - 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. + * + * {PushSettings} [result] - The deserialized result object if an error did not occur. + * See {@link PushSettings} 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. + */ + listSitePushSettingsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSitePushSettingsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listSitePushSettingsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Gets the Push settings associated with web app. + * @summary Gets a Swift Virtual Network connection. * - * Gets the Push settings associated with web app. + * Gets a Swift Virtual Network connection. * * @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 get a gateway for the production slot's Virtual + * Network. * * @param {object} [options] Optional Parameters. * @@ -27277,24 +27026,25 @@ 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. */ - listSitePushSettingsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets the Push settings associated with web app. + * @summary Gets a Swift Virtual Network connection. * - * Gets the Push settings associated with web app. + * Gets a Swift Virtual Network connection. * * @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 get a gateway for the production slot's Virtual + * Network. * * @param {object} [options] Optional Parameters. * @@ -27308,7 +27058,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {PushSettings} - The deserialized result object. + * @resolve {SwiftVirtualNetwork} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -27316,16 +27066,302 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PushSettings} [result] - The deserialized result object if an error did not occur. - * See {@link PushSettings} for more information. + * {SwiftVirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link SwiftVirtualNetwork} 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. */ - listSitePushSettingsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listSitePushSettingsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - listSitePushSettingsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @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 connections 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|ServiceError} - The error object. + */ + createOrUpdateSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @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 connections 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 {SwiftVirtualNetwork} - 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. + * + * {SwiftVirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link SwiftVirtualNetwork} 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. + */ + createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, slot: string, callback: ServiceCallback): void; + createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). + * + * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * + * @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 connection 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|ServiceError} - The error object. + */ + deleteSwiftVirtualNetworkSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). + * + * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * + * @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 connection 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. + */ + deleteSwiftVirtualNetworkSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteSwiftVirtualNetworkSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + deleteSwiftVirtualNetworkSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @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 connections 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|ServiceError} - The error object. + */ + updateSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @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 connections 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 {SwiftVirtualNetwork} - 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. + * + * {SwiftVirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link SwiftVirtualNetwork} 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. + */ + updateSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, slot: string, callback: ServiceCallback): void; + updateSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -27430,6 +27466,9 @@ export interface WebApps { * * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * * @param {boolean} [siteConfig.requestTracingEnabled] true if * request tracing is enabled; otherwise, false. * @@ -27607,6 +27646,12 @@ export interface WebApps { * @param {boolean} [siteConfig.localMySqlEnabled] true to enable * local MySQL; otherwise, false. * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web @@ -27616,6 +27661,13 @@ export interface WebApps { * minimum version of TLS required for SSL requests. Possible values include: * '1.0', '1.1', '1.2' * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * * @param {string} [siteConfig.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -27661,6 +27713,9 @@ export interface WebApps { * * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * * @param {boolean} [siteConfig.requestTracingEnabled] true if * request tracing is enabled; otherwise, false. * @@ -27838,6 +27893,12 @@ export interface WebApps { * @param {boolean} [siteConfig.localMySqlEnabled] true to enable * local MySQL; otherwise, false. * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web @@ -27847,6 +27908,13 @@ export interface WebApps { * minimum version of TLS required for SSL requests. Possible values include: * '1.0', '1.1', '1.2' * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * * @param {string} [siteConfig.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -27911,6 +27979,9 @@ export interface WebApps { * * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * * @param {boolean} [siteConfig.requestTracingEnabled] true if * request tracing is enabled; otherwise, false. * @@ -28088,6 +28159,12 @@ export interface WebApps { * @param {boolean} [siteConfig.localMySqlEnabled] true to enable * local MySQL; otherwise, false. * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web @@ -28097,6 +28174,13 @@ export interface WebApps { * minimum version of TLS required for SSL requests. Possible values include: * '1.0', '1.1', '1.2' * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * * @param {string} [siteConfig.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -28142,6 +28226,9 @@ export interface WebApps { * * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * * @param {boolean} [siteConfig.requestTracingEnabled] true if * request tracing is enabled; otherwise, false. * @@ -28319,6 +28406,12 @@ export interface WebApps { * @param {boolean} [siteConfig.localMySqlEnabled] true to enable * local MySQL; otherwise, false. * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web @@ -28328,6 +28421,13 @@ export interface WebApps { * minimum version of TLS required for SSL requests. Possible values include: * '1.0', '1.1', '1.2' * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * * @param {string} [siteConfig.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -28686,7 +28786,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - getWebSiteContainerLogsZipSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getContainerLogsZipSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Gets the ZIP archived docker log files for the given site @@ -28727,9 +28827,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getWebSiteContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getWebSiteContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - getWebSiteContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -29246,150 +29346,345 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, callback: ServiceCallback): void; - getDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + getDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, callback: ServiceCallback): void; + getDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create a deployment for an app, or a deployment slot. + * + * Create a deployment 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} id ID of an existing deployment. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API creates a deployment for the production slot. + * + * @param {object} deployment Deployment details. + * + * @param {number} [deployment.status] Deployment status. + * + * @param {string} [deployment.message] Details about deployment status. + * + * @param {string} [deployment.author] Who authored the deployment. + * + * @param {string} [deployment.deployer] Who performed the deployment. + * + * @param {string} [deployment.authorEmail] Author email. + * + * @param {date} [deployment.startTime] Start time. + * + * @param {date} [deployment.endTime] End time. + * + * @param {boolean} [deployment.active] True if deployment is currently active, + * false if completed and null if not started. + * + * @param {string} [deployment.details] Details on deployment. + * + * @param {string} [deployment.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. + */ + createDeploymentSlotWithHttpOperationResponse(resourceGroupName: string, name: string, id: string, slot: string, deployment: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create a deployment for an app, or a deployment slot. + * + * Create a deployment 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} id ID of an existing deployment. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API creates a deployment for the production slot. + * + * @param {object} deployment Deployment details. + * + * @param {number} [deployment.status] Deployment status. + * + * @param {string} [deployment.message] Details about deployment status. + * + * @param {string} [deployment.author] Who authored the deployment. + * + * @param {string} [deployment.deployer] Who performed the deployment. + * + * @param {string} [deployment.authorEmail] Author email. + * + * @param {date} [deployment.startTime] Start time. + * + * @param {date} [deployment.endTime] End time. + * + * @param {boolean} [deployment.active] True if deployment is currently active, + * false if completed and null if not started. + * + * @param {string} [deployment.details] Details on deployment. + * + * @param {string} [deployment.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 {Deployment} - 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. + * + * {Deployment} [result] - The deserialized result object if an error did not occur. + * See {@link Deployment} 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. + */ + createDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, deployment: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, deployment: models.Deployment, callback: ServiceCallback): void; + createDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, deployment: models.Deployment, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete a deployment by its ID for an app, or a deployment slot. + * + * Delete a deployment 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} id Deployment ID. + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteDeploymentSlotWithHttpOperationResponse(resourceGroupName: string, name: string, id: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete a deployment by its ID for an app, or a deployment slot. + * + * Delete a deployment 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} id Deployment ID. + * + * @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 {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. + */ + deleteDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, callback: ServiceCallback): void; + deleteDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. + * + * List deployment log for specific deployment 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} id The ID of a specific deployment. This is the value of the + * name property in the JSON response from "GET + * /api/sites/{siteName}/deployments". + * + * @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. + * + * @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. + */ + listDeploymentLogSlotWithHttpOperationResponse(resourceGroupName: string, name: string, id: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. + * + * List deployment log for specific deployment 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} id The ID of a specific deployment. This is the value of the + * name property in the JSON response from "GET + * /api/sites/{siteName}/deployments". + * + * @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. + * + * @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 {Deployment} - 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. + * + * {Deployment} [result] - The deserialized result object if an error did not occur. + * See {@link Deployment} 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. + */ + listDeploymentLogSlot(resourceGroupName: string, name: string, id: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listDeploymentLogSlot(resourceGroupName: string, name: string, id: string, slot: string, callback: ServiceCallback): void; + listDeploymentLogSlot(resourceGroupName: string, name: string, id: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - /** - * @summary Create a deployment for an app, or a deployment slot. - * - * Create a deployment 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} id ID of an existing deployment. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API creates a deployment for the production slot. - * - * @param {object} deployment Deployment details. - * - * @param {string} [deployment.deploymentId] Identifier for deployment. - * - * @param {number} [deployment.status] Deployment status. - * - * @param {string} [deployment.message] Details about deployment status. - * - * @param {string} [deployment.author] Who authored the deployment. - * - * @param {string} [deployment.deployer] Who performed the deployment. - * - * @param {string} [deployment.authorEmail] Author email. - * - * @param {date} [deployment.startTime] Start time. - * - * @param {date} [deployment.endTime] End time. - * - * @param {boolean} [deployment.active] True if deployment is currently active, - * false if completed and null if not started. - * - * @param {string} [deployment.details] Details on deployment. - * - * @param {string} [deployment.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. - */ - createDeploymentSlotWithHttpOperationResponse(resourceGroupName: string, name: string, id: string, slot: string, deployment: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Create a deployment for an app, or a deployment slot. + * @summary Discovers an existing app backup that can be restored from a blob + * in Azure storage. Use this to get information about the databases stored in + * a backup. * - * Create a deployment for an app, or a deployment slot. + * Discovers an existing app backup that can be restored from a blob in Azure + * storage. Use this to get information about the databases stored in a backup. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} id ID of an existing deployment. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API creates a deployment for the production slot. - * - * @param {object} deployment Deployment details. - * - * @param {string} [deployment.deploymentId] Identifier for deployment. - * - * @param {number} [deployment.status] Deployment status. - * - * @param {string} [deployment.message] Details about deployment status. - * - * @param {string} [deployment.author] Who authored the deployment. - * - * @param {string} [deployment.deployer] Who performed the deployment. - * - * @param {string} [deployment.authorEmail] Author email. - * - * @param {date} [deployment.startTime] Start time. - * - * @param {date} [deployment.endTime] End time. - * - * @param {boolean} [deployment.active] True if deployment is currently active, - * false if completed and null if not started. - * - * @param {string} [deployment.details] Details on deployment. - * - * @param {string} [deployment.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. + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * {Promise} A promise is returned. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @resolve {Deployment} - The deserialized result object. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @reject {Error|ServiceError} - The error object. + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [request.siteName] Name of an app. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * {Deployment} [result] - The deserialized result object if an error did not occur. - * See {@link Deployment} for more information. + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, deployment: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, deployment: models.Deployment, callback: ServiceCallback): void; - createDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, deployment: models.Deployment, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Delete a deployment by its ID for an app, or a deployment slot. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * Delete a deployment by its ID for an app, or a deployment slot. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} name Name of the app. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @param {string} id Deployment ID. + * @param {string} [request.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 perform discovery for the production slot. * * @param {object} [options] Optional Parameters. * @@ -29398,108 +29693,68 @@ 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. */ - deleteDeploymentSlotWithHttpOperationResponse(resourceGroupName: string, name: string, id: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + discoverBackupSlotWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Delete a deployment by its ID for an app, or a deployment slot. + * @summary Discovers an existing app backup that can be restored from a blob + * in Azure storage. Use this to get information about the databases stored in + * a backup. * - * Delete a deployment by its ID for an app, or a deployment slot. + * Discovers an existing app backup that can be restored from a blob in Azure + * storage. Use this to get information about the databases stored in a backup. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} id Deployment ID. - * - * @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 {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. - */ - deleteDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, callback: ServiceCallback): void; - deleteDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary List deployment log for specific deployment for an app, or a - * deployment slot. - * - * List deployment log for specific deployment for an app, or a deployment - * slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * @param {string} name Name of the app. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {string} id The ID of a specific deployment. This is the value of the - * name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. * - * @param {object} [options] Optional Parameters. + * @param {string} [request.siteName] Name of an app. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * @returns {Promise} A promise is returned + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * @reject {Error|ServiceError} - The error object. - */ - listDeploymentLogSlotWithHttpOperationResponse(resourceGroupName: string, name: string, id: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary List deployment log for specific deployment for an app, or a - * deployment slot. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * List deployment log for specific deployment for an app, or a deployment - * slot. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} name Name of the app. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @param {string} id The ID of a specific deployment. This is the value of the - * name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". + * @param {string} [request.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 perform discovery for the production slot. * * @param {object} [options] Optional Parameters. * @@ -29513,7 +29768,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Deployment} - The deserialized result object. + * @resolve {RestoreRequest} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -29521,16 +29776,16 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Deployment} [result] - The deserialized result object if an error did not occur. - * See {@link Deployment} for more information. + * {RestoreRequest} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreRequest} 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. */ - listDeploymentLogSlot(resourceGroupName: string, name: string, id: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listDeploymentLogSlot(resourceGroupName: string, name: string, id: string, slot: string, callback: ServiceCallback): void; - listDeploymentLogSlot(resourceGroupName: string, name: string, id: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + discoverBackupSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + discoverBackupSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, callback: ServiceCallback): void; + discoverBackupSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -30456,6 +30711,8 @@ export interface WebApps { * * @param {object} functionEnvelope Function details. * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * * @param {string} [functionEnvelope.scriptHref] Script URI. @@ -30505,6 +30762,8 @@ export interface WebApps { * * @param {object} functionEnvelope Function details. * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * * @param {string} [functionEnvelope.scriptHref] Script URI. @@ -34056,25 +34315,399 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a named add-on of an app. + * + * Gets 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 {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 {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. + */ + getPremierAddOnSlotWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a named add-on of an app. + * + * Gets 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 {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 {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 {PremierAddOn} - 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. + * + * {PremierAddOn} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} 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. + */ + getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, callback: ServiceCallback): void; + getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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 {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. + * + * @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. + */ + addPremierAddOnSlotWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOn, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @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 {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. + * + * @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 {PremierAddOn} - 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. + * + * {PremierAddOn} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} 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. + */ + addPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOn, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + addPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOn, slot: string, callback: ServiceCallback): void; + addPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOn, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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 {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. + * + * @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. + */ + deletePremierAddOnSlotWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @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 {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. + * + * @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. + */ + deletePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deletePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, callback: ServiceCallback): void; + deletePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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} 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. + * + * @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. + */ + updatePremierAddOnSlotWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOnPatchResource, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @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} 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. + * + * @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 {PremierAddOn} - 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. + * + * {PremierAddOn} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} 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. + */ + updatePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOnPatchResource, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updatePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOnPatchResource, slot: string, callback: ServiceCallback): void; + updatePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOnPatchResource, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Gets a named add-on of an app. + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Gets a named add-on of an app. + * 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 Name of the app. - * - * @param {string} premierAddOnName Add-on 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 will get the named add-on for the production slot. + * @param {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -34083,26 +34716,25 @@ 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. */ - getPremierAddOnSlotWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getPrivateAccessSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets a named add-on of an app. + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Gets a named add-on of an app. + * 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 Name of the app. - * - * @param {string} premierAddOnName Add-on 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 will get the named add-on for the production slot. + * @param {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -34116,7 +34748,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {PremierAddOn} - The deserialized result object. + * @resolve {PrivateAccess} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -34124,59 +34756,40 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {PremierAddOn} [result] - The deserialized result object if an error did not occur. - * See {@link PremierAddOn} for more information. + * {PrivateAccess} [result] - The deserialized result object if an error did not occur. + * See {@link PrivateAccess} 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. */ - getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, callback: ServiceCallback): void; - getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getPrivateAccessSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getPrivateAccessSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getPrivateAccessSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Updates a named add-on of an app. + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Updates a named add-on of an app. + * 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 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.premierAddOnName] Premier add on Name. + * @param {string} name The name of the web app. * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * @param {object} access The information for the private access * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * @param {boolean} [access.enabled] Whether private access is enabled or not. * - * @param {string} [premierAddOn.marketplacePublisher] Premier add on - * Marketplace publisher. + * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. * - * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace - * offer. - * - * @param {string} [premierAddOn.kind] Kind of resource. - * - * @param {string} premierAddOn.location Resource Location. + * @param {string} [access.kind] Kind of resource. * - * @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. + * @param {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -34185,128 +34798,34 @@ 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. */ - addPremierAddOnSlotWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOn, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @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.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * - * @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. - * - * @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 {PremierAddOn} - 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. - * - * {PremierAddOn} [result] - The deserialized result object if an error did not occur. - * See {@link PremierAddOn} 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. - */ - addPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOn, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - addPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOn, slot: string, callback: ServiceCallback): void; - addPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOn, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + putPrivateAccessVnetSlotWithHttpOperationResponse(resourceGroupName: string, name: string, access: models.PrivateAccess, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Delete a premier add-on from an app. + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Delete a premier add-on from an app. + * 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 Name of the 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. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned + * @param {string} name The name of the web app. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {object} access The information for the private access * - * @reject {Error|ServiceError} - The error object. - */ - deletePremierAddOnSlotWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Delete a premier add-on from an app. + * @param {boolean} [access.enabled] Whether private access is enabled or not. * - * Delete a premier add-on from an app. + * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {string} [access.kind] Kind of resource. * - * @param {string} name Name of the 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 {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -34320,7 +34839,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {PrivateAccess} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -34328,15 +34847,16 @@ 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. + * {PrivateAccess} [result] - The deserialized result object if an error did not occur. + * See {@link PrivateAccess} 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. */ - deletePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deletePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, callback: ServiceCallback): void; - deletePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + putPrivateAccessVnetSlot(resourceGroupName: string, name: string, access: models.PrivateAccess, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + putPrivateAccessVnetSlot(resourceGroupName: string, name: string, access: models.PrivateAccess, slot: string, callback: ServiceCallback): void; + putPrivateAccessVnetSlot(resourceGroupName: string, name: string, access: models.PrivateAccess, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -35380,110 +35900,136 @@ export interface WebApps { /** - * @summary Recovers a web app to a previous snapshot. + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * Recovers a web app to a previous snapshot. + * 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 web app. + * @param {string} name Name of the app. * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API resets configuration settings for the production slot. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {object} [options] Optional Parameters. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @returns {Promise} A promise is returned * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {boolean} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. + * @reject {Error|ServiceError} - The error object. + */ + resetSlotConfigurationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. + * Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * @param {boolean} [recoveryEntity.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} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} [recoveryEntity.kind] Kind of resource. + * @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 resets configuration settings 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 + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @reject {Error|ServiceError} - The error object. + * {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. */ - recoverSlotWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + resetSlotConfigurationSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + resetSlotConfigurationSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + resetSlotConfigurationSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restarts an app (or deployment slot, if specified). * - * Recovers a web app to a previous snapshot. + * Restarts 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restart the production slot. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {object} [options] Optional Parameters. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @param {boolean} [options.softRestart] Specify true to apply the + * configuration settings and restarts the app only if necessary. By default, + * the API always restarts and reprovisions the app. * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {boolean} [options.synchronous] Specify true to block until the app + * is restarted. By default, it is set to false, and the API responds + * immediately (asynchronous). * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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 {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. + * @returns {Promise} A promise is returned * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {boolean} [recoveryEntity.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. + * @reject {Error|ServiceError} - The error object. + */ + restartSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { softRestart? : boolean, synchronous? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restarts an app (or deployment slot, if specified). * - * @param {string} [recoveryEntity.kind] Kind of resource. + * Restarts an app (or deployment slot, if specified). * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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 restart the production slot. * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.softRestart] Specify true to apply the + * configuration settings and restarts the app only if necessary. By default, + * the API always restarts and reprovisions the app. + * + * @param {boolean} [options.synchronous] Specify true to block until the app + * is restarted. By default, it is set to false, and the API responds + * immediately (asynchronous). + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -35508,25 +36054,63 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - recoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - recoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, callback: ServiceCallback): void; - recoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + restartSlot(resourceGroupName: string, name: string, slot: string, options?: { softRestart? : boolean, synchronous? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + restartSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + restartSlot(resourceGroupName: string, name: string, slot: string, options: { softRestart? : boolean, synchronous? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * @summary Restores an app from a backup blob in Azure Storage. * - * Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * Restores an app from a backup blob in Azure Storage. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * * @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 restore a backup of the production slot. * * @param {object} [options] Optional Parameters. * @@ -35539,22 +36123,60 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - resetSlotConfigurationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + restoreFromBackupBlobSlotWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * @summary Restores an app from a backup blob in Azure Storage. * - * Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * Restores an app from a backup blob in Azure Storage. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * * @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 restore a backup of the production slot. * * @param {object} [options] Optional Parameters. * @@ -35582,33 +36204,40 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - resetSlotConfigurationSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - resetSlotConfigurationSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - resetSlotConfigurationSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + restoreFromBackupBlobSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restoreFromBackupBlobSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, callback: ServiceCallback): void; + restoreFromBackupBlobSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Restarts an app (or deployment slot, if specified). + * @summary Restores a deleted web app to this web app. * - * Restarts an app (or deployment slot, if specified). + * 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 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 restart the production slot. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {object} [options] Optional Parameters. + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} * - * @param {boolean} [options.softRestart] Specify true to apply the - * configuration settings and restarts the app only if necessary. By default, - * the API always restarts and reprovisions the app. + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. * - * @param {boolean} [options.synchronous] Specify true to block until the app - * is restarted. By default, it is set to false, and the API responds - * immediately (asynchronous). + * @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} [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 @@ -35619,30 +36248,173 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - restartSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { softRestart? : boolean, synchronous? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + restoreFromDeletedAppSlotWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Restarts an app (or deployment slot, if specified). + * @summary Restores a deleted web app to this web app. * - * Restarts an app (or deployment slot, if specified). + * 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 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 restart the production slot. + * @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} [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 {boolean} [options.softRestart] Specify true to apply the - * configuration settings and restarts the app only if necessary. By default, - * the API always restarts and reprovisions the app. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [options.synchronous] Specify true to block until the app - * is restarted. By default, it is set to false, and the API responds - * immediately (asynchronous). + * @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. + */ + restoreFromDeletedAppSlot(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restoreFromDeletedAppSlot(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, slot: string, callback: ServiceCallback): void; + restoreFromDeletedAppSlot(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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 {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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + restoreSnapshotSlotWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @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 {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 @@ -35668,9 +36440,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - restartSlot(resourceGroupName: string, name: string, slot: string, options?: { softRestart? : boolean, synchronous? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; - restartSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - restartSlot(resourceGroupName: string, name: string, slot: string, options: { softRestart? : boolean, synchronous? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + restoreSnapshotSlot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restoreSnapshotSlot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, slot: string, callback: ServiceCallback): void; + restoreSnapshotSlot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -40507,6 +41279,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -40525,6 +41299,9 @@ export interface WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -40723,6 +41500,12 @@ export interface WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -40733,6 +41516,13 @@ export interface WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -40808,43 +41598,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -40852,7 +41605,10 @@ export interface WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -40903,6 +41659,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -40921,6 +41679,9 @@ export interface WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -41119,6 +41880,12 @@ export interface WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -41129,6 +41896,13 @@ export interface WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -41204,43 +41978,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -41248,7 +41985,10 @@ export interface WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -41331,7 +42071,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -41349,11 +42089,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. */ - beginRestoreWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRestoreWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Restores a specific backup to another app (or deployment slot, if @@ -41398,7 +42138,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -41421,7 +42161,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -41429,16 +42169,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestoreResponse} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} for more information. + * {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. */ - beginRestore(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRestore(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, callback: ServiceCallback): void; - beginRestore(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRestore(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestore(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, callback: ServiceCallback): void; + beginRestore(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -41641,6 +42380,8 @@ export interface WebApps { * * @param {object} functionEnvelope Function details. * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * * @param {string} [functionEnvelope.scriptHref] Script URI. @@ -41687,6 +42428,8 @@ export interface WebApps { * * @param {object} functionEnvelope Function details. * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * * @param {string} [functionEnvelope.scriptHref] Script URI. @@ -42057,46 +42800,285 @@ export interface WebApps { /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores an app from a backup blob in Azure Storage. * - * Recovers a web app to a previous snapshot. + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.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. + */ + beginRestoreFromBackupBlobWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.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 {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. + */ + beginRestoreFromBackupBlob(resourceGroupName: string, name: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestoreFromBackupBlob(resourceGroupName: string, name: string, request: models.RestoreRequest, callback: ServiceCallback): void; + beginRestoreFromBackupBlob(resourceGroupName: string, name: string, request: models.RestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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 {string} [restoreRequest.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. + */ + beginRestoreFromDeletedAppWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @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 {string} [restoreRequest.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 {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. + */ + beginRestoreFromDeletedApp(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestoreFromDeletedApp(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, callback: ServiceCallback): void; + beginRestoreFromDeletedApp(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -42109,49 +43091,50 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - beginRecoverWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRestoreSnapshotWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -42179,9 +43162,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginRecover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRecover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, callback: ServiceCallback): void; - beginRecover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRestoreSnapshot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestoreSnapshot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, callback: ServiceCallback): void; + beginRestoreSnapshot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -42283,6 +43266,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -42301,6 +43286,9 @@ export interface WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -42499,6 +43487,12 @@ export interface WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -42509,6 +43503,13 @@ export interface WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -42584,43 +43585,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -42628,7 +43592,10 @@ export interface WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -42641,19 +43608,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -42663,7 +43617,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Creates a new web, mobile, or API app in an existing resource @@ -42695,6 +43649,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -42713,6 +43669,9 @@ export interface WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -42911,6 +43870,12 @@ export interface WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -42921,6 +43886,13 @@ export interface WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -42996,43 +43968,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -43040,7 +43975,10 @@ export interface WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -43053,19 +43991,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -43091,9 +44016,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; beginCreateOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, callback: ServiceCallback): void; - beginCreateOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -43139,7 +44064,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -43160,11 +44085,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. */ - beginRestoreSlotWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRestoreSlotWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Restores a specific backup to another app (or deployment slot, if @@ -43209,7 +44134,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -43235,7 +44160,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -43243,16 +44168,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestoreResponse} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} for more information. + * {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. */ - beginRestoreSlot(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRestoreSlot(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, callback: ServiceCallback): void; - beginRestoreSlot(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRestoreSlot(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestoreSlot(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, callback: ServiceCallback): void; + beginRestoreSlot(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -43472,6 +44396,8 @@ export interface WebApps { * * @param {object} functionEnvelope Function details. * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * * @param {string} [functionEnvelope.scriptHref] Script URI. @@ -43521,6 +44447,8 @@ export interface WebApps { * * @param {object} functionEnvelope Function details. * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * * @param {string} [functionEnvelope.scriptHref] Script URI. @@ -43704,46 +44632,297 @@ export interface WebApps { /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores an app from a backup blob in Azure Storage. * - * Recovers a web app to a previous snapshot. + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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 {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. + */ + beginRestoreFromBackupBlobSlotWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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 {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. + */ + beginRestoreFromBackupBlobSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestoreFromBackupBlobSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, callback: ServiceCallback): void; + beginRestoreFromBackupBlobSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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 {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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginRestoreFromDeletedAppSlotWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @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 {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 {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. + */ + beginRestoreFromDeletedAppSlot(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestoreFromDeletedAppSlot(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, slot: string, callback: ServiceCallback): void; + beginRestoreFromDeletedAppSlot(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will * default to production slot. @@ -43759,49 +44938,50 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - beginRecoverSlotWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRestoreSnapshotSlotWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will * default to production slot. @@ -43832,9 +45012,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginRecoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRecoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, callback: ServiceCallback): void; - beginRecoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRestoreSnapshotSlot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestoreSnapshotSlot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, slot: string, callback: ServiceCallback): void; + beginRestoreSnapshotSlot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -48058,6 +49238,15 @@ export interface AppServiceEnvironments { * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User * added ip ranges to whitelist on ASE db * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. * * @param {string} hostingEnvironmentEnvelope.location Resource Location. @@ -48161,6 +49350,15 @@ export interface AppServiceEnvironments { * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User * added ip ranges to whitelist on ASE db * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. * * @param {string} hostingEnvironmentEnvelope.location Resource Location. @@ -48356,6 +49554,15 @@ export interface AppServiceEnvironments { * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User * added ip ranges to whitelist on ASE db * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -48455,6 +49662,15 @@ export interface AppServiceEnvironments { * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User * added ip ranges to whitelist on ASE db * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -48625,6 +49841,83 @@ export interface AppServiceEnvironments { listVips(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} vnetInfo Details for the new virtual network. + * + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. + * + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. + * + * @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. + */ + changeVnetWithHttpOperationResponse(resourceGroupName: string, name: string, vnetInfo: models.VirtualNetworkProfile, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} vnetInfo Details for the new virtual network. + * + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. + * + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + changeVnet(resourceGroupName: string, name: string, vnetInfo: models.VirtualNetworkProfile, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + changeVnet(resourceGroupName: string, name: string, vnetInfo: models.VirtualNetworkProfile, callback: ServiceCallback): void; + changeVnet(resourceGroupName: string, name: string, vnetInfo: models.VirtualNetworkProfile, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Get diagnostic information for an App Service Environment. * @@ -51341,6 +52634,15 @@ export interface AppServiceEnvironments { * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User * added ip ranges to whitelist on ASE db * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. * * @param {string} hostingEnvironmentEnvelope.location Resource Location. @@ -51444,6 +52746,15 @@ export interface AppServiceEnvironments { * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User * added ip ranges to whitelist on ASE db * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. * * @param {string} hostingEnvironmentEnvelope.location Resource Location. @@ -51555,6 +52866,83 @@ export interface AppServiceEnvironments { beginDeleteMethod(resourceGroupName: string, name: string, options: { forceDelete? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} vnetInfo Details for the new virtual network. + * + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. + * + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. + * + * @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. + */ + beginChangeVnetWithHttpOperationResponse(resourceGroupName: string, name: string, vnetInfo: models.VirtualNetworkProfile, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} vnetInfo Details for the new virtual network. + * + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. + * + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + beginChangeVnet(resourceGroupName: string, name: string, vnetInfo: models.VirtualNetworkProfile, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginChangeVnet(resourceGroupName: string, name: string, vnetInfo: models.VirtualNetworkProfile, callback: ServiceCallback): void; + beginChangeVnet(resourceGroupName: string, name: string, vnetInfo: models.VirtualNetworkProfile, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Create or update a multi-role pool. * @@ -52217,6 +53605,67 @@ export interface AppServiceEnvironments { listCapacitiesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @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. + */ + changeVnetNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + changeVnetNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + changeVnetNext(nextPageLink: string, callback: ServiceCallback): void; + changeVnetNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Get global metrics of an App Service Environment. * @@ -53474,6 +54923,67 @@ export interface AppServiceEnvironments { listWebWorkerUsagesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @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. + */ + beginChangeVnetNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + beginChangeVnetNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginChangeVnetNext(nextPageLink: string, callback: ServiceCallback): void; + beginChangeVnetNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Resume an App Service Environment. * @@ -53810,9 +55320,6 @@ export interface AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -53836,9 +55343,15 @@ export interface AppServicePlans { * @param {date} [appServicePlan.spotExpirationTime] The time when the server * farm expires. Valid only if it is a spot server farm. * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * * @param {boolean} [appServicePlan.reserved] If Linux app service plan * true, false otherwise. * + * @param {boolean} [appServicePlan.isXenon] If Hyper-V container app service + * plan true, false otherwise. + * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. @@ -53908,9 +55421,6 @@ export interface AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -53934,9 +55444,15 @@ export interface AppServicePlans { * @param {date} [appServicePlan.spotExpirationTime] The time when the server * farm expires. Valid only if it is a spot server farm. * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * * @param {boolean} [appServicePlan.reserved] If Linux app service plan * true, false otherwise. * + * @param {boolean} [appServicePlan.isXenon] If Hyper-V container app service + * plan true, false otherwise. + * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. @@ -54089,9 +55605,6 @@ export interface AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanPatchResourceName Name for the - * App Service plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -54115,9 +55628,15 @@ export interface AppServicePlans { * @param {date} [appServicePlan.spotExpirationTime] The time when the server * farm expires. Valid only if it is a spot server farm. * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * * @param {boolean} [appServicePlan.reserved] If Linux app service plan * true, false otherwise. * + * @param {boolean} [appServicePlan.isXenon] If Hyper-V container app service + * plan true, false otherwise. + * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. @@ -54149,9 +55668,6 @@ export interface AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanPatchResourceName Name for the - * App Service plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -54175,9 +55691,15 @@ export interface AppServicePlans { * @param {date} [appServicePlan.spotExpirationTime] The time when the server * farm expires. Valid only if it is a spot server farm. * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * * @param {boolean} [appServicePlan.reserved] If Linux app service plan * true, false otherwise. * + * @param {boolean} [appServicePlan.isXenon] If Hyper-V container app service + * plan true, false otherwise. + * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. @@ -55619,9 +57141,6 @@ export interface AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @param {string} [route.startAddress] The starting address for this route. * This may also include a CIDR notation, in which case the end address must * not be specified. @@ -55669,9 +57188,6 @@ export interface AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @param {string} [route.startAddress] The starting address for this route. * This may also include a CIDR notation, in which case the end address must * not be specified. @@ -55810,9 +57326,6 @@ export interface AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @param {string} [route.startAddress] The starting address for this route. * This may also include a CIDR notation, in which case the end address must * not be specified. @@ -55860,9 +57373,6 @@ export interface AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @param {string} [route.startAddress] The starting address for this route. * This may also include a CIDR notation, in which case the end address must * not be specified. @@ -55995,9 +57505,6 @@ export interface AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -56021,9 +57528,15 @@ export interface AppServicePlans { * @param {date} [appServicePlan.spotExpirationTime] The time when the server * farm expires. Valid only if it is a spot server farm. * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * * @param {boolean} [appServicePlan.reserved] If Linux app service plan * true, false otherwise. * + * @param {boolean} [appServicePlan.isXenon] If Hyper-V container app service + * plan true, false otherwise. + * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. @@ -56093,9 +57606,6 @@ export interface AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -56119,9 +57629,15 @@ export interface AppServicePlans { * @param {date} [appServicePlan.spotExpirationTime] The time when the server * farm expires. Valid only if it is a spot server farm. * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * * @param {boolean} [appServicePlan.reserved] If Linux app service plan * true, false otherwise. * + * @param {boolean} [appServicePlan.isXenon] If Hyper-V container app service + * plan true, false otherwise. + * * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. * * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. diff --git a/lib/services/websiteManagement2/lib/operations/index.js b/lib/services/websiteManagement2/lib/operations/index.js index 3a92dd8e10..b0fdef3f0a 100644 --- a/lib/services/websiteManagement2/lib/operations/index.js +++ b/lib/services/websiteManagement2/lib/operations/index.js @@ -24,8 +24,6 @@ exports.DeletedWebApps = require('./deletedWebApps'); exports.Diagnostics = require('./diagnostics'); exports.Provider = require('./provider'); exports.Recommendations = require('./recommendations'); -exports.ResourceHealthMetadataOperations = require('./resourceHealthMetadataOperations'); -exports.BillingMeters = require('./billingMeters'); exports.WebApps = require('./webApps'); exports.AppServiceEnvironments = require('./appServiceEnvironments'); exports.AppServicePlans = require('./appServicePlans'); diff --git a/lib/services/websiteManagement2/lib/operations/provider.js b/lib/services/websiteManagement2/lib/operations/provider.js index e65baac626..064fc16469 100644 --- a/lib/services/websiteManagement2/lib/operations/provider.js +++ b/lib/services/websiteManagement2/lib/operations/provider.js @@ -52,12 +52,14 @@ function _getAvailableStacks(options, callback) { throw new Error('callback cannot be null.'); } let osTypeSelected = (options && options.osTypeSelected !== undefined) ? options.osTypeSelected : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (osTypeSelected !== null && osTypeSelected !== undefined && typeof osTypeSelected.valueOf() !== 'string') { throw new Error('osTypeSelected 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.'); } @@ -72,7 +74,7 @@ function _getAvailableStacks(options, callback) { if (osTypeSelected !== null && osTypeSelected !== undefined) { queryParameters.push('osTypeSelected=' + encodeURIComponent(osTypeSelected)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -114,12 +116,13 @@ function _getAvailableStacks(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) { @@ -190,9 +193,11 @@ function _listOperations(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { + 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.'); } @@ -204,7 +209,7 @@ function _listOperations(options, callback) { let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/operations'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -246,12 +251,13 @@ function _listOperations(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) { @@ -324,7 +330,6 @@ function _getAvailableStacksOnPrem(options, callback) { throw new Error('callback cannot be null.'); } let osTypeSelected = (options && options.osTypeSelected !== undefined) ? options.osTypeSelected : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (osTypeSelected !== null && osTypeSelected !== undefined && typeof osTypeSelected.valueOf() !== 'string') { @@ -333,6 +338,9 @@ function _getAvailableStacksOnPrem(options, callback) { 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.'); } @@ -348,7 +356,7 @@ function _getAvailableStacksOnPrem(options, callback) { if (osTypeSelected !== null && osTypeSelected !== undefined) { queryParameters.push('osTypeSelected=' + encodeURIComponent(osTypeSelected)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -390,12 +398,13 @@ function _getAvailableStacksOnPrem(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) { @@ -520,12 +529,13 @@ function _getAvailableStacksNext(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) { @@ -652,12 +662,13 @@ function _listOperationsNext(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) { @@ -782,12 +793,13 @@ function _getAvailableStacksOnPremNext(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) { diff --git a/lib/services/websiteManagement2/lib/operations/recommendations.js b/lib/services/websiteManagement2/lib/operations/recommendations.js index 66adb54b6a..9a5449c349 100644 --- a/lib/services/websiteManagement2/lib/operations/recommendations.js +++ b/lib/services/websiteManagement2/lib/operations/recommendations.js @@ -59,7 +59,6 @@ function _list(options, callback) { } let featured = (options && options.featured !== undefined) ? options.featured : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (featured !== null && featured !== undefined && typeof featured !== 'boolean') { @@ -71,6 +70,9 @@ function _list(options, callback) { 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.'); } @@ -89,7 +91,7 @@ function _list(options, callback) { if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -131,12 +133,13 @@ function _list(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) { @@ -203,12 +206,14 @@ function _resetAllFilters(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { 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.'); } @@ -221,7 +226,7 @@ function _resetAllFilters(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/reset'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -322,7 +327,6 @@ function _disableRecommendationForSubscription(name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { @@ -331,6 +335,9 @@ function _disableRecommendationForSubscription(name, options, callback) { 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.'); } @@ -344,7 +351,7 @@ function _disableRecommendationForSubscription(name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -422,6 +429,10 @@ function _disableRecommendationForSubscription(name, options, callback) { * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.expiredOnly] Specify false to return + * all recommendations. The default is true, which returns only + * expired recommendations. + * * @param {string} [options.filter] Filter is specified by using OData syntax. * Example: $filter=channels eq 'Api' or channel eq 'Notification' and * startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' @@ -454,8 +465,8 @@ function _listHistoryForWebApp(resourceGroupName, siteName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let expiredOnly = (options && options.expiredOnly !== undefined) ? options.expiredOnly : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -478,12 +489,18 @@ function _listHistoryForWebApp(resourceGroupName, siteName, options, callback) { if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { throw new Error('siteName cannot be null or undefined and it must be of type string.'); } + if (expiredOnly !== null && expiredOnly !== undefined && typeof expiredOnly !== 'boolean') { + throw new Error('expiredOnly must be of type boolean.'); + } 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.'); } + 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.'); } @@ -498,10 +515,13 @@ function _listHistoryForWebApp(resourceGroupName, siteName, options, callback) { requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; + if (expiredOnly !== null && expiredOnly !== undefined) { + queryParameters.push('expiredOnly=' + encodeURIComponent(expiredOnly.toString())); + } if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -543,12 +563,13 @@ function _listHistoryForWebApp(resourceGroupName, siteName, 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) { @@ -632,7 +653,6 @@ function _listRecommendedRulesForWebApp(resourceGroupName, siteName, options, ca } let featured = (options && options.featured !== undefined) ? options.featured : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -664,6 +684,9 @@ function _listRecommendedRulesForWebApp(resourceGroupName, siteName, options, ca 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.'); } @@ -684,7 +707,7 @@ function _listRecommendedRulesForWebApp(resourceGroupName, siteName, options, ca if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -726,12 +749,13 @@ function _listRecommendedRulesForWebApp(resourceGroupName, siteName, options, ca 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) { @@ -803,7 +827,6 @@ function _disableAllForWebApp(resourceGroupName, siteName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -829,6 +852,9 @@ function _disableAllForWebApp(resourceGroupName, siteName, options, callback) { 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.'); } @@ -843,7 +869,7 @@ function _disableAllForWebApp(resourceGroupName, siteName, options, callback) { requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -945,7 +971,6 @@ function _resetAllFiltersForWebApp(resourceGroupName, siteName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -971,6 +996,9 @@ function _resetAllFiltersForWebApp(resourceGroupName, siteName, options, callbac 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.'); } @@ -985,7 +1013,7 @@ function _resetAllFiltersForWebApp(resourceGroupName, siteName, options, callbac requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1099,7 +1127,6 @@ function _getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, cal } let updateSeen = (options && options.updateSeen !== undefined) ? options.updateSeen : undefined; let recommendationId = (options && options.recommendationId !== undefined) ? options.recommendationId : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1134,6 +1161,9 @@ function _getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, cal 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.'); } @@ -1155,7 +1185,7 @@ function _getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, cal if (recommendationId !== null && recommendationId !== undefined) { queryParameters.push('recommendationId=' + encodeURIComponent(recommendationId)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1197,12 +1227,13 @@ function _getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, cal 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) { @@ -1276,7 +1307,6 @@ function _disableRecommendationForSite(resourceGroupName, siteName, name, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1305,6 +1335,9 @@ function _disableRecommendationForSite(resourceGroupName, siteName, name, option 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.'); } @@ -1320,7 +1353,7 @@ function _disableRecommendationForSite(resourceGroupName, siteName, name, option requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1475,12 +1508,13 @@ function _listNext(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) { @@ -1606,12 +1640,13 @@ function _listHistoryForWebAppNext(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) { @@ -1736,12 +1771,13 @@ function _listRecommendedRulesForWebAppNext(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) { @@ -2082,6 +2118,10 @@ class Recommendations { * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.expiredOnly] Specify false to return + * all recommendations. The default is true, which returns only + * expired recommendations. + * * @param {string} [options.filter] Filter is specified by using OData syntax. * Example: $filter=channels eq 'Api' or channel eq 'Notification' and * startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' @@ -2123,6 +2163,10 @@ class Recommendations { * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.expiredOnly] Specify false to return + * all recommendations. The default is true, which returns only + * expired recommendations. + * * @param {string} [options.filter] Filter is specified by using OData syntax. * Example: $filter=channels eq 'Api' or channel eq 'Notification' and * startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' diff --git a/lib/services/websiteManagement2/lib/operations/topLevelDomains.js b/lib/services/websiteManagement2/lib/operations/topLevelDomains.js index ed6c81ea55..20fa9e42ae 100644 --- a/lib/services/websiteManagement2/lib/operations/topLevelDomains.js +++ b/lib/services/websiteManagement2/lib/operations/topLevelDomains.js @@ -48,12 +48,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { 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.'); } @@ -66,7 +68,7 @@ function _list(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -108,12 +110,13 @@ function _list(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) { @@ -183,7 +186,6 @@ function _get(name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { @@ -192,6 +194,9 @@ function _get(name, options, callback) { 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.'); } @@ -205,7 +210,7 @@ function _get(name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -247,12 +252,13 @@ function _get(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) { @@ -335,7 +341,6 @@ function _listAgreements(name, agreementOption, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { @@ -347,6 +352,9 @@ function _listAgreements(name, agreementOption, options, callback) { 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.'); } @@ -360,7 +368,7 @@ function _listAgreements(name, agreementOption, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -416,12 +424,13 @@ function _listAgreements(name, agreementOption, 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) { @@ -546,12 +555,13 @@ function _listNext(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) { @@ -678,12 +688,13 @@ function _listAgreementsNext(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) { diff --git a/lib/services/websiteManagement2/lib/operations/webApps.js b/lib/services/websiteManagement2/lib/operations/webApps.js index 87b187db29..1ddf143e63 100644 --- a/lib/services/websiteManagement2/lib/operations/webApps.js +++ b/lib/services/websiteManagement2/lib/operations/webApps.js @@ -47,12 +47,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { 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.'); } @@ -65,7 +67,7 @@ function _list(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/sites'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -107,12 +109,13 @@ function _list(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) { @@ -188,7 +191,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { throw new Error('callback cannot be null.'); } let includeSlots = (options && options.includeSlots !== undefined) ? options.includeSlots : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -214,6 +216,9 @@ function _listByResourceGroup(resourceGroupName, options, callback) { 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.'); } @@ -230,7 +235,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (includeSlots !== null && includeSlots !== undefined) { queryParameters.push('includeSlots=' + encodeURIComponent(includeSlots.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -272,12 +277,13 @@ function _listByResourceGroup(resourceGroupName, 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) { @@ -350,7 +356,6 @@ function _get(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -376,6 +381,9 @@ function _get(resourceGroupName, name, options, callback) { 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.'); } @@ -390,7 +398,7 @@ function _get(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -503,6 +511,8 @@ function _get(resourceGroupName, name, options, callback) { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -521,6 +531,9 @@ function _get(resourceGroupName, name, options, callback) { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -719,6 +732,12 @@ function _get(resourceGroupName, name, options, callback) { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -729,6 +748,13 @@ function _get(resourceGroupName, name, options, callback) { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -804,43 +830,6 @@ function _get(resourceGroupName, name, options, callback) { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -848,7 +837,10 @@ function _get(resourceGroupName, name, options, callback) { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -973,7 +965,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { } let deleteMetrics = (options && options.deleteMetrics !== undefined) ? options.deleteMetrics : undefined; let deleteEmptyServerFarm = (options && options.deleteEmptyServerFarm !== undefined) ? options.deleteEmptyServerFarm : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1005,6 +996,9 @@ function _deleteMethod(resourceGroupName, name, options, callback) { 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.'); } @@ -1025,7 +1019,7 @@ function _deleteMethod(resourceGroupName, name, options, callback) { if (deleteEmptyServerFarm !== null && deleteEmptyServerFarm !== undefined) { queryParameters.push('deleteEmptyServerFarm=' + encodeURIComponent(deleteEmptyServerFarm.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1120,6 +1114,8 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -1138,6 +1134,9 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -1336,6 +1335,12 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -1346,6 +1351,13 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -1421,43 +1433,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -1492,7 +1467,6 @@ function _update(resourceGroupName, name, siteEnvelope, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1521,6 +1495,9 @@ function _update(resourceGroupName, name, siteEnvelope, options, callback) { 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.'); } @@ -1535,7 +1512,7 @@ function _update(resourceGroupName, name, siteEnvelope, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1591,12 +1568,13 @@ function _update(resourceGroupName, name, siteEnvelope, 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) { @@ -1690,7 +1668,6 @@ function _analyzeCustomHostname(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let hostName = (options && options.hostName !== undefined) ? options.hostName : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1719,6 +1696,9 @@ function _analyzeCustomHostname(resourceGroupName, name, options, callback) { 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.'); } @@ -1736,7 +1716,7 @@ function _analyzeCustomHostname(resourceGroupName, name, options, callback) { if (hostName !== null && hostName !== undefined) { queryParameters.push('hostName=' + encodeURIComponent(hostName)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1778,12 +1758,13 @@ function _analyzeCustomHostname(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) { @@ -1866,7 +1847,6 @@ function _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1895,6 +1875,9 @@ function _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, o 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.'); } @@ -1909,7 +1892,7 @@ function _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, o requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2001,8 +1984,6 @@ function _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, o * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -2033,9 +2014,6 @@ function _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, o * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -2066,7 +2044,6 @@ function _backup(resourceGroupName, name, request, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2095,6 +2072,9 @@ function _backup(resourceGroupName, name, request, options, callback) { 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.'); } @@ -2109,7 +2089,7 @@ function _backup(resourceGroupName, name, request, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2165,12 +2145,13 @@ function _backup(resourceGroupName, name, request, 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) { @@ -2243,7 +2224,6 @@ function _listBackups(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2269,6 +2249,9 @@ function _listBackups(resourceGroupName, name, options, callback) { 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.'); } @@ -2283,7 +2266,7 @@ function _listBackups(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2325,12 +2308,13 @@ function _listBackups(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) { @@ -2366,57 +2350,185 @@ function _listBackups(resourceGroupName, name, options, callback) { } /** - * @summary Discovers an existing app backup that can be restored from a blob - * in Azure storage. + * @summary Gets a backup of an app by its ID. * - * Discovers an existing app backup that can be restored from a blob in Azure - * storage. + * Gets a backup of an app by its ID. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {object} request A RestoreRequest object that includes Azure storage - * URL and blog name for discovery of backup. + * @param {string} backupId ID of the backup. * - * @param {string} request.storageAccountUrl SAS URL to the container. + * @param {object} [options] Optional Parameters. * - * @param {string} [request.blobName] Name of a blob which contains the backup. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} request.overwrite true if the restore - * operation can overwrite target app; otherwise, false. - * true is needed if trying to restore over an existing app. + * @param {function} callback - The callback. * - * @param {string} [request.siteName] Name of an app. + * @returns {function} callback(err, result, request, response) * - * @param {array} [request.databases] Collection of databases which should be - * restored. This list has to match the list of databases included in the - * backup. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when - * restoring an app with custom domains. true to remove custom - * domains automatically. If false, custom domains are added to - * the app's object when it is being restored, but that might fail due to - * conflicts during the operation. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItem} for more information. * - * @param {boolean} [request.ignoreDatabases] Ignore the databases and only - * restore the site content + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [request.appServicePlan] Specify app service plan that will - * own restored site. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getBackupStatus(resourceGroupName, name, backupId, 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 (backupId === null || backupId === undefined || typeof backupId.valueOf() !== 'string') { + throw new Error('backupId 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}/backups/{backupId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); + 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['BackupItem']().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 a backup of an app by its ID. * - * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * Deletes a backup of an app by its ID. * - * @param {boolean} [request.adjustConnectionStrings] true if - * SiteConfig.ConnectionStrings should be set in new app; otherwise, - * false. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} [request.hostingEnvironment] App Service Environment name, - * if needed (only when restoring an app to an App Service Environment). + * @param {string} name Name of the app. * - * @param {string} [request.kind] Kind of resource. + * @param {string} backupId ID of the backup. * * @param {object} [options] Optional Parameters. * @@ -2429,14 +2541,13 @@ function _listBackups(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 RestoreRequest} 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 _discoverRestore(resourceGroupName, name, request, options, callback) { +function _deleteBackup(resourceGroupName, name, backupId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2446,186 +2557,6 @@ function _discoverRestore(resourceGroupName, name, request, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; - // 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 (request === null || request === undefined) { - throw new Error('request 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.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}/backups/discover'; - 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(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 (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) { - 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['RestoreRequest']().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 backup of an app by its ID. - * - * Gets a backup of an app by its ID. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} backupId ID of the backup. - * - * @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 BackupItem} 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 _getBackupStatus(resourceGroupName, name, backupId, 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 apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2654,170 +2585,8 @@ function _getBackupStatus(resourceGroupName, name, backupId, options, callback) 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.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}/backups/{backupId}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(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) { - 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['BackupItem']().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 a backup of an app by its ID. - * - * Deletes a backup of an app by its ID. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} backupId ID of the backup. - * - * @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 _deleteBackup(resourceGroupName, name, backupId, 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 apiVersion = '2016-08-01'; - // 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 (backupId === null || backupId === undefined || typeof backupId.valueOf() !== 'string') { - throw new Error('backupId 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.'); @@ -2834,7 +2603,7 @@ function _deleteBackup(resourceGroupName, name, backupId, options, callback) { requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2919,8 +2688,6 @@ function _deleteBackup(resourceGroupName, name, backupId, options, callback) { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -2951,9 +2718,6 @@ function _deleteBackup(resourceGroupName, name, backupId, options, callback) { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -2984,7 +2748,6 @@ function _listBackupStatusSecrets(resourceGroupName, name, backupId, request, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3016,6 +2779,9 @@ function _listBackupStatusSecrets(resourceGroupName, name, backupId, request, op 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.'); } @@ -3031,7 +2797,7 @@ function _listBackupStatusSecrets(resourceGroupName, name, backupId, request, op requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3087,12 +2853,13 @@ function _listBackupStatusSecrets(resourceGroupName, name, backupId, request, op 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) { @@ -3171,7 +2938,7 @@ function _listBackupStatusSecrets(resourceGroupName, name, backupId, request, op * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -3193,8 +2960,7 @@ function _listBackupStatusSecrets(resourceGroupName, name, backupId, request, op * * {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 RestoreResponse} 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. * @@ -3232,20 +2998,6 @@ function _restore(resourceGroupName, name, backupId, request, options, callback) 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['RestoreResponse']().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); }); @@ -3291,7 +3043,6 @@ function _listConfigurations(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3317,6 +3068,9 @@ function _listConfigurations(resourceGroupName, name, options, callback) { 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.'); } @@ -3331,7 +3085,7 @@ function _listConfigurations(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3373,12 +3127,13 @@ function _listConfigurations(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) { @@ -3457,7 +3212,6 @@ function _updateApplicationSettings(resourceGroupName, name, appSettings, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3486,6 +3240,9 @@ function _updateApplicationSettings(resourceGroupName, name, appSettings, option 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.'); } @@ -3500,7 +3257,7 @@ function _updateApplicationSettings(resourceGroupName, name, appSettings, option requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3556,12 +3313,13 @@ function _updateApplicationSettings(resourceGroupName, name, appSettings, option 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) { @@ -3634,7 +3392,6 @@ function _listApplicationSettings(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3660,6 +3417,9 @@ function _listApplicationSettings(resourceGroupName, name, options, callback) { 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.'); } @@ -3674,7 +3434,7 @@ function _listApplicationSettings(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3716,12 +3476,13 @@ function _listApplicationSettings(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) { @@ -3831,6 +3592,9 @@ function _listApplicationSettings(resourceGroupName, name, options, callback) { * More information on OpenID Connect Discovery: * http://openid.net/specs/openid-connect-discovery-1_0.html * + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. + * * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values * to consider when validating JWTs issued by * Azure Active Directory. Note that the ClientID value is always @@ -3937,7 +3701,6 @@ function _updateAuthSettings(resourceGroupName, name, siteAuthSettings, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3966,6 +3729,9 @@ function _updateAuthSettings(resourceGroupName, name, siteAuthSettings, options, 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.'); } @@ -3980,7 +3746,7 @@ function _updateAuthSettings(resourceGroupName, name, siteAuthSettings, options, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4036,12 +3802,13 @@ function _updateAuthSettings(resourceGroupName, name, siteAuthSettings, 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) { @@ -4114,7 +3881,6 @@ function _getAuthSettings(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4140,6 +3906,9 @@ function _getAuthSettings(resourceGroupName, name, options, callback) { 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.'); } @@ -4154,7 +3923,7 @@ function _getAuthSettings(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4196,12 +3965,13 @@ function _getAuthSettings(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) { @@ -4248,8 +4018,6 @@ function _getAuthSettings(resourceGroupName, name, options, callback) { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -4280,9 +4048,6 @@ function _getAuthSettings(resourceGroupName, name, options, callback) { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -4313,7 +4078,6 @@ function _updateBackupConfiguration(resourceGroupName, name, request, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4342,6 +4106,9 @@ function _updateBackupConfiguration(resourceGroupName, name, request, options, c 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.'); } @@ -4356,7 +4123,7 @@ function _updateBackupConfiguration(resourceGroupName, name, request, options, c requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4412,12 +4179,13 @@ function _updateBackupConfiguration(resourceGroupName, name, request, options, c 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) { @@ -4489,7 +4257,6 @@ function _deleteBackupConfiguration(resourceGroupName, name, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4515,6 +4282,9 @@ function _deleteBackupConfiguration(resourceGroupName, name, options, callback) 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.'); } @@ -4529,7 +4299,7 @@ function _deleteBackupConfiguration(resourceGroupName, name, options, callback) requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4632,7 +4402,6 @@ function _getBackupConfiguration(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4658,6 +4427,9 @@ function _getBackupConfiguration(resourceGroupName, name, options, callback) { 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.'); } @@ -4672,7 +4444,7 @@ function _getBackupConfiguration(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4714,12 +4486,13 @@ function _getBackupConfiguration(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) { @@ -4800,7 +4573,6 @@ function _updateConnectionStrings(resourceGroupName, name, connectionStrings, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4829,6 +4601,9 @@ function _updateConnectionStrings(resourceGroupName, name, connectionStrings, op 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.'); } @@ -4843,7 +4618,7 @@ function _updateConnectionStrings(resourceGroupName, name, connectionStrings, op requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4899,12 +4674,13 @@ function _updateConnectionStrings(resourceGroupName, name, connectionStrings, op 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) { @@ -4978,7 +4754,6 @@ function _listConnectionStrings(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5004,6 +4779,9 @@ function _listConnectionStrings(resourceGroupName, name, options, callback) { 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.'); } @@ -5018,7 +4796,7 @@ function _listConnectionStrings(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5060,12 +4838,13 @@ function _listConnectionStrings(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) { @@ -5138,7 +4917,6 @@ function _getDiagnosticLogsConfiguration(resourceGroupName, name, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5164,6 +4942,9 @@ function _getDiagnosticLogsConfiguration(resourceGroupName, name, options, callb 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.'); } @@ -5178,7 +4959,7 @@ function _getDiagnosticLogsConfiguration(resourceGroupName, name, options, callb requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5220,12 +5001,13 @@ function _getDiagnosticLogsConfiguration(resourceGroupName, name, 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) { @@ -5382,7 +5164,6 @@ function _updateDiagnosticLogsConfig(resourceGroupName, name, siteLogsConfig, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5411,6 +5192,9 @@ function _updateDiagnosticLogsConfig(resourceGroupName, name, siteLogsConfig, op 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.'); } @@ -5425,7 +5209,7 @@ function _updateDiagnosticLogsConfig(resourceGroupName, name, siteLogsConfig, op requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5481,12 +5265,13 @@ function _updateDiagnosticLogsConfig(resourceGroupName, name, siteLogsConfig, op 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) { @@ -5566,7 +5351,6 @@ function _updateMetadata(resourceGroupName, name, metadata, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5595,6 +5379,9 @@ function _updateMetadata(resourceGroupName, name, metadata, options, callback) { 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.'); } @@ -5609,7 +5396,7 @@ function _updateMetadata(resourceGroupName, name, metadata, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5665,12 +5452,13 @@ function _updateMetadata(resourceGroupName, name, metadata, 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) { @@ -5743,7 +5531,6 @@ function _listMetadata(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5769,6 +5556,9 @@ function _listMetadata(resourceGroupName, name, options, callback) { 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.'); } @@ -5783,7 +5573,7 @@ function _listMetadata(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5825,12 +5615,13 @@ function _listMetadata(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) { @@ -6006,7 +5797,6 @@ function _updateSitePushSettings(resourceGroupName, name, pushSettings, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6035,6 +5825,9 @@ function _updateSitePushSettings(resourceGroupName, name, pushSettings, options, 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.'); } @@ -6049,7 +5842,7 @@ function _updateSitePushSettings(resourceGroupName, name, pushSettings, options, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6105,12 +5898,13 @@ function _updateSitePushSettings(resourceGroupName, name, pushSettings, 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) { @@ -6183,7 +5977,6 @@ function _listSitePushSettings(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6209,6 +6002,9 @@ function _listSitePushSettings(resourceGroupName, name, options, callback) { 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.'); } @@ -6223,7 +6019,7 @@ function _listSitePushSettings(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6265,12 +6061,13 @@ function _listSitePushSettings(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) { @@ -6346,7 +6143,6 @@ function _listSlotConfigurationNames(resourceGroupName, name, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6372,6 +6168,9 @@ function _listSlotConfigurationNames(resourceGroupName, name, options, callback) 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.'); } @@ -6386,7 +6185,7 @@ function _listSlotConfigurationNames(resourceGroupName, name, options, callback) requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6428,12 +6227,13 @@ function _listSlotConfigurationNames(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) { @@ -6520,7 +6320,6 @@ function _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6549,6 +6348,9 @@ function _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, 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.'); } @@ -6563,7 +6365,7 @@ function _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6619,12 +6421,13 @@ function _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, 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) { @@ -6660,11 +6463,9 @@ function _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, } /** - * @summary Gets the configuration of an app, such as platform version and - * bitness, default documents, virtual applications, Always On, etc. + * @summary Gets a Swift Virtual Network connection. * - * Gets the configuration of an app, such as platform version and bitness, - * default documents, virtual applications, Always On, etc. + * Gets a Swift Virtual Network connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -6683,13 +6484,13 @@ function _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, * {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 SiteConfigResource} for more information. + * See {@link SwiftVirtualNetwork} 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 _getConfiguration(resourceGroupName, name, options, callback) { +function _getSwiftVirtualNetworkConnection(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -6699,7 +6500,6 @@ function _getConfiguration(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6725,6 +6525,9 @@ function _getConfiguration(resourceGroupName, name, options, callback) { 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.'); } @@ -6734,12 +6537,12 @@ function _getConfiguration(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}/config/web'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/virtualNetwork'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6781,12 +6584,13 @@ function _getConfiguration(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) { @@ -6806,7 +6610,7 @@ function _getConfiguration(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigResource']().mapper(); + let resultMapper = new client.models['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -6822,219 +6626,32 @@ function _getConfiguration(resourceGroupName, name, options, callback) { } /** - * @summary Updates the configuration of an app. + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. * - * Updates the configuration of an app. + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {object} siteConfig JSON representation of a SiteConfig object. See - * example. - * - * @param {number} [siteConfig.numberOfWorkers] Number of workers. - * - * @param {array} [siteConfig.defaultDocuments] Default documents. - * - * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. - * - * @param {string} [siteConfig.phpVersion] Version of PHP. - * - * @param {string} [siteConfig.pythonVersion] Version of Python. - * - * @param {string} [siteConfig.nodeVersion] Version of Node.js. - * - * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version - * - * @param {boolean} [siteConfig.requestTracingEnabled] true if - * request tracing is enabled; otherwise, false. - * - * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing - * expiration time. - * - * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if - * remote debugging is enabled; otherwise, false. - * - * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging - * version. - * - * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP - * logging is enabled; otherwise, false. - * - * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size - * limit. - * - * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true - * if detailed error logging is enabled; otherwise, false. - * - * @param {string} [siteConfig.publishingUsername] Publishing user name. - * - * @param {array} [siteConfig.appSettings] Application settings. - * - * @param {array} [siteConfig.connectionStrings] Connection strings. - * - * @param {array} [siteConfig.handlerMappings] Handler mappings. - * - * @param {string} [siteConfig.documentRoot] Document root. - * - * @param {string} [siteConfig.scmType] SCM type. Possible values include: - * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', - * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', - * 'VSO' - * - * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use - * 32-bit worker process; otherwise, false. - * - * @param {boolean} [siteConfig.webSocketsEnabled] true if - * WebSocket is enabled; otherwise, false. - * - * @param {boolean} [siteConfig.alwaysOn] true if Always On is - * enabled; otherwise, false. - * - * @param {string} [siteConfig.javaVersion] Java version. - * - * @param {string} [siteConfig.javaContainer] Java container. - * - * @param {string} [siteConfig.javaContainerVersion] Java container version. - * - * @param {string} [siteConfig.appCommandLine] App command line to launch. - * - * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. - * Possible values include: 'Integrated', 'Classic' - * - * @param {array} [siteConfig.virtualApplications] Virtual applications. - * - * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible - * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', - * 'WeightedTotalTraffic', 'RequestHash' - * - * @param {object} [siteConfig.experiments] This is work around for polymophic - * types. - * - * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. - * - * @param {object} [siteConfig.limits] Site limits. - * - * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU - * usage percentage. - * - * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory - * usage in MB. - * - * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk - * size usage in MB. - * - * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal - * is enabled; otherwise, false. - * - * @param {object} [siteConfig.autoHealRules] Auto Heal rules. - * - * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe - * when to execute the auto-heal actions. - * - * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on - * total requests. - * - * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request - * Count. - * - * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] - * Time interval. - * - * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule - * based on private bytes. - * - * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based - * on status codes. - * - * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule - * based on request execution time. - * - * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] - * Time taken. - * - * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] - * Request Count. - * - * @param {string} - * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. - * - * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed - * when a rule is triggered. - * - * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined - * action to be taken. Possible values include: 'Recycle', 'LogEvent', - * 'CustomAction' - * - * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom - * action to be taken. - * - * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] - * Executable to be run. - * - * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] - * Parameters for the executable. - * - * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] - * Minimum time the process must execute - * before taking the action - * - * @param {string} [siteConfig.tracingOptions] Tracing options. - * - * @param {string} [siteConfig.vnetName] Virtual Network name. - * - * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) - * settings. - * - * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of - * origins that should be allowed to make cross-origin - * calls (for example: http://example.com:12345). Use "*" to allow all. - * - * @param {object} [siteConfig.push] Push endpoint settings. - * - * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag - * indicating whether the Push endpoint is enabled. - * - * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON - * string containing a list of tags that are whitelisted for use by the push - * registration endpoint. - * - * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON - * string containing a list of tags that require user authentication to be used - * in the push registration endpoint. - * Tags can consist of alphanumeric characters and the following: - * '_', '@', '#', '.', ':', '-'. - * Validation should be performed at the PushRequestHandler. - * - * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string - * containing a list of dynamic tags that will be evaluated from user claims in - * the push registration endpoint. - * - * @param {string} [siteConfig.push.kind] Kind of resource. - * - * @param {object} [siteConfig.apiDefinition] Information about the formal API - * definition for the app. - * - * @param {string} [siteConfig.apiDefinition.url] The URL of the API - * definition. - * - * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. - * - * @param {boolean} [siteConfig.localMySqlEnabled] true to enable - * local MySQL; otherwise, false. - * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. * - * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web - * site to allow clients to connect over http2.0 + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. * - * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the - * minimum version of TLS required for SSL requests. Possible values include: - * '1.0', '1.1', '1.2' + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. * - * @param {string} [siteConfig.kind] Kind of resource. + * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -7048,13 +6665,13 @@ function _getConfiguration(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 SiteConfigResource} for more information. + * See {@link SwiftVirtualNetwork} 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 _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, options, callback) { +function _createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -7064,7 +6681,6 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7087,12 +6703,15 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio 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 (siteConfig === null || siteConfig === undefined) { - throw new Error('siteConfig cannot be null or undefined.'); + 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.'); } @@ -7102,12 +6721,12 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/virtualNetwork'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -7136,14 +6755,14 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio let requestContent = null; let requestModel = null; try { - if (siteConfig !== null && siteConfig !== undefined) { - let requestModelMapper = new client.models['SiteConfigResource']().mapper(); - requestModel = client.serialize(requestModelMapper, siteConfig, 'siteConfig'); + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['SwiftVirtualNetwork']().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(siteConfig, null, 2)}.`); + `payload - ${JSON.stringify(connectionEnvelope, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -7163,12 +6782,13 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio 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) { @@ -7188,7 +6808,7 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigResource']().mapper(); + let resultMapper = new client.models['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -7204,220 +6824,16 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio } /** - * @summary Updates the configuration of an app. + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). * - * Updates the configuration of an app. + * Deletes a Swift Virtual Network connection from an app (or deployment slot). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {object} siteConfig JSON representation of a SiteConfig object. See - * example. - * - * @param {number} [siteConfig.numberOfWorkers] Number of workers. - * - * @param {array} [siteConfig.defaultDocuments] Default documents. - * - * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. - * - * @param {string} [siteConfig.phpVersion] Version of PHP. - * - * @param {string} [siteConfig.pythonVersion] Version of Python. - * - * @param {string} [siteConfig.nodeVersion] Version of Node.js. - * - * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version - * - * @param {boolean} [siteConfig.requestTracingEnabled] true if - * request tracing is enabled; otherwise, false. - * - * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing - * expiration time. - * - * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if - * remote debugging is enabled; otherwise, false. - * - * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging - * version. - * - * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP - * logging is enabled; otherwise, false. - * - * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size - * limit. - * - * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true - * if detailed error logging is enabled; otherwise, false. - * - * @param {string} [siteConfig.publishingUsername] Publishing user name. - * - * @param {array} [siteConfig.appSettings] Application settings. - * - * @param {array} [siteConfig.connectionStrings] Connection strings. - * - * @param {array} [siteConfig.handlerMappings] Handler mappings. - * - * @param {string} [siteConfig.documentRoot] Document root. - * - * @param {string} [siteConfig.scmType] SCM type. Possible values include: - * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', - * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', - * 'VSO' - * - * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use - * 32-bit worker process; otherwise, false. - * - * @param {boolean} [siteConfig.webSocketsEnabled] true if - * WebSocket is enabled; otherwise, false. - * - * @param {boolean} [siteConfig.alwaysOn] true if Always On is - * enabled; otherwise, false. - * - * @param {string} [siteConfig.javaVersion] Java version. - * - * @param {string} [siteConfig.javaContainer] Java container. - * - * @param {string} [siteConfig.javaContainerVersion] Java container version. - * - * @param {string} [siteConfig.appCommandLine] App command line to launch. - * - * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. - * Possible values include: 'Integrated', 'Classic' - * - * @param {array} [siteConfig.virtualApplications] Virtual applications. - * - * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible - * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', - * 'WeightedTotalTraffic', 'RequestHash' - * - * @param {object} [siteConfig.experiments] This is work around for polymophic - * types. - * - * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. - * - * @param {object} [siteConfig.limits] Site limits. - * - * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU - * usage percentage. - * - * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory - * usage in MB. - * - * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk - * size usage in MB. - * - * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal - * is enabled; otherwise, false. - * - * @param {object} [siteConfig.autoHealRules] Auto Heal rules. - * - * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe - * when to execute the auto-heal actions. - * - * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on - * total requests. - * - * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request - * Count. - * - * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] - * Time interval. - * - * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule - * based on private bytes. - * - * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based - * on status codes. - * - * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule - * based on request execution time. - * - * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] - * Time taken. - * - * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] - * Request Count. - * - * @param {string} - * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. - * - * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed - * when a rule is triggered. - * - * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined - * action to be taken. Possible values include: 'Recycle', 'LogEvent', - * 'CustomAction' - * - * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom - * action to be taken. - * - * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] - * Executable to be run. - * - * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] - * Parameters for the executable. - * - * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] - * Minimum time the process must execute - * before taking the action - * - * @param {string} [siteConfig.tracingOptions] Tracing options. - * - * @param {string} [siteConfig.vnetName] Virtual Network name. - * - * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) - * settings. - * - * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of - * origins that should be allowed to make cross-origin - * calls (for example: http://example.com:12345). Use "*" to allow all. - * - * @param {object} [siteConfig.push] Push endpoint settings. - * - * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag - * indicating whether the Push endpoint is enabled. - * - * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON - * string containing a list of tags that are whitelisted for use by the push - * registration endpoint. - * - * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON - * string containing a list of tags that require user authentication to be used - * in the push registration endpoint. - * Tags can consist of alphanumeric characters and the following: - * '_', '@', '#', '.', ':', '-'. - * Validation should be performed at the PushRequestHandler. - * - * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string - * containing a list of dynamic tags that will be evaluated from user claims in - * the push registration endpoint. - * - * @param {string} [siteConfig.push.kind] Kind of resource. - * - * @param {object} [siteConfig.apiDefinition] Information about the formal API - * definition for the app. - * - * @param {string} [siteConfig.apiDefinition.url] The URL of the API - * definition. - * - * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. - * - * @param {boolean} [siteConfig.localMySqlEnabled] true to enable - * local MySQL; otherwise, false. - * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. - * - * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web - * site to allow clients to connect over http2.0 - * - * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the - * minimum version of TLS required for SSL requests. Possible values include: - * '1.0', '1.1', '1.2' - * - * @param {string} [siteConfig.kind] Kind of resource. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7429,14 +6845,13 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, 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 SiteConfigResource} 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 _updateConfiguration(resourceGroupName, name, siteConfig, options, callback) { +function _deleteSwiftVirtualNetwork(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -7446,7 +6861,6 @@ function _updateConfiguration(resourceGroupName, name, siteConfig, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7469,12 +6883,12 @@ function _updateConfiguration(resourceGroupName, name, siteConfig, 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 (siteConfig === null || siteConfig === undefined) { - throw new Error('siteConfig 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.'); } @@ -7484,19 +6898,19 @@ function _updateConfiguration(resourceGroupName, name, siteConfig, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/virtualNetwork'; 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(apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -7514,28 +6928,14 @@ function _updateConfiguration(resourceGroupName, name, siteConfig, options, call } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (siteConfig !== null && siteConfig !== undefined) { - let requestModelMapper = new client.models['SiteConfigResource']().mapper(); - requestModel = client.serialize(requestModelMapper, siteConfig, 'siteConfig'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(siteConfig, 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); @@ -7563,40 +6963,39 @@ function _updateConfiguration(resourceGroupName, name, siteConfig, options, call // 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['SiteConfigResource']().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 list of web app configuration snapshots identifiers. Each - * element of the list contains a timestamp and the ID of the snapshot. + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. * - * Gets a list of web app configuration snapshots identifiers. Each element of - * the list contains a timestamp and the ID of the snapshot. + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7609,14 +7008,13 @@ function _updateConfiguration(resourceGroupName, name, siteConfig, 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 SiteConfigurationSnapshotInfoCollection} for - * more information. + * See {@link SwiftVirtualNetwork} 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 _listConfigurationSnapshotInfo(resourceGroupName, name, options, callback) { +function _updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -7626,7 +7024,6 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7649,9 +7046,15 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, 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 (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.'); } @@ -7661,19 +7064,19 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/virtualNetwork'; 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(apiVersion)); + 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 = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -7691,7 +7094,21 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['SwiftVirtualNetwork']().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) { @@ -7708,12 +7125,13 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, 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) { @@ -7733,7 +7151,7 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba 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['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -7749,18 +7167,17 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba } /** - * @summary Gets a snapshot of the configuration of an app at a previous point - * in time. + * @summary Gets the configuration of an app, such as platform version and + * bitness, default documents, virtual applications, Always On, etc. * - * Gets a snapshot of the configuration of an app at a previous point in time. + * Gets the configuration of an app, such as platform version and bitness, + * default documents, virtual applications, Always On, etc. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} snapshotId The ID of the snapshot to read. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7779,7 +7196,7 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, callback) { +function _getConfiguration(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -7789,7 +7206,6 @@ function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7812,12 +7228,12 @@ function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, 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 (snapshotId === null || snapshotId === undefined || typeof snapshotId.valueOf() !== 'string') { - throw new Error('snapshotId 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.'); } @@ -7827,13 +7243,12 @@ function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{snapshotId}', encodeURIComponent(snapshotId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -7875,12 +7290,13 @@ function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, 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) { @@ -7916,191 +7332,264 @@ function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, } /** - * @summary Reverts the configuration of an app to a previous snapshot. + * @summary Updates the configuration of an app. * - * Reverts the configuration of an app to a previous snapshot. + * Updates the 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} snapshotId The ID of the snapshot to read. + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. * - * @param {object} [options] Optional Parameters. + * @param {number} [siteConfig.numberOfWorkers] Number of workers. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [siteConfig.defaultDocuments] Default documents. * - * @param {function} callback - The callback. + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. * - * @returns {function} callback(err, result, request, response) + * @param {string} [siteConfig.phpVersion] Version of PHP. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} [siteConfig.pythonVersion] Version of Python. * - * {null} [result] - The deserialized result object if an error did not occur. + * @param {string} [siteConfig.nodeVersion] Version of Node.js. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _recoverSiteConfigurationSnapshot(resourceGroupName, name, snapshotId, 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 apiVersion = '2016-08-01'; - // 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 (snapshotId === null || snapshotId === undefined || typeof snapshotId.valueOf() !== 'string') { - throw new Error('snapshotId 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.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}/config/web/snapshots/{snapshotId}/recover'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{snapshotId}', encodeURIComponent(snapshotId)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(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 !== 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 last lines of docker logs for the given site + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version * - * Gets the last lines of docker logs for the given site + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. * - * @param {string} name Name of web app. + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. * - * @param {object} [options] Optional Parameters. + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. * - * @param {function} callback - The callback. + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. * - * @returns {function} callback(err, result, request, response) + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} [siteConfig.publishingUsername] Publishing user name. * - * {object} [result] - The deserialized result object if an error did not occur. + * @param {array} [siteConfig.appSettings] Application settings. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {array} [siteConfig.connectionStrings] Connection strings. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _getWebSiteContainerLogs(resourceGroupName, name, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.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 SiteConfigResource} 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 _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, 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 apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8123,9 +7612,15 @@ function _getWebSiteContainerLogs(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 (siteConfig === null || siteConfig === undefined) { + throw new Error('siteConfig 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.'); } @@ -8135,19 +7630,19 @@ function _getWebSiteContainerLogs(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}/containerlogs'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/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(apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -8165,31 +7660,44 @@ function _getWebSiteContainerLogs(resourceGroupName, name, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteConfig !== null && siteConfig !== undefined) { + let requestModelMapper = new client.models['SiteConfigResource']().mapper(); + requestModel = client.serialize(requestModelMapper, siteConfig, 'siteConfig'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteConfig, 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 && statusCode !== 204) { - let error = new Error(`Unexpected status code: ${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 { - 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; - 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) { @@ -8199,22 +7707,261 @@ function _getWebSiteContainerLogs(resourceGroupName, name, 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['SiteConfigResource']().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 ZIP archived docker log files for the given site + * @summary Updates the configuration of an app. * - * Gets the ZIP archived docker log files for the given site + * Updates the configuration of an app. * * @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} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -8228,12 +7975,13 @@ function _getWebSiteContainerLogs(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 SiteConfigResource} 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 _getWebSiteContainerLogsZip(resourceGroupName, name, options, callback) { +function _updateConfiguration(resourceGroupName, name, siteConfig, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -8243,7 +7991,6 @@ function _getWebSiteContainerLogsZip(resourceGroupName, name, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8266,9 +8013,15 @@ function _getWebSiteContainerLogsZip(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 (siteConfig === null || siteConfig === undefined) { + throw new Error('siteConfig 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.'); } @@ -8278,19 +8031,19 @@ function _getWebSiteContainerLogsZip(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}/containerlogs/zip/download'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/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(apiVersion)); + 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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -8308,31 +8061,44 @@ function _getWebSiteContainerLogsZip(resourceGroupName, name, options, callback) } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteConfig !== null && siteConfig !== undefined) { + let requestModelMapper = new client.models['SiteConfigResource']().mapper(); + requestModel = client.serialize(requestModelMapper, siteConfig, 'siteConfig'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteConfig, 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 && statusCode !== 204) { - let error = new Error(`Unexpected status code: ${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 { - 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; - 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) { @@ -8342,22 +8108,42 @@ function _getWebSiteContainerLogsZip(resourceGroupName, name, options, callback) } return callback(error); } - // Create Result - let result = response; - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary List continuous web jobs for an app, or a deployment slot. - * - * List continuous web jobs for an app, or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + 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['SiteConfigResource']().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 list of web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. * - * @param {string} name Site name. + * 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} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -8371,14 +8157,14 @@ function _getWebSiteContainerLogsZip(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 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 _listContinuousWebJobs(resourceGroupName, name, options, callback) { +function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -8388,7 +8174,6 @@ function _listContinuousWebJobs(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8414,6 +8199,9 @@ function _listContinuousWebJobs(resourceGroupName, name, options, callback) { 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.'); } @@ -8423,12 +8211,12 @@ function _listContinuousWebJobs(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}/continuouswebjobs'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -8470,12 +8258,13 @@ function _listContinuousWebJobs(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) { @@ -8495,7 +8284,7 @@ function _listContinuousWebJobs(resourceGroupName, name, 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) { @@ -8511,17 +8300,17 @@ function _listContinuousWebJobs(resourceGroupName, name, options, callback) { } /** - * @summary Gets a continuous web job by its ID for an app, or a deployment - * slot. + * @summary Gets a snapshot of the configuration of an app at a previous point + * in time. * - * Gets a continuous web job by its ID for an app, or a deployment slot. + * Gets a snapshot of the configuration of an app at a previous point in time. * * @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 Web Job. + * @param {string} snapshotId The ID of the snapshot to read. * * @param {object} [options] Optional Parameters. * @@ -8535,13 +8324,13 @@ function _listContinuousWebJobs(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 ContinuousWebJob} for more information. + * See {@link SiteConfigResource} 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 _getContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { +function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -8551,7 +8340,6 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8574,12 +8362,15 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, 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 (snapshotId === null || snapshotId === undefined || typeof snapshotId.valueOf() !== 'string') { + throw new Error('snapshotId 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.'); } @@ -8589,13 +8380,13 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{snapshotId}', encodeURIComponent(snapshotId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -8627,7 +8418,7 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call 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); @@ -8637,12 +8428,13 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, 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) { @@ -8662,7 +8454,7 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ContinuousWebJob']().mapper(); + let resultMapper = new client.models['SiteConfigResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -8678,17 +8470,16 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call } /** - * @summary Delete a continuous web job by its ID for an app, or a deployment - * slot. + * @summary Reverts the configuration of an app to a previous snapshot. * - * Delete a continuous web job by its ID for an app, or a deployment slot. + * Reverts the configuration of an app to a previous snapshot. * * @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 Web Job. + * @param {string} snapshotId The ID of the snapshot to read. * * @param {object} [options] Optional Parameters. * @@ -8707,7 +8498,7 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { +function _recoverSiteConfigurationSnapshot(resourceGroupName, name, snapshotId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -8717,7 +8508,6 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8740,12 +8530,15 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, 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 (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 (snapshotId === null || snapshotId === undefined || typeof snapshotId.valueOf() !== 'string') { + throw new Error('snapshotId 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.'); } @@ -8755,20 +8548,20 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, c // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}/recover'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{snapshotId}', encodeURIComponent(snapshotId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -8793,7 +8586,7 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, c return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -8827,16 +8620,14 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, c } /** - * @summary Start a continuous web job for an app, or a deployment slot. + * @summary Gets the last lines of docker logs for the given site * - * Start a continuous web job for an app, or a deployment slot. + * Gets the last lines of docker logs for the given site * * @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 web app. * * @param {object} [options] Optional Parameters. * @@ -8849,13 +8640,13 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, c * * {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. * * {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 _startContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { +function _getWebSiteContainerLogs(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -8865,7 +8656,6 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8888,12 +8678,157 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, 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 (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}/containerlogs'; + 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 + httpRequest.streamedResponse = true; + 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(`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) { + 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 = response; + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets the ZIP archived docker log files for the given site + * + * Gets the ZIP archived docker log files for the given site + * + * @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 {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 _getContainerLogsZip(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.'); } @@ -8903,13 +8838,12 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -8936,20 +8870,22 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, options, ca } 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); + if (statusCode !== 200 && statusCode !== 204) { + 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; @@ -8966,26 +8902,23 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, options, ca } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } /** - * @summary Stop a continuous web job for an app, or a deployment slot. + * @summary List continuous web jobs for an app, or a deployment slot. * - * Stop a continuous web job for an app, or a deployment slot. + * List continuous 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 @@ -8997,13 +8930,15 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, options, ca * * {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 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 _stopContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { +function _listContinuousWebJobs(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9013,7 +8948,6 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9036,12 +8970,12 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, 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 (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.'); } @@ -9051,20 +8985,19 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs'; 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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -9089,7 +9022,7 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, options, cal 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); @@ -9099,12 +9032,13 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, options, cal 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) { @@ -9117,20 +9051,40 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, 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['ContinuousWebJobCollection']().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 deployments for an app, or a deployment slot. + * @summary Gets a continuous web job by its ID for an app, or a deployment + * slot. * - * List deployments for an app, or a deployment slot. + * Gets a continuous 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 Name of the app. + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -9144,13 +9098,13 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, 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 DeploymentCollection} for more information. + * See {@link ContinuousWebJob} 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 _listDeployments(resourceGroupName, name, options, callback) { +function _getContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9160,7 +9114,6 @@ function _listDeployments(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9183,9 +9136,15 @@ function _listDeployments(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.'); } + 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.'); } @@ -9195,12 +9154,13 @@ function _listDeployments(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}/deployments'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -9232,7 +9192,7 @@ function _listDeployments(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); @@ -9267,7 +9227,7 @@ function _listDeployments(resourceGroupName, name, 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['ContinuousWebJob']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -9283,16 +9243,17 @@ function _listDeployments(resourceGroupName, name, options, callback) { } /** - * @summary Get a deployment by its ID for an app, or a deployment slot. + * @summary Delete a continuous web job by its ID for an app, or a deployment + * slot. * - * Get a deployment by its ID for an app, or a deployment slot. + * Delete a continuous 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 Name of the app. + * @param {string} name Site name. * - * @param {string} id Deployment ID. + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -9305,14 +9266,13 @@ function _listDeployments(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 Deployment} 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 _getDeployment(resourceGroupName, name, id, options, callback) { +function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9322,7 +9282,6 @@ function _getDeployment(resourceGroupName, name, id, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9345,12 +9304,15 @@ function _getDeployment(resourceGroupName, name, id, 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 (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 (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.'); } @@ -9360,20 +9322,20 @@ function _getDeployment(resourceGroupName, name, id, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -9398,7 +9360,7 @@ function _getDeployment(resourceGroupName, name, id, 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); @@ -9426,64 +9388,22 @@ function _getDeployment(resourceGroupName, name, id, 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['Deployment']().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 Create a deployment for an app, or a deployment slot. + * @summary Start a continuous web job for an app, or a deployment slot. * - * Create a deployment for an app, or a deployment slot. + * Start a continuous 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} id ID of an existing deployment. - * - * @param {object} deployment Deployment details. - * - * @param {string} [deployment.deploymentId] Identifier for deployment. - * - * @param {number} [deployment.status] Deployment status. - * - * @param {string} [deployment.message] Details about deployment status. - * - * @param {string} [deployment.author] Who authored the deployment. - * - * @param {string} [deployment.deployer] Who performed the deployment. - * - * @param {string} [deployment.authorEmail] Author email. - * - * @param {date} [deployment.startTime] Start time. - * - * @param {date} [deployment.endTime] End time. - * - * @param {boolean} [deployment.active] True if deployment is currently active, - * false if completed and null if not started. - * - * @param {string} [deployment.details] Details on deployment. + * @param {string} name Site name. * - * @param {string} [deployment.kind] Kind of resource. + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -9496,14 +9416,13 @@ function _getDeployment(resourceGroupName, name, id, 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 Deployment} 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 _createDeployment(resourceGroupName, name, id, deployment, options, callback) { +function _startContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9513,7 +9432,6 @@ function _createDeployment(resourceGroupName, name, id, deployment, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9536,15 +9454,15 @@ function _createDeployment(resourceGroupName, name, id, deployment, 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 (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 (deployment === null || deployment === undefined) { - throw new Error('deployment cannot be null or undefined.'); + 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.'); } @@ -9554,20 +9472,20 @@ function _createDeployment(resourceGroupName, name, id, deployment, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -9585,28 +9503,14 @@ function _createDeployment(resourceGroupName, name, id, deployment, options, cal } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (deployment !== null && deployment !== undefined) { - let requestModelMapper = new client.models['Deployment']().mapper(); - requestModel = client.serialize(requestModelMapper, deployment, 'deployment'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(deployment, 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); @@ -9634,39 +9538,22 @@ function _createDeployment(resourceGroupName, name, id, deployment, 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['Deployment']().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 Delete a deployment by its ID for an app, or a deployment slot. + * @summary Stop a continuous web job for an app, or a deployment slot. * - * Delete a deployment by its ID for an app, or a deployment slot. + * Stop a continuous 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} id Deployment ID. + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -9685,7 +9572,7 @@ function _createDeployment(resourceGroupName, name, id, deployment, options, cal * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteDeployment(resourceGroupName, name, id, options, callback) { +function _stopContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9695,7 +9582,6 @@ function _deleteDeployment(resourceGroupName, name, id, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9718,12 +9604,15 @@ function _deleteDeployment(resourceGroupName, name, id, 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 (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 (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.'); } @@ -9733,20 +9622,20 @@ function _deleteDeployment(resourceGroupName, name, id, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -9771,7 +9660,7 @@ function _deleteDeployment(resourceGroupName, name, id, options, callback) { 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); @@ -9805,21 +9694,15 @@ function _deleteDeployment(resourceGroupName, name, id, options, callback) { } /** - * @summary List deployment log for specific deployment for an app, or a - * deployment slot. + * @summary List deployments for an app, or a deployment slot. * - * List deployment log for specific deployment for an app, or a deployment - * slot. + * List deployments 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} id The ID of a specific deployment. This is the value of the - * name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -9832,13 +9715,13 @@ function _deleteDeployment(resourceGroupName, name, id, 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 Deployment} 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 _listDeploymentLog(resourceGroupName, name, id, options, callback) { +function _listDeployments(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9848,7 +9731,6 @@ function _listDeploymentLog(resourceGroupName, name, id, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9871,12 +9753,12 @@ function _listDeploymentLog(resourceGroupName, name, id, 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 (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.'); } + 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.'); } @@ -9886,13 +9768,12 @@ function _listDeploymentLog(resourceGroupName, name, id, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -9934,12 +9815,13 @@ function _listDeploymentLog(resourceGroupName, name, id, 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) { @@ -9959,7 +9841,7 @@ function _listDeploymentLog(resourceGroupName, name, id, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Deployment']().mapper(); + let resultMapper = new client.models['DeploymentCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -9975,15 +9857,17 @@ function _listDeploymentLog(resourceGroupName, name, id, options, callback) { } /** - * @summary Lists ownership identifiers for domain associated with web app. + * @summary Get a deployment by its ID for an app, or a deployment slot. * - * Lists ownership identifiers for domain associated with web app. + * Get a deployment 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} id Deployment ID. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -9996,13 +9880,13 @@ function _listDeploymentLog(resourceGroupName, name, id, 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 Deployment} 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 _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callback) { +function _getDeployment(resourceGroupName, name, id, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10012,7 +9896,6 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10035,9 +9918,15 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, 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 (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.'); } + 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.'); } @@ -10047,12 +9936,13 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -10094,12 +9984,13 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, 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) { @@ -10119,7 +10010,7 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callb 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['Deployment']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10135,17 +10026,39 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callb } /** - * @summary Get domain ownership identifier for web app. + * @summary Create a deployment for an app, or a deployment slot. * - * Get domain ownership identifier for web app. + * Create a deployment 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} domainOwnershipIdentifierName Name of domain ownership - * identifier. + * @param {string} id ID of an existing deployment. + * + * @param {object} deployment Deployment details. + * + * @param {number} [deployment.status] Deployment status. + * + * @param {string} [deployment.message] Details about deployment status. + * + * @param {string} [deployment.author] Who authored the deployment. + * + * @param {string} [deployment.deployer] Who performed the deployment. + * + * @param {string} [deployment.authorEmail] Author email. + * + * @param {date} [deployment.startTime] Start time. + * + * @param {date} [deployment.endTime] End time. + * + * @param {boolean} [deployment.active] True if deployment is currently active, + * false if completed and null if not started. + * + * @param {string} [deployment.details] Details on deployment. + * + * @param {string} [deployment.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -10159,13 +10072,13 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, 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 Identifier} for more information. + * See {@link Deployment} 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 _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, options, callback) { +function _createDeployment(resourceGroupName, name, id, deployment, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10175,7 +10088,6 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10198,12 +10110,18 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI 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 (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { - throw new Error('domainOwnershipIdentifierName 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 (deployment === null || deployment === undefined) { + throw new Error('deployment 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.'); } @@ -10213,20 +10131,20 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -10244,7 +10162,21 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (deployment !== null && deployment !== undefined) { + let requestModelMapper = new client.models['Deployment']().mapper(); + requestModel = client.serialize(requestModelMapper, deployment, 'deployment'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(deployment, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -10261,12 +10193,13 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI 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) { @@ -10286,7 +10219,7 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Identifier']().mapper(); + let resultMapper = new client.models['Deployment']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10302,27 +10235,16 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI } /** - * @summary Creates a domain ownership identifier for web app, or updates an - * existing ownership identifier. + * @summary Delete a deployment by its ID for an app, or a deployment slot. * - * Creates a domain ownership identifier for web app, or updates an existing - * ownership identifier. + * Delete a deployment 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} domainOwnershipIdentifierName Name of domain ownership - * identifier. - * - * @param {object} domainOwnershipIdentifier A JSON representation of the - * domain ownership properties. - * - * @param {string} [domainOwnershipIdentifier.identifierId] String - * representation of the identity. - * - * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * @param {string} id Deployment ID. * * @param {object} [options] Optional Parameters. * @@ -10335,14 +10257,13 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI * * {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 Identifier} 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 _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, callback) { +function _deleteDeployment(resourceGroupName, name, id, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10352,7 +10273,6 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10375,15 +10295,15 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai 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 (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { - throw new Error('domainOwnershipIdentifierName cannot be null or undefined and it must be of type string.'); - } - if (domainOwnershipIdentifier === null || domainOwnershipIdentifier === undefined) { - throw new Error('domainOwnershipIdentifier cannot be null or undefined.'); + 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.'); } + 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.'); } @@ -10393,20 +10313,20 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -10424,28 +10344,14 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (domainOwnershipIdentifier !== null && domainOwnershipIdentifier !== undefined) { - let requestModelMapper = new client.models['Identifier']().mapper(); - requestModel = client.serialize(requestModelMapper, domainOwnershipIdentifier, 'domainOwnershipIdentifier'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(domainOwnershipIdentifier, 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 !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -10473,40 +10379,26 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai // 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['Identifier']().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 a domain ownership identifier for a web app. + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. * - * Deletes a domain ownership identifier for a web app. + * List deployment log for specific deployment 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} domainOwnershipIdentifierName Name of domain ownership - * identifier. + * @param {string} id The ID of a specific deployment. This is the value of the + * name property in the JSON response from "GET + * /api/sites/{siteName}/deployments". * * @param {object} [options] Optional Parameters. * @@ -10519,13 +10411,14 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai * * {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 Deployment} 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 _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, options, callback) { +function _listDeploymentLog(resourceGroupName, name, id, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10535,7 +10428,6 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10558,12 +10450,15 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh 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 (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { - throw new Error('domainOwnershipIdentifierName 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.'); } + 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.'); } @@ -10573,20 +10468,20 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -10611,7 +10506,7 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh 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); @@ -10621,12 +10516,13 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh 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) { @@ -10639,33 +10535,81 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh // 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['Deployment']().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 domain ownership identifier for web app, or updates an - * existing ownership identifier. + * @summary Discovers an existing app backup that can be restored from a blob + * in Azure storage. Use this to get information about the databases stored in + * a backup. * - * Creates a domain ownership identifier for web app, or updates an existing - * ownership identifier. + * Discovers an existing app backup that can be restored from a blob in Azure + * storage. Use this to get information about the databases stored in a backup. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} domainOwnershipIdentifierName Name of domain ownership - * identifier. + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * @param {object} domainOwnershipIdentifier A JSON representation of the - * domain ownership properties. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {string} [domainOwnershipIdentifier.identifierId] String - * representation of the identity. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -10679,13 +10623,13 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh * {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 Identifier} for more information. + * See {@link RestoreRequest} 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 _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, callback) { +function _discoverBackup(resourceGroupName, name, request, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10695,7 +10639,6 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10718,15 +10661,15 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh 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 (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { - throw new Error('domainOwnershipIdentifierName cannot be null or undefined and it must be of type string.'); - } - if (domainOwnershipIdentifier === null || domainOwnershipIdentifier === undefined) { - throw new Error('domainOwnershipIdentifier cannot be null or undefined.'); + if (request === null || request === undefined) { + throw new Error('request 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.'); } @@ -10736,20 +10679,19 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -10771,14 +10713,14 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh let requestContent = null; let requestModel = null; try { - if (domainOwnershipIdentifier !== null && domainOwnershipIdentifier !== undefined) { - let requestModelMapper = new client.models['Identifier']().mapper(); - requestModel = client.serialize(requestModelMapper, domainOwnershipIdentifier, 'domainOwnershipIdentifier'); + 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(domainOwnershipIdentifier, null, 2)}.`); + `payload - ${JSON.stringify(request, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -10798,12 +10740,13 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh 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) { @@ -10823,7 +10766,7 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Identifier']().mapper(); + let resultMapper = new client.models['RestoreRequest']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10839,14 +10782,14 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh } /** - * @summary Get the status of the last MSDeploy operation. + * @summary Lists ownership identifiers for domain associated with web app. * - * Get the status of the last MSDeploy operation. + * Lists ownership identifiers for domain associated with web app. * * @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. * @@ -10860,13 +10803,13 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh * {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 MSDeployStatus} 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 _getMSDeployStatus(resourceGroupName, name, options, callback) { +function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10876,7 +10819,6 @@ function _getMSDeployStatus(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10902,6 +10844,9 @@ function _getMSDeployStatus(resourceGroupName, name, options, callback) { 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.'); } @@ -10911,12 +10856,12 @@ function _getMSDeployStatus(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}/extensions/MSDeploy'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -10958,12 +10903,13 @@ function _getMSDeployStatus(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) { @@ -10983,7 +10929,7 @@ function _getMSDeployStatus(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MSDeployStatus']().mapper(); + let resultMapper = new client.models['IdentifierCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10998,44 +10944,18 @@ function _getMSDeployStatus(resourceGroupName, name, options, callback) { }); } - /** - * @summary Invoke the MSDeploy web app extension. + * @summary Get domain ownership identifier for web app. * - * Invoke the MSDeploy web app extension. + * Get domain ownership identifier 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} mSDeploy Details of MSDeploy operation - * - * @param {string} [mSDeploy.packageUri] Package URI - * - * @param {string} [mSDeploy.connectionString] SQL Connection String - * - * @param {string} [mSDeploy.dbType] Database Type - * - * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy - * Parameters file. Must not be set if SetParameters is used. - * - * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be - * set if SetParametersXmlFileUri is used. - * - * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy - * operation skips the App_Data directory. - * If set to true, the existing App_Data directory on the - * destination - * will not be deleted, and any App_Data directory in the source will be - * ignored. - * Setting is false by default. - * - * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the - * MSDeploy operation executes. - * Setting is false by default. + * @param {string} name Name of the app. * - * @param {string} [mSDeploy.kind] Kind of resource. + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. * * @param {object} [options] Optional Parameters. * @@ -11049,50 +10969,137 @@ function _getMSDeployStatus(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 MSDeployStatus} for more information. + * See {@link Identifier} 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 _createMSDeployOperation(resourceGroupName, name, mSDeploy, options, callback) { +function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, 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 (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { + throw new Error('domainOwnershipIdentifierName 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); + } - // Send request - this.beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, 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; + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + 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('&'); + } - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; + // 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; - - // Deserialize Response + 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['MSDeployStatus']().mapper(); + let resultMapper = new client.models['Identifier']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11101,21 +11108,34 @@ function _createMSDeployOperation(resourceGroupName, name, mSDeploy, options, ca deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } + } - return callback(null, result, httpRequest, response); - }); + return callback(null, result, httpRequest, response); }); } /** - * @summary Get the MSDeploy Log for the last MSDeploy operation. + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. * - * Get the MSDeploy Log for the last MSDeploy operation. + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. * * @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} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -11129,13 +11149,13 @@ function _createMSDeployOperation(resourceGroupName, name, mSDeploy, 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 MSDeployLog} for more information. + * See {@link Identifier} 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 _getMSDeployLog(resourceGroupName, name, options, callback) { +function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11145,7 +11165,6 @@ function _getMSDeployLog(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11168,9 +11187,18 @@ function _getMSDeployLog(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 (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { + throw new Error('domainOwnershipIdentifierName cannot be null or undefined and it must be of type string.'); + } + if (domainOwnershipIdentifier === null || domainOwnershipIdentifier === undefined) { + throw new Error('domainOwnershipIdentifier 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.'); } @@ -11180,19 +11208,20 @@ function _getMSDeployLog(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}/extensions/MSDeploy/log'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -11210,14 +11239,28 @@ function _getMSDeployLog(resourceGroupName, name, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (domainOwnershipIdentifier !== null && domainOwnershipIdentifier !== undefined) { + let requestModelMapper = new client.models['Identifier']().mapper(); + requestModel = client.serialize(requestModelMapper, domainOwnershipIdentifier, 'domainOwnershipIdentifier'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(domainOwnershipIdentifier, 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); @@ -11227,12 +11270,13 @@ function _getMSDeployLog(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) { @@ -11252,7 +11296,7 @@ function _getMSDeployLog(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MSDeployLog']().mapper(); + let resultMapper = new client.models['Identifier']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11268,14 +11312,17 @@ function _getMSDeployLog(resourceGroupName, name, options, callback) { } /** - * @summary List the functions for a web site, or a deployment slot. + * @summary Deletes a domain ownership identifier for a web app. * - * List the functions for a web site, or a deployment slot. + * Deletes a domain ownership identifier for a web 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} domainOwnershipIdentifierName Name of domain ownership + * identifier. * * @param {object} [options] Optional Parameters. * @@ -11288,15 +11335,13 @@ function _getMSDeployLog(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 FunctionEnvelopeCollection} 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 _listFunctions(resourceGroupName, name, options, callback) { +function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11306,7 +11351,6 @@ function _listFunctions(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11329,9 +11373,15 @@ function _listFunctions(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 (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { + throw new Error('domainOwnershipIdentifierName 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.'); } @@ -11341,19 +11391,20 @@ function _listFunctions(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}/functions'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -11378,7 +11429,7 @@ function _listFunctions(resourceGroupName, name, options, callback) { 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); @@ -11406,37 +11457,33 @@ function _listFunctions(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['FunctionEnvelopeCollection']().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 Fetch a short lived token that can be exchanged for a master key. + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. * - * Fetch a short lived token that can be exchanged for a master key. + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. * * @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} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -11449,13 +11496,14 @@ function _listFunctions(resourceGroupName, name, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [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 Identifier} 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 _getFunctionsAdminToken(resourceGroupName, name, options, callback) { +function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11465,7 +11513,6 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11488,9 +11535,18 @@ function _getFunctionsAdminToken(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 (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { + throw new Error('domainOwnershipIdentifierName cannot be null or undefined and it must be of type string.'); + } + if (domainOwnershipIdentifier === null || domainOwnershipIdentifier === undefined) { + throw new Error('domainOwnershipIdentifier 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.'); } @@ -11500,19 +11556,20 @@ function _getFunctionsAdminToken(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}/functions/admin/token'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -11530,7 +11587,21 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (domainOwnershipIdentifier !== null && domainOwnershipIdentifier !== undefined) { + let requestModelMapper = new client.models['Identifier']().mapper(); + requestModel = client.serialize(requestModelMapper, domainOwnershipIdentifier, 'domainOwnershipIdentifier'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(domainOwnershipIdentifier, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -11547,12 +11618,13 @@ function _getFunctionsAdminToken(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) { @@ -11572,13 +11644,7 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; + let resultMapper = new client.models['Identifier']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11594,17 +11660,14 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { } /** - * @summary Get function information by its ID for web site, or a deployment - * slot. + * @summary Get the status of the last MSDeploy operation. * - * Get function information by its ID for web site, or a deployment slot. + * Get the status of the last MSDeploy operation. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. - * - * @param {string} functionName Function name. + * @param {string} name Name of web app. * * @param {object} [options] Optional Parameters. * @@ -11618,13 +11681,13 @@ function _getFunctionsAdminToken(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 FunctionEnvelope} for more information. + * See {@link MSDeployStatus} 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 _getFunction(resourceGroupName, name, functionName, options, callback) { +function _getMSDeployStatus(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11634,7 +11697,6 @@ function _getFunction(resourceGroupName, name, functionName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11657,12 +11719,12 @@ function _getFunction(resourceGroupName, name, functionName, 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 (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { - throw new Error('functionName 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.'); } @@ -11672,13 +11734,12 @@ function _getFunction(resourceGroupName, name, functionName, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -11710,7 +11771,7 @@ function _getFunction(resourceGroupName, name, functionName, 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); @@ -11720,12 +11781,13 @@ function _getFunction(resourceGroupName, name, functionName, 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) { @@ -11745,7 +11807,7 @@ function _getFunction(resourceGroupName, name, functionName, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionEnvelope']().mapper(); + let resultMapper = new client.models['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11762,37 +11824,42 @@ function _getFunction(resourceGroupName, name, functionName, options, callback) /** - * @summary Create function for web site, or a deployment slot. + * @summary Invoke the MSDeploy web app extension. * - * Create function for web site, or a deployment slot. + * Invoke the MSDeploy web app extension. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. - * - * @param {string} functionName Function name. - * - * @param {object} functionEnvelope Function details. + * @param {string} name Name of web app. * - * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * @param {object} mSDeploy Details of MSDeploy operation * - * @param {string} [functionEnvelope.scriptHref] Script URI. + * @param {string} [mSDeploy.packageUri] Package URI * - * @param {string} [functionEnvelope.configHref] Config URI. + * @param {string} [mSDeploy.connectionString] SQL Connection String * - * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * @param {string} [mSDeploy.dbType] Database Type * - * @param {string} [functionEnvelope.href] Function URI. + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. * - * @param {object} [functionEnvelope.config] Config information. + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. * - * @param {object} [functionEnvelope.files] File list. + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. * - * @param {string} [functionEnvelope.testData] Test data used when testing via - * the Azure Portal. + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. * - * @param {string} [functionEnvelope.kind] Kind of resource. + * @param {string} [mSDeploy.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -11806,13 +11873,13 @@ function _getFunction(resourceGroupName, name, functionName, 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 FunctionEnvelope} for more information. + * See {@link MSDeployStatus} 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 _createFunction(resourceGroupName, name, functionName, functionEnvelope, options, callback) { +function _createMSDeployOperation(resourceGroupName, name, mSDeploy, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11825,7 +11892,7 @@ function _createFunction(resourceGroupName, name, functionName, functionEnvelope } // Send request - this.beginCreateFunction(resourceGroupName, name, functionName, functionEnvelope, options, (err, parsedResult, httpRequest, response) => { + this.beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -11849,7 +11916,7 @@ function _createFunction(resourceGroupName, name, functionName, functionEnvelope parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionEnvelope']().mapper(); + let resultMapper = new client.models['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11865,16 +11932,14 @@ function _createFunction(resourceGroupName, name, functionName, functionEnvelope } /** - * @summary Delete a function for web site, or a deployment slot. + * @summary Get the MSDeploy Log for the last MSDeploy operation. * - * Delete a function for web site, or a deployment slot. + * Get the MSDeploy Log for the last MSDeploy operation. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. - * - * @param {string} functionName Function name. + * @param {string} name Name of web app. * * @param {object} [options] Optional Parameters. * @@ -11887,13 +11952,14 @@ function _createFunction(resourceGroupName, name, functionName, functionEnvelope * * {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 MSDeployLog} 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 _deleteFunction(resourceGroupName, name, functionName, options, callback) { +function _getMSDeployLog(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11903,7 +11969,6 @@ function _deleteFunction(resourceGroupName, name, functionName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11926,12 +11991,12 @@ function _deleteFunction(resourceGroupName, name, functionName, 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 (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { - throw new Error('functionName 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.'); } @@ -11941,20 +12006,19 @@ function _deleteFunction(resourceGroupName, name, functionName, options, callbac // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -11979,7 +12043,7 @@ function _deleteFunction(resourceGroupName, name, functionName, options, callbac 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); @@ -12007,24 +12071,38 @@ function _deleteFunction(resourceGroupName, name, functionName, options, callbac // 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['MSDeployLog']().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 function secrets for a function in a web site, or a deployment - * slot. + * @summary List the functions for a web site, or a deployment slot. * - * Get function secrets for a function in a web site, or a deployment slot. + * List the functions for a web site, or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Site name. * - * @param {string} functionName Function name. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -12037,13 +12115,14 @@ function _deleteFunction(resourceGroupName, name, functionName, 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 FunctionSecrets} for more information. + * 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 _listFunctionSecrets(resourceGroupName, name, functionName, options, callback) { +function _listFunctions(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -12053,7 +12132,6 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12076,12 +12154,12 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, 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 (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { - throw new Error('functionName 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.'); } @@ -12091,20 +12169,19 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -12129,7 +12206,7 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, options, ca 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); @@ -12164,7 +12241,7 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, options, ca parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionSecrets']().mapper(); + let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12180,14 +12257,14 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, options, ca } /** - * @summary Get hostname bindings for an app or a deployment slot. + * @summary Fetch a short lived token that can be exchanged for a master key. * - * Get hostname bindings for an app or a deployment slot. + * Fetch a short lived token that can be exchanged for a master key. * * @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. * @@ -12200,15 +12277,13 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, 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 HostNameBindingCollection} for more - * information. + * {string} [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 _listHostNameBindings(resourceGroupName, name, options, callback) { +function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -12218,7 +12293,6 @@ function _listHostNameBindings(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12244,6 +12318,9 @@ function _listHostNameBindings(resourceGroupName, name, options, callback) { 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.'); } @@ -12253,12 +12330,12 @@ function _listHostNameBindings(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}/hostNameBindings'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -12300,12 +12377,13 @@ function _listHostNameBindings(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) { @@ -12325,7 +12403,13 @@ function _listHostNameBindings(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HostNameBindingCollection']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12341,18 +12425,17 @@ function _listHostNameBindings(resourceGroupName, name, options, callback) { } /** - * @summary Get the named hostname binding for an app (or deployment slot, if - * specified). + * @summary Get function information by its ID for web site, or a deployment + * slot. * - * Get the named hostname binding for an app (or deployment slot, if - * specified). + * Get function information by its ID for web site, 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} hostName Hostname in the hostname binding. + * @param {string} functionName Function name. * * @param {object} [options] Optional Parameters. * @@ -12366,13 +12449,13 @@ function _listHostNameBindings(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 HostNameBinding} for more information. + * See {@link FunctionEnvelope} 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 _getHostNameBinding(resourceGroupName, name, hostName, options, callback) { +function _getFunction(resourceGroupName, name, functionName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -12382,7 +12465,6 @@ function _getHostNameBinding(resourceGroupName, name, hostName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12405,12 +12487,15 @@ function _getHostNameBinding(resourceGroupName, name, hostName, 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 (hostName === null || hostName === undefined || typeof hostName.valueOf() !== 'string') { - throw new Error('hostName cannot be null or undefined and it must be of type string.'); + if (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { + throw new Error('functionName 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.'); } @@ -12420,13 +12505,13 @@ function _getHostNameBinding(resourceGroupName, name, hostName, options, callbac // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -12458,7 +12543,7 @@ function _getHostNameBinding(resourceGroupName, name, hostName, options, callbac 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); @@ -12493,7 +12578,7 @@ function _getHostNameBinding(resourceGroupName, name, hostName, options, callbac parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HostNameBinding']().mapper(); + let resultMapper = new client.models['FunctionEnvelope']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12508,43 +12593,41 @@ function _getHostNameBinding(resourceGroupName, name, hostName, options, callbac }); } + /** - * @summary Creates a hostname binding for an app. + * @summary Create function for web site, or a deployment slot. * - * Creates a hostname binding for an app. + * Create function for web site, 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} hostName Hostname in the hostname binding. + * @param {string} functionName Function name. * - * @param {object} hostNameBinding Binding details. This is the JSON - * representation of a HostNameBinding object. + * @param {object} functionEnvelope Function details. * - * @param {string} [hostNameBinding.siteName] App Service app name. + * @param {string} [functionEnvelope.functionAppId] Function App ID. * - * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain - * resource URI. + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * - * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * @param {string} [functionEnvelope.scriptHref] Script URI. * - * @param {string} [hostNameBinding.azureResourceType] Azure resource type. - * Possible values include: 'Website', 'TrafficManager' + * @param {string} [functionEnvelope.configHref] Config URI. * - * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS - * record type. Possible values include: 'CName', 'A' + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. * - * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible - * values include: 'Verified', 'Managed' + * @param {string} [functionEnvelope.href] Function URI. * - * @param {string} [hostNameBinding.sslState] SSL type. Possible values - * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * @param {object} [functionEnvelope.config] Config information. * - * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * @param {object} [functionEnvelope.files] File list. * - * @param {string} [hostNameBinding.kind] Kind of resource. + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -12558,13 +12641,94 @@ function _getHostNameBinding(resourceGroupName, name, hostName, 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 HostNameBinding} for more information. + * See {@link FunctionEnvelope} 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 _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, callback) { +function _createFunction(resourceGroupName, name, functionName, functionEnvelope, 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.beginCreateFunction(resourceGroupName, name, functionName, functionEnvelope, 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['FunctionEnvelope']().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 Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function 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. + * + * {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 _deleteFunction(resourceGroupName, name, functionName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -12574,7 +12738,6 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12597,15 +12760,15 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN 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 (hostName === null || hostName === undefined || typeof hostName.valueOf() !== 'string') { - throw new Error('hostName cannot be null or undefined and it must be of type string.'); - } - if (hostNameBinding === null || hostNameBinding === undefined) { - throw new Error('hostNameBinding cannot be null or undefined.'); + if (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { + throw new Error('functionName 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.'); } @@ -12615,20 +12778,20 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -12646,28 +12809,14 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (hostNameBinding !== null && hostNameBinding !== undefined) { - let requestModelMapper = new client.models['HostNameBinding']().mapper(); - requestModel = client.serialize(requestModelMapper, hostNameBinding, 'hostNameBinding'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(hostNameBinding, 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 !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -12695,39 +12844,23 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN // 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['HostNameBinding']().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 a hostname binding for an app. + * @summary Get function secrets for a function in a web site, or a deployment + * slot. * - * Deletes a hostname binding for an app. + * Get function secrets for a function in 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 the app. + * @param {string} name Site name. * - * @param {string} hostName Hostname in the hostname binding. + * @param {string} functionName Function name. * * @param {object} [options] Optional Parameters. * @@ -12740,13 +12873,14 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN * * {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 FunctionSecrets} 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 _deleteHostNameBinding(resourceGroupName, name, hostName, options, callback) { +function _listFunctionSecrets(resourceGroupName, name, functionName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -12756,7 +12890,6 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12779,12 +12912,15 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, 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 (hostName === null || hostName === undefined || typeof hostName.valueOf() !== 'string') { - throw new Error('hostName cannot be null or undefined and it must be of type string.'); + if (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { + throw new Error('functionName 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.'); } @@ -12794,20 +12930,20 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -12832,7 +12968,7 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, options, call 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); @@ -12842,12 +12978,13 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, 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) { @@ -12860,25 +12997,37 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, options, call // 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['FunctionSecrets']().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 Retrieves a specific Service Bus Hybrid Connection used by this Web - * App. + * @summary Get hostname bindings for an app or a deployment slot. * - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * Get hostname bindings for an app or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -12892,13 +13041,14 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, 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 HybridConnection} 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 _getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { +function _listHostNameBindings(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -12908,7 +13058,6 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12931,15 +13080,12 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, 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 (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { - throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); - } - if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { - throw new Error('relayName 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.'); } @@ -12949,14 +13095,12 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -12998,12 +13142,13 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, 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) { @@ -13023,7 +13168,7 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HybridConnection']().mapper(); + let resultMapper = new client.models['HostNameBindingCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -13039,46 +13184,18 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, } /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). * - * Creates a new Hybrid Connection using a Service Bus relay. + * Get the named hostname binding for an app (or deployment slot, if + * specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} connectionEnvelope The details of the hybrid connection. - * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. - * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. - * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. - * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. - * - * @param {number} [connectionEnvelope.port] The port of the endpoint. - * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. - * - * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service - * Bus key. This is used to authenticate to Service Bus. In ARM this key will - * not be returned - * normally, use the POST /listKeys API instead. - * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net + * @param {string} name Name of the app. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} hostName Hostname in the hostname binding. * * @param {object} [options] Optional Parameters. * @@ -13092,13 +13209,13 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, * {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 HybridConnection} for more information. + * See {@link HostNameBinding} 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 _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, callback) { +function _getHostNameBinding(resourceGroupName, name, hostName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13108,7 +13225,6 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -13131,18 +13247,15 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, 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 (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { - throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); - } - if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { - throw new Error('relayName 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 (hostName === null || hostName === undefined || typeof hostName.valueOf() !== 'string') { + throw new Error('hostName 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.'); } @@ -13152,21 +13265,20 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13184,21 +13296,7 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (connectionEnvelope !== null && connectionEnvelope !== undefined) { - let requestModelMapper = new client.models['HybridConnection']().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) { @@ -13215,12 +13313,13 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, 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) { @@ -13240,7 +13339,7 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HybridConnection']().mapper(); + let resultMapper = new client.models['HostNameBinding']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -13256,18 +13355,42 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, } /** - * @summary Removes a Hybrid Connection from this site. + * @summary Creates a hostname binding for an app. * - * Removes a Hybrid Connection from this site. + * Creates a hostname binding for 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} namespaceName The namespace for this hybrid connection. + * @param {string} hostName Hostname in the hostname binding. * - * @param {string} relayName The relay name for this hybrid connection. + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -13280,13 +13403,14 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, * * {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 HostNameBinding} 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 _deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { +function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13296,7 +13420,6 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -13319,15 +13442,18 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa 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 (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { - throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + if (hostName === null || hostName === undefined || typeof hostName.valueOf() !== 'string') { + throw new Error('hostName cannot be null or undefined and it must be of type string.'); } - if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { - throw new Error('relayName cannot be null or undefined and it must be of type string.'); + if (hostNameBinding === null || hostNameBinding === undefined) { + throw new Error('hostNameBinding 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.'); } @@ -13337,21 +13463,20 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13369,14 +13494,28 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (hostNameBinding !== null && hostNameBinding !== undefined) { + let requestModelMapper = new client.models['HostNameBinding']().mapper(); + requestModel = client.serialize(requestModelMapper, hostNameBinding, 'hostNameBinding'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(hostNameBinding, 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); @@ -13386,12 +13525,13 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa 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) { @@ -13404,52 +13544,39 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa // 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['HostNameBinding']().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 new Hybrid Connection using a Service Bus relay. + * @summary Deletes a hostname binding for an app. * - * Creates a new Hybrid Connection using a Service Bus relay. + * Deletes a hostname binding for 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} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} connectionEnvelope The details of the hybrid connection. - * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. - * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. - * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. - * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. - * - * @param {number} [connectionEnvelope.port] The port of the endpoint. - * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. - * - * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service - * Bus key. This is used to authenticate to Service Bus. In ARM this key will - * not be returned - * normally, use the POST /listKeys API instead. - * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net + * @param {string} name Name of the app. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} hostName Hostname in the hostname binding. * * @param {object} [options] Optional Parameters. * @@ -13462,14 +13589,13 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa * * {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 HybridConnection} 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 _updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, callback) { +function _deleteHostNameBinding(resourceGroupName, name, hostName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13479,7 +13605,6 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -13502,18 +13627,15 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa 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 (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { - throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); - } - if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { - throw new Error('relayName 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 (hostName === null || hostName === undefined || typeof hostName.valueOf() !== 'string') { + throw new Error('hostName 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.'); } @@ -13523,21 +13645,20 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13555,28 +13676,14 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (connectionEnvelope !== null && connectionEnvelope !== undefined) { - let requestModelMapper = new client.models['HybridConnection']().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 !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -13604,32 +13711,16 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa // 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['HybridConnection']().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 send key name and value for a Hybrid Connection. + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. * - * Gets the send key name and value for a Hybrid Connection. + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -13652,13 +13743,13 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa * {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 HybridConnectionKey} for more information. + * See {@link HybridConnection} 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 _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, callback) { +function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13668,7 +13759,6 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -13700,6 +13790,9 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay 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.'); } @@ -13709,21 +13802,21 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13758,12 +13851,13 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay 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) { @@ -13783,7 +13877,7 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HybridConnectionKey']().mapper(); + let resultMapper = new client.models['HybridConnection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -13799,15 +13893,47 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay } /** - * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * @summary Creates a new Hybrid Connection using a Service Bus relay. * - * Retrieves all Service Bus Hybrid Connections used by this Web App. + * Creates a new Hybrid Connection using a Service Bus relay. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name The name of the web app. * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -13826,7 +13952,7 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listHybridConnections(resourceGroupName, name, options, callback) { +function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13836,7 +13962,6 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -13859,9 +13984,21 @@ function _listHybridConnections(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 (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName 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.'); } @@ -13871,19 +14008,21 @@ function _listHybridConnections(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}/hybridConnectionRelays'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13901,7 +14040,21 @@ function _listHybridConnections(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['HybridConnection']().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) { @@ -13918,12 +14071,13 @@ function _listHybridConnections(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) { @@ -13959,16 +14113,18 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { } /** - * @summary Gets hybrid connections configured for an app (or deployment slot, - * if specified). + * @summary Removes a Hybrid Connection from this site. * - * Gets hybrid connections configured for an app (or deployment slot, if - * specified). + * Removes a Hybrid Connection from this 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} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. * * @param {object} [options] Optional Parameters. * @@ -13981,15 +14137,13 @@ function _listHybridConnections(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 RelayServiceConnectionEntity} 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 _listRelayServiceConnections(resourceGroupName, name, options, callback) { +function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13999,7 +14153,6 @@ function _listRelayServiceConnections(resourceGroupName, name, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14022,9 +14175,18 @@ function _listRelayServiceConnections(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 (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName 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.'); } @@ -14034,19 +14196,21 @@ function _listRelayServiceConnections(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}/hybridconnection'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -14071,7 +14235,7 @@ function _listRelayServiceConnections(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); @@ -14099,39 +14263,52 @@ function _listRelayServiceConnections(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['RelayServiceConnectionEntity']().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 hybrid connection configuration by its name. + * @summary Creates a new Hybrid Connection using a Service Bus relay. * - * Gets a hybrid connection configuration by its name. + * Creates a new Hybrid Connection using a Service Bus relay. * * @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} entityName Name of the hybrid connection. + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -14145,14 +14322,13 @@ function _listRelayServiceConnections(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 RelayServiceConnectionEntity} for more - * information. + * See {@link HybridConnection} 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 _getRelayServiceConnection(resourceGroupName, name, entityName, options, callback) { +function _updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14162,7 +14338,6 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14185,12 +14360,21 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, 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 (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { - throw new Error('entityName cannot be null or undefined and it must be of type string.'); + if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName 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.'); } @@ -14200,20 +14384,21 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -14231,7 +14416,21 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['HybridConnection']().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) { @@ -14248,12 +14447,13 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, 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) { @@ -14273,7 +14473,7 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + let resultMapper = new client.models['HybridConnection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -14289,37 +14489,18 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options } /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). + * @summary Gets the send key name and value for a Hybrid Connection. * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). + * Gets the send key name and value for a Hybrid Connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. - * - * @param {string} [connectionEnvelope.entityName] - * - * @param {string} [connectionEnvelope.entityConnectionString] - * - * @param {string} [connectionEnvelope.resourceType] - * - * @param {string} [connectionEnvelope.resourceConnectionString] - * - * @param {string} [connectionEnvelope.hostname] - * - * @param {number} [connectionEnvelope.port] + * @param {string} name The name of the web app. * - * @param {string} [connectionEnvelope.biztalkUri] + * @param {string} namespaceName The namespace for this hybrid connection. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} relayName The relay name for this hybrid connection. * * @param {object} [options] Optional Parameters. * @@ -14333,14 +14514,13 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, 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 RelayServiceConnectionEntity} for more - * information. + * See {@link HybridConnectionKey} 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 _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, callback) { +function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14350,7 +14530,6 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14373,15 +14552,18 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa 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 (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { - throw new Error('entityName cannot be null or undefined and it must be of type string.'); + if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName 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 (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName 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.'); } @@ -14391,20 +14573,21 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -14422,21 +14605,7 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (connectionEnvelope !== null && connectionEnvelope !== undefined) { - let requestModelMapper = new client.models['RelayServiceConnectionEntity']().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) { @@ -14453,12 +14622,13 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa 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) { @@ -14478,7 +14648,7 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + let resultMapper = new client.models['HybridConnectionKey']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -14494,16 +14664,14 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa } /** - * @summary Deletes a relay service connection by its name. + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. * - * Deletes a relay service connection by its name. + * Retrieves all Service Bus Hybrid Connections used by this Web App. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. + * @param {string} name The name of the web app. * * @param {object} [options] Optional Parameters. * @@ -14516,13 +14684,14 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa * * {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 HybridConnection} 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 _deleteRelayServiceConnection(resourceGroupName, name, entityName, options, callback) { +function _listHybridConnections(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14532,7 +14701,6 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14555,12 +14723,12 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, 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 (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { - throw new Error('entityName 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.'); } @@ -14570,20 +14738,19 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, opti // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -14608,7 +14775,7 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, 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); @@ -14618,12 +14785,13 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, 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) { @@ -14636,44 +14804,40 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, 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['HybridConnection']().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 new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). + * Gets hybrid connections configured 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} entityName Name of the hybrid connection configuration. - * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. - * - * @param {string} [connectionEnvelope.entityName] - * - * @param {string} [connectionEnvelope.entityConnectionString] - * - * @param {string} [connectionEnvelope.resourceType] - * - * @param {string} [connectionEnvelope.resourceConnectionString] - * - * @param {string} [connectionEnvelope.hostname] - * - * @param {number} [connectionEnvelope.port] - * - * @param {string} [connectionEnvelope.biztalkUri] - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -14693,7 +14857,7 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, opti * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, callback) { +function _listRelayServiceConnections(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14703,7 +14867,6 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14726,15 +14889,12 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn 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 (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { - throw new Error('entityName 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.'); } @@ -14744,20 +14904,19 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -14775,21 +14934,7 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (connectionEnvelope !== null && connectionEnvelope !== undefined) { - let requestModelMapper = new client.models['RelayServiceConnectionEntity']().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) { @@ -14806,12 +14951,13 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn 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) { @@ -14847,15 +14993,17 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn } /** - * @summary Gets all scale-out instances of an app. + * @summary Gets a hybrid connection configuration by its name. * - * Gets all scale-out instances of an app. + * Gets a hybrid connection configuration by its name. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * + * @param {string} entityName Name of the hybrid connection. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -14868,14 +15016,14 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn * {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 RelayServiceConnectionEntity} 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 _listInstanceIdentifiers(resourceGroupName, name, options, callback) { +function _getRelayServiceConnection(resourceGroupName, name, entityName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14885,7 +15033,6 @@ function _listInstanceIdentifiers(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14908,9 +15055,15 @@ function _listInstanceIdentifiers(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 (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { + throw new Error('entityName 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.'); } @@ -14920,12 +15073,13 @@ function _listInstanceIdentifiers(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}/instances'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -14967,12 +15121,13 @@ function _listInstanceIdentifiers(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) { @@ -14992,7 +15147,7 @@ function _listInstanceIdentifiers(resourceGroupName, name, 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['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -15008,16 +15163,37 @@ function _listInstanceIdentifiers(resourceGroupName, name, options, callback) { } /** - * @summary Get the status of the last MSDeploy operation. + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). * - * Get the status of the last MSDeploy operation. + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). * * @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} instanceId ID of web app instance. + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -15031,13 +15207,14 @@ function _listInstanceIdentifiers(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 MSDeployStatus} for more information. + * See {@link RelayServiceConnectionEntity} 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 _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, callback) { +function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15047,7 +15224,6 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15070,12 +15246,18 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, 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 (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { - throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + if (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { + throw new Error('entityName 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.'); } @@ -15085,20 +15267,20 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -15116,7 +15298,21 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['RelayServiceConnectionEntity']().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) { @@ -15133,12 +15329,13 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, 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) { @@ -15158,7 +15355,7 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MSDeployStatus']().mapper(); + let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -15173,128 +15370,17 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options }); } - /** - * @summary Invoke the MSDeploy web app extension. - * - * Invoke the MSDeploy web app extension. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} mSDeploy Details of MSDeploy operation - * - * @param {string} [mSDeploy.packageUri] Package URI - * - * @param {string} [mSDeploy.connectionString] SQL Connection String - * - * @param {string} [mSDeploy.dbType] Database Type - * - * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy - * Parameters file. Must not be set if SetParameters is used. - * - * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be - * set if SetParametersXmlFileUri is used. - * - * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy - * operation skips the App_Data directory. - * If set to true, the existing App_Data directory on the - * destination - * will not be deleted, and any App_Data directory in the source will be - * ignored. - * Setting is false by default. - * - * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the - * MSDeploy operation executes. - * Setting is false by default. - * - * @param {string} [mSDeploy.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 MSDeployStatus} 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 _createInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, 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.beginCreateInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, 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['MSDeployStatus']().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 MSDeploy Log for the last MSDeploy operation. + * @summary Deletes a relay service connection by its name. * - * Get the MSDeploy Log for the last MSDeploy operation. + * Deletes a relay service connection by its name. * * @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} instanceId ID of web app instance. + * @param {string} entityName Name of the hybrid connection configuration. * * @param {object} [options] Optional Parameters. * @@ -15307,14 +15393,13 @@ function _createInstanceMSDeployOperation(resourceGroupName, name, instanceId, m * * {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 MSDeployLog} 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 _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, callback) { +function _deleteRelayServiceConnection(resourceGroupName, name, entityName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15324,7 +15409,6 @@ function _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15347,12 +15431,15 @@ function _getInstanceMSDeployLog(resourceGroupName, name, instanceId, 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 (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { - throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + if (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { + throw new Error('entityName 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.'); } @@ -15362,20 +15449,20 @@ function _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, c // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -15428,43 +15515,43 @@ function _getInstanceMSDeployLog(resourceGroupName, name, instanceId, 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['MSDeployLog']().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. + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (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} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -15478,13 +15565,14 @@ function _getInstanceMSDeployLog(resourceGroupName, name, instanceId, 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 ProcessInfoCollection} for more information. + * See {@link RelayServiceConnectionEntity} 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 _listInstanceProcesses(resourceGroupName, name, instanceId, options, callback) { +function _updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15494,7 +15582,6 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15517,12 +15604,18 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, 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 (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { - throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + if (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { + throw new Error('entityName 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.'); } @@ -15532,20 +15625,20 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -15563,14 +15656,28 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['RelayServiceConnectionEntity']().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 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -15580,12 +15687,13 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca 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) { @@ -15605,7 +15713,7 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca 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['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -15621,22 +15729,14 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary Gets all scale-out instances of an app. * - * Get process information by its ID for a specific scaled-out instance in a - * web site. + * Gets all scale-out instances of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -15650,13 +15750,14 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, 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 ProcessInfo} 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 _getInstanceProcess(resourceGroupName, name, processId, instanceId, options, callback) { +function _listInstanceIdentifiers(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15666,7 +15767,6 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15689,15 +15789,12 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt 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 (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { - throw new Error('instanceId 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.'); } @@ -15707,14 +15804,12 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); - requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -15746,7 +15841,7 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt 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); @@ -15756,12 +15851,13 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt 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) { @@ -15781,7 +15877,7 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt 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['WebAppInstanceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -15797,22 +15893,16 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt } /** - * @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 the status of the last MSDeploy operation. * - * Terminate a process by its ID for a web site, or a deployment slot, or - * specific scaled-out instance in a web site. + * Get the status of the last MSDeploy operation. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. - * - * @param {string} processId PID. + * @param {string} name Name of web app. * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". + * @param {string} instanceId ID of web app instance. * * @param {object} [options] Optional Parameters. * @@ -15825,13 +15915,14 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, 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 MSDeployStatus} 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 _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, callback) { +function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15841,7 +15932,6 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15864,15 +15954,15 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, 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 (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { throw new Error('instanceId 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.'); } @@ -15882,21 +15972,20 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -15921,7 +16010,7 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -15931,12 +16020,13 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, 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) { @@ -15949,28 +16039,68 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, // 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['MSDeployStatus']().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 - * instance in a web site. + * @summary Invoke the MSDeploy web app extension. * - * Get a memory dump of a process by its ID for a specific scaled-out instance - * in a web site. + * Invoke the MSDeploy web app extension. * * @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} processId PID. + * @param {string} instanceId ID of web app instance. * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -15984,12 +16114,95 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, * {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 MSDeployStatus} 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 _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, callback) { +function _createInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, 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.beginCreateInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, 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['MSDeployStatus']().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 MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @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 MSDeployLog} 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 _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15999,7 +16212,6 @@ function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16022,15 +16234,15 @@ function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, 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 (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { throw new Error('instanceId 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.'); } @@ -16040,14 +16252,13 @@ function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -16074,22 +16285,20 @@ function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, } 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; @@ -16106,27 +16315,43 @@ function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, } 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['MSDeployLog']().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 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} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Site name. * - * @param {string} processId PID. - * * @param {string} instanceId ID of a specific scaled-out instance. This is the * value of the name property in the JSON response from "GET * api/sites/{siteName}/instances". @@ -16143,14 +16368,13 @@ function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, * {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 _listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, callback) { +function _listInstanceProcesses(resourceGroupName, name, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -16160,7 +16384,6 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16183,15 +16406,15 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc 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 (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { throw new Error('instanceId 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.'); } @@ -16201,14 +16424,13 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -16275,7 +16497,7 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc 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) { @@ -16304,8 +16526,6 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc * * @param {string} processId PID. * - * @param {string} baseAddress Module base address. - * * @param {string} instanceId ID of a specific scaled-out instance. This is the * value of the name property in the JSON response from "GET * api/sites/{siteName}/instances". @@ -16322,13 +16542,13 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc * {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 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 _getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, callback) { +function _getInstanceProcess(resourceGroupName, name, processId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -16338,7 +16558,6 @@ function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddre if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16364,15 +16583,15 @@ function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddre 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 (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { throw new Error('instanceId 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.'); } @@ -16382,15 +16601,14 @@ function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddre // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'; 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('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -16457,7 +16675,7 @@ function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddre 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['ProcessInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -16473,11 +16691,11 @@ function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddre } /** - * @summary List the threads in 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 the threads in 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. @@ -16501,15 +16719,13 @@ function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddre * * {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. + * {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 _listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, callback) { +function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -16519,7 +16735,6 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16551,6 +16766,9 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc 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.'); } @@ -16560,21 +16778,21 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -16599,7 +16817,7 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc 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); @@ -16627,34 +16845,17 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc // 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['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 Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. + * @summary Get a memory dump of 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. + * 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. @@ -16663,8 +16864,6 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc * * @param {string} processId PID. * - * @param {string} threadId TID. - * * @param {string} instanceId ID of a specific scaled-out instance. This is the * value of the name property in the JSON response from "GET * api/sites/{siteName}/instances". @@ -16681,13 +16880,12 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc * {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. * * {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 _getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, callback) { +function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -16697,7 +16895,6 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16723,15 +16920,15 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, 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 (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { throw new Error('instanceId 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.'); } @@ -16741,15 +16938,14 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads/{threadId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump'; 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('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -16776,20 +16972,22 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, } 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; @@ -16806,42 +17004,30 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, } 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['ProcessThreadInfo']().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 Shows whether an app can be cloned to another resource group or - * subscription. + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * Shows whether an app can be cloned to another resource group or - * subscription. + * 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. * - * @param {string} name Name of the app. + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". * * @param {object} [options] Optional Parameters. * @@ -16855,13 +17041,14 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, * {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 SiteCloneability} 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 _isCloneable(resourceGroupName, name, options, callback) { +function _listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -16871,7 +17058,6 @@ function _isCloneable(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16894,9 +17080,18 @@ function _isCloneable(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 (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 (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId 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.'); } @@ -16906,19 +17101,21 @@ function _isCloneable(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}/iscloneable'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -16943,7 +17140,7 @@ function _isCloneable(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); @@ -16978,7 +17175,7 @@ function _isCloneable(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteCloneability']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -16994,14 +17191,24 @@ function _isCloneable(resourceGroupName, name, options, callback) { } /** - * @summary This is to allow calling via powershell and ARM template. + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. * - * This is to allow calling via powershell and ARM template. + * 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. * - * @param {string} name Name of the app. + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". * * @param {object} [options] Optional Parameters. * @@ -17015,13 +17222,13 @@ function _isCloneable(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 FunctionSecrets} 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 _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { +function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -17031,7 +17238,6 @@ function _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17054,9 +17260,21 @@ function _listSyncFunctionTriggers(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 (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 (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId 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.'); } @@ -17066,19 +17284,22 @@ function _listSyncFunctionTriggers(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}/listsyncfunctiontriggerstatus'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/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('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -17103,7 +17324,7 @@ function _listSyncFunctionTriggers(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); @@ -17138,7 +17359,7 @@ function _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionSecrets']().mapper(); + let resultMapper = new client.models['ProcessModuleInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -17154,15 +17375,22 @@ function _listSyncFunctionTriggers(resourceGroupName, name, 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} 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} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". * * @param {object} [options] Optional Parameters. * @@ -17176,14 +17404,14 @@ function _listSyncFunctionTriggers(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 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 _listMetricDefinitions(resourceGroupName, name, options, callback) { +function _listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -17193,7 +17421,6 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17216,9 +17443,18 @@ function _listMetricDefinitions(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 (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 (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId 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.'); } @@ -17228,12 +17464,14 @@ function _listMetricDefinitions(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}/metricdefinitions'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -17265,7 +17503,7 @@ function _listMetricDefinitions(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); @@ -17300,7 +17538,7 @@ function _listMetricDefinitions(resourceGroupName, name, 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) { @@ -17316,25 +17554,26 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { } /** - * @summary Gets performance metrics of 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. * - * Gets performance metrics of 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 {object} [options] Optional Parameters. + * @param {string} processId PID. * - * @param {boolean} [options.details] Specify "true" to include metric details - * in the response. It is "false" by default. + * @param {string} threadId TID. * - * @param {string} [options.filter] Return only metrics 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} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17346,14 +17585,13 @@ function _listMetricDefinitions(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 ResourceMetricCollection} 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 _listMetrics(resourceGroupName, name, options, callback) { +function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -17363,9 +17601,6 @@ function _listMetrics(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let details = (options && options.details !== undefined) ? options.details : undefined; - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17388,15 +17623,21 @@ function _listMetrics(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 (details !== null && details !== undefined && typeof details !== 'boolean') { - throw new Error('details must be of type boolean.'); + 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter 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 (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId 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.'); } @@ -17406,18 +17647,15 @@ function _listMetrics(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}/metrics'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/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('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - if (details !== null && details !== undefined) { - queryParameters.push('details=' + encodeURIComponent(details.toString())); - } - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + filter); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -17449,7 +17687,7 @@ function _listMetrics(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); @@ -17484,7 +17722,7 @@ function _listMetrics(resourceGroupName, name, 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['ProcessThreadInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -17499,35 +17737,17 @@ function _listMetrics(resourceGroupName, name, options, callback) { }); } - /** - * @summary Restores a web app. - * - * Restores a web app. + * @summary Shows whether an app can be cloned to another resource group or + * subscription. * - * @param {string} subscriptionName Azure subscription. + * Shows whether an app can be cloned to another resource group or + * subscription. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. - * - * @param {object} migrationOptions Migration migrationOptions. - * - * @param {string} migrationOptions.azurefilesConnectionString AzureFiles - * connection string. - * - * @param {string} migrationOptions.azurefilesShare AzureFiles share. - * - * @param {boolean} [migrationOptions.switchSiteAfterMigration] - * trueif the app should be switched over; otherwise, - * false. - * - * @param {boolean} [migrationOptions.blockWriteAccessToSite] true - * if the app should be read only during copy operation; otherwise, - * false. - * - * @param {string} [migrationOptions.kind] Kind of resource. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -17541,144 +17761,133 @@ function _listMetrics(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 StorageMigrationResponse} for more - * information. + * See {@link SiteCloneability} 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 _migrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, callback) { +function _isCloneable(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.beginMigrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, 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['StorageMigrationResponse']().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); + // 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'); } - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * @summary Migrates a local (in-app) MySql database to a remote MySql - * database. - * - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} migrationRequestEnvelope MySql migration options. - * - * @param {string} migrationRequestEnvelope.connectionString Connection string - * to the remote MySQL database. - * - * @param {string} migrationRequestEnvelope.migrationType The type of migration - * operation to be done. Possible values include: 'LocalToRemote', - * 'RemoteToLocal' - * - * @param {string} [migrationRequestEnvelope.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 Operation} 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 _migrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; + 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); } - if (!callback) { - throw new Error('callback cannot be null.'); + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable'; + 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('&'); } - // Send request - this.beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, 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; + // 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); if (responseBody === '') responseBody = null; - - // Deserialize Response + 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['Operation']().mapper(); + let resultMapper = new client.models['SiteCloneability']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -17687,23 +17896,21 @@ function _migrateMySql(resourceGroupName, name, migrationRequestEnvelope, option deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } + } - return callback(null, result, httpRequest, response); - }); + return callback(null, result, httpRequest, response); }); } /** - * @summary Returns the status of MySql in app migration, if one is active, and - * whether or not MySql in app is enabled + * @summary This is to allow calling via powershell and ARM template. * - * Returns the status of MySql in app migration, if one is active, and whether - * or not MySql in app is enabled + * This is to allow calling via powershell and ARM template. * * @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. * @@ -17717,13 +17924,13 @@ function _migrateMySql(resourceGroupName, name, migrationRequestEnvelope, 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 MigrateMySqlStatus} for more information. + * See {@link FunctionSecrets} 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 _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { +function _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -17733,7 +17940,6 @@ function _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17759,6 +17965,9 @@ function _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { 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.'); } @@ -17768,19 +17977,19 @@ function _getMigrateMySqlStatus(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}/migratemysql/status'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus'; 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(apiVersion)); + 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 @@ -17815,12 +18024,13 @@ function _getMigrateMySqlStatus(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) { @@ -17840,7 +18050,7 @@ function _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MigrateMySqlStatus']().mapper(); + let resultMapper = new client.models['FunctionSecrets']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -17856,20 +18066,16 @@ function _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { } /** - * @summary Gets all network features used by the app (or deployment slot, if + * @summary Gets all metric definitions of an app (or deployment slot, if * specified). * - * Gets all network features used by the app (or deployment slot, if - * specified). + * Gets all metric definitions 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} view The type of view. This can either be "summary" or - * "detailed". - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -17882,13 +18088,14 @@ function _getMigrateMySqlStatus(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 NetworkFeatures} for more information. + * 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 _listNetworkFeatures(resourceGroupName, name, view, options, callback) { +function _listMetricDefinitions(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -17898,7 +18105,6 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17921,12 +18127,12 @@ function _listNetworkFeatures(resourceGroupName, name, view, 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 (view === null || view === undefined || typeof view.valueOf() !== 'string') { - throw new Error('view 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.'); } @@ -17936,13 +18142,12 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/metricdefinitions'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{view}', encodeURIComponent(view)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -17974,7 +18179,7 @@ function _listNetworkFeatures(resourceGroupName, name, view, 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); @@ -17984,12 +18189,13 @@ function _listNetworkFeatures(resourceGroupName, name, view, 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) { @@ -18009,7 +18215,7 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NetworkFeatures']().mapper(); + let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -18025,24 +18231,25 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) } /** - * @summary Start capturing network packets for the site. + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). * - * Start capturing network packets for the site. + * Gets performance metrics of an app (or deployment slot, if specified). * * @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} [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 {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. * - * @param {string} [options.sasUrl] The Blob URL to store capture file. + * @param {string} [options.filter] Return only metrics 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 @@ -18053,13 +18260,15 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [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 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 _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { +function _listMetrics(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -18069,10 +18278,8 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, 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; - let apiVersion = '2016-08-01'; + let details = (options && options.details !== undefined) ? options.details : undefined; + let filter = (options && options.filter !== undefined) ? options.filter : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -18095,18 +18302,18 @@ function _startWebSiteNetworkTrace(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 (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 (details !== null && details !== undefined && typeof details !== 'boolean') { + throw new Error('details must be of type boolean.'); } - if (sasUrl !== null && sasUrl !== undefined && typeof sasUrl.valueOf() !== 'string') { - throw new Error('sasUrl 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.'); } + 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.'); } @@ -18116,28 +18323,25 @@ function _startWebSiteNetworkTrace(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}/networkTrace/start'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/metrics'; 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 (details !== null && details !== undefined) { + queryParameters.push('details=' + encodeURIComponent(details.toString())); } - if (sasUrl !== null && sasUrl !== undefined) { - queryParameters.push('sasUrl=' + encodeURIComponent(sasUrl)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -18172,12 +18376,13 @@ function _startWebSiteNetworkTrace(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) { @@ -18197,13 +18402,7 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; + let resultMapper = new client.models['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -18218,15 +18417,35 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { }); } + /** - * @summary Stop ongoing capturing network packets for the site. + * @summary Restores a web app. * - * Stop ongoing capturing network packets for the site. + * Restores a web app. + * + * @param {string} subscriptionName Azure subscription. * * @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 web app. + * + * @param {object} migrationOptions Migration migrationOptions. + * + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. + * + * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. + * + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. + * + * @param {string} [migrationOptions.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -18239,13 +18458,190 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [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 StorageMigrationResponse} 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 _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { +function _migrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, 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.beginMigrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, 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['StorageMigrationResponse']().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 Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.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 Operation} 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 _migrateMySql(resourceGroupName, name, migrationRequestEnvelope, 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.beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, 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['Operation']().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 the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @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 {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 MigrateMySqlStatus} 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 _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -18255,7 +18651,6 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -18281,6 +18676,9 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { 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.'); } @@ -18290,19 +18688,19 @@ function _stopWebSiteNetworkTrace(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}/networkTrace/stop'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status'; 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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -18337,12 +18735,13 @@ function _stopWebSiteNetworkTrace(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) { @@ -18362,13 +18761,7 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; + let resultMapper = new client.models['MigrateMySqlStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -18384,10 +18777,10 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { } /** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). + * @summary Gets all network features used by the app (or deployment slot, if + * specified). * - * Generates a new publishing password for an app (or deployment slot, if + * Gets all network features used by the app (or deployment slot, if * specified). * * @param {string} resourceGroupName Name of the resource group to which the @@ -18395,6 +18788,9 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { * * @param {string} name Name of the app. * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -18406,13 +18802,14 @@ function _stopWebSiteNetworkTrace(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} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkFeatures} 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 _generateNewSitePublishingPassword(resourceGroupName, name, options, callback) { +function _listNetworkFeatures(resourceGroupName, name, view, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -18422,7 +18819,6 @@ function _generateNewSitePublishingPassword(resourceGroupName, name, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -18445,9 +18841,15 @@ function _generateNewSitePublishingPassword(resourceGroupName, name, 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 (view === null || view === undefined || typeof view.valueOf() !== 'string') { + throw new Error('view 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.'); } @@ -18457,19 +18859,20 @@ function _generateNewSitePublishingPassword(resourceGroupName, name, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{view}', encodeURIComponent(view)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -18494,7 +18897,7 @@ function _generateNewSitePublishingPassword(resourceGroupName, name, options, ca 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); @@ -18522,27 +18925,47 @@ function _generateNewSitePublishingPassword(resourceGroupName, name, options, ca // 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['NetworkFeatures']().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 perfmon counters for web app. + * @summary Start capturing network packets for the site. * - * Gets perfmon counters for web 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 web app. + * @param {string} name The name of the 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 {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 @@ -18553,15 +18976,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. + * {string} [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 _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -18571,8 +18992,9 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-08-01'; + 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') { @@ -18595,12 +19017,21 @@ 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 (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.'); } @@ -18610,22 +19041,28 @@ 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}/networkTrace/start'; 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); + if (durationInSeconds !== null && durationInSeconds !== undefined) { + queryParameters.push('durationInSeconds=' + encodeURIComponent(durationInSeconds.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 @@ -18660,12 +19097,13 @@ function _listPerfMonCounters(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) { @@ -18685,7 +19123,13 @@ 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: 'String' + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -18701,14 +19145,14 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { } /** - * @summary Gets web app's event logs. + * @summary Stop ongoing capturing network packets for the site. * - * Gets web app's event logs. + * 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. * @@ -18721,14 +19165,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. + * {string} [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 _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -18738,7 +19181,6 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -18764,6 +19206,9 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { 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.'); } @@ -18773,19 +19218,19 @@ 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}/networkTrace/stop'; 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(apiVersion)); + 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 @@ -18820,12 +19265,13 @@ function _getSitePhpErrorLogFlag(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) { @@ -18845,7 +19291,13 @@ 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: 'String' + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -18861,9 +19313,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. @@ -18881,14 +19335,13 @@ function _getSitePhpErrorLogFlag(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. + * {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 _listPremierAddOns(resourceGroupName, name, options, callback) { +function _generateNewSitePublishingPassword(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -18898,7 +19351,6 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -18924,6 +19376,9 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { 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.'); } @@ -18933,19 +19388,19 @@ 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}/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(apiVersion)); + 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 @@ -18970,7 +19425,7 @@ function _listPremierAddOns(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); @@ -18998,6 +19453,165 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { // 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 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 _listPerfMonCounters(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.'); + } + let filter = (options && options.filter !== undefined) ? options.filter : 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 (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.'); + } + 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}/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('&'); + } + + // 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; @@ -19005,7 +19619,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) { @@ -19021,16 +19635,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. * @@ -19044,13 +19656,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') { @@ -19060,7 +19672,6 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19083,12 +19694,12 @@ 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.'); } + 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.'); } @@ -19098,13 +19709,12 @@ 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -19146,12 +19756,13 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, ca 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) { @@ -19171,7 +19782,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) { @@ -19187,44 +19798,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.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * - * @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 @@ -19243,7 +19825,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') { @@ -19253,7 +19835,6 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19276,15 +19857,12 @@ 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.'); } + 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.'); } @@ -19294,20 +19872,19 @@ 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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -19325,21 +19902,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) { @@ -19356,12 +19919,13 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO 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) { @@ -19397,9 +19961,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. @@ -19419,13 +19983,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') { @@ -19435,7 +20000,6 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19464,6 +20028,9 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, 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.'); } @@ -19479,14 +20046,14 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -19521,12 +20088,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) { @@ -19539,22 +20107,60 @@ 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); }); } /** - * @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 Updates a named add-on 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. + * Updates a named add-on 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} 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. * @@ -19568,13 +20174,13 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, 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 ProcessInfoCollection} 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 _listProcesses(resourceGroupName, name, options, callback) { +function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -19584,7 +20190,6 @@ function _listProcesses(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19607,9 +20212,18 @@ function _listProcesses(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 (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.'); } + 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.'); } @@ -19619,19 +20233,20 @@ 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}/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(apiVersion)); + 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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -19649,14 +20264,28 @@ function _listProcesses(resourceGroupName, name, options, callback) { } } } - httpRequest.body = null; + // 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; // 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); @@ -19666,12 +20295,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) { @@ -19691,7 +20321,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['PremierAddOn']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -19707,18 +20337,16 @@ function _listProcesses(resourceGroupName, name, options, callback) { } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary Delete a premier add-on from an app. * - * Get process information by its ID for a specific scaled-out instance in a - * web 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 Site name. + * @param {string} name Name of the app. * - * @param {string} processId PID. + * @param {string} premierAddOnName Add-on name. * * @param {object} [options] Optional Parameters. * @@ -19731,14 +20359,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. + * {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 _getProcess(resourceGroupName, name, processId, options, callback) { +function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -19748,7 +20375,6 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19771,12 +20397,15 @@ 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 (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.'); } + 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.'); } @@ -19786,20 +20415,20 @@ 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}/premieraddons/{premierAddOnName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -19824,7 +20453,7 @@ function _getProcess(resourceGroupName, name, processId, 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); @@ -19852,41 +20481,39 @@ function _getProcess(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['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 Terminate a process by its ID for a web site, or a deployment slot, - * or specific scaled-out instance in a web site. + * @summary Updates a named add-on of an app. * - * Terminate a process by its ID for a web site, or a deployment slot, or - * specific scaled-out instance in a web 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 Site name. + * @param {string} name Name of the app. * - * @param {string} processId PID. + * @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 {object} [options] Optional Parameters. * @@ -19899,13 +20526,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 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 _deleteProcess(resourceGroupName, name, processId, options, callback) { +function _updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -19915,7 +20543,6 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19938,12 +20565,18 @@ 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 (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.'); } + 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.'); } @@ -19953,20 +20586,20 @@ 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}/premieraddons/{premierAddOnName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -19984,14 +20617,28 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + 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(premierAddOn, 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 !== 204 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -20001,12 +20648,13 @@ function _deleteProcess(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) { @@ -20019,24 +20667,39 @@ 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['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); }); } /** - * @summary Get a memory dump of a process by its ID 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 a memory dump of a process by its ID 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} processId PID. + * @param {string} name The name of the web app. * * @param {object} [options] Optional Parameters. * @@ -20050,12 +20713,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 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 _getProcessDump(resourceGroupName, name, processId, options, callback) { +function _getPrivateAccess(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20065,7 +20729,6 @@ function _getProcessDump(resourceGroupName, name, processId, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20088,12 +20751,12 @@ function _getProcessDump(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.'); } + 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.'); } @@ -20103,13 +20766,12 @@ 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}/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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -20136,29 +20798,28 @@ 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}`); + 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 { - 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; - 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) { @@ -20168,26 +20829,51 @@ 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['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 List module information for a process 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. * - * List module information for a process 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. * @@ -20201,14 +20887,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. + * 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 _listProcessModules(resourceGroupName, name, processId, options, callback) { +function _putPrivateAccessVnet(resourceGroupName, name, access, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20218,7 +20903,6 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20241,12 +20925,15 @@ function _listProcessModules(resourceGroupName, name, processId, 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 (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.'); } + 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.'); } @@ -20256,20 +20943,19 @@ 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}/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(apiVersion)); + 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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -20287,14 +20973,28 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba } } } - 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); @@ -20304,12 +21004,13 @@ function _listProcessModules(resourceGroupName, name, processId, 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) { @@ -20329,7 +21030,7 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba 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['PrivateAccess']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -20345,21 +21046,17 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba } /** - * @summary Get process information 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. * - * Get process information 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} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Site name. * - * @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 @@ -20372,13 +21069,13 @@ 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 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 _getProcessModule(resourceGroupName, name, processId, baseAddress, options, callback) { +function _listProcesses(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20388,7 +21085,6 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20411,15 +21107,12 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, 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 (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.'); } + 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.'); } @@ -20429,14 +21122,12 @@ 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'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -20503,7 +21194,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['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -20519,11 +21210,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. @@ -20544,14 +21235,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 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 _listProcessThreads(resourceGroupName, name, processId, options, callback) { +function _getProcess(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20561,7 +21251,6 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20590,6 +21279,9 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba 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.'); } @@ -20599,13 +21291,13 @@ 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}'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -20672,7 +21364,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['ProcessInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -20688,11 +21380,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 Terminate a process by its ID for a web site, or a deployment slot, + * or 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. + * 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. @@ -20701,8 +21393,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 @@ -20714,14 +21404,13 @@ 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. + * {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 _getProcessThread(resourceGroupName, name, processId, threadId, options, callback) { +function _deleteProcess(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20731,7 +21420,6 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20757,12 +21445,12 @@ 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.'); } + 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.'); } @@ -20772,21 +21460,20 @@ 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}'; 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(apiVersion)); + 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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -20811,7 +21498,7 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options 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); @@ -20839,37 +21526,177 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options // 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['ProcessThreadInfo']().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 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} 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 {object} [options] Optional Parameters. * @@ -20883,14 +21710,14 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, 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 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 _listPublicCertificates(resourceGroupName, name, options, callback) { +function _listProcessModules(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20900,7 +21727,6 @@ function _listPublicCertificates(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20923,9 +21749,15 @@ function _listPublicCertificates(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 (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.'); } @@ -20935,12 +21767,13 @@ function _listPublicCertificates(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}/publicCertificates'; + 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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -20972,7 +21805,7 @@ function _listPublicCertificates(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); @@ -21007,7 +21840,7 @@ function _listPublicCertificates(resourceGroupName, name, 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) { @@ -21023,18 +21856,20 @@ function _listPublicCertificates(resourceGroupName, name, options, callback) { } /** - * @summary Get the named public certificate for an app (or deployment slot, if - * specified). + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. * - * Get the named public certificate for an app (or deployment slot, if - * specified). + * 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. * - * @param {string} name Name of the app. + * @param {string} name Site name. * - * @param {string} publicCertificateName Public certificate name. + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. * * @param {object} [options] Optional Parameters. * @@ -21048,13 +21883,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 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 _getPublicCertificate(resourceGroupName, name, publicCertificateName, options, callback) { +function _getProcessModule(resourceGroupName, name, processId, baseAddress, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21064,7 +21899,6 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21087,12 +21921,18 @@ 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 (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.'); } + 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.'); } @@ -21102,13 +21942,14 @@ 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}/modules/{baseAddress}'; 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('{baseAddress}', encodeURIComponent(baseAddress)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -21140,7 +21981,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); @@ -21175,7 +22016,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['ProcessModuleInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -21191,27 +22032,18 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o } /** - * @summary Creates a hostname binding for an app. + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. * - * Creates a hostname binding for an app. + * 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} 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} name Site name. * - * @param {string} [publicCertificate.kind] Kind of resource. + * @param {string} processId PID. * * @param {object} [options] Optional Parameters. * @@ -21225,13 +22057,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 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 _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertificateName, publicCertificate, options, callback) { +function _listProcessThreads(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21241,7 +22074,6 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21264,15 +22096,15 @@ 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 (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.'); } @@ -21282,20 +22114,20 @@ 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}/processes/{processId}/threads'; 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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21313,28 +22145,14 @@ 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) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -21369,7 +22187,7 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi 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['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -21385,16 +22203,20 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi } /** - * @summary Deletes a hostname binding for an app. + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. * - * Deletes a hostname binding for an app. + * 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} publicCertificateName Public certificate name. + * @param {string} processId PID. + * + * @param {string} threadId TID. * * @param {object} [options] Optional Parameters. * @@ -21407,13 +22229,14 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi * * {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 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 _deletePublicCertificate(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') { @@ -21423,7 +22246,6 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21446,12 +22268,18 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName 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.'); } + 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.'); } @@ -21461,20 +22289,21 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName // 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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21499,7 +22328,7 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName 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); @@ -21527,16 +22356,32 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName // 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['ProcessThreadInfo']().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 Get public certificates for an app or a deployment slot. * - * Gets the publishing profile for an app (or deployment slot, if specified). + * Get public certificates for an app or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -21545,11 +22390,6 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName * * @param {object} [options] Optional Parameters. * - * @param {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -21560,12 +22400,14 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName * {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 _listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, callback) { +function _listPublicCertificates(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21575,8 +22417,6 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, if (!callback) { throw new Error('callback cannot be null.'); } - let format = (options && options.format !== undefined) ? options.format : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21602,8 +22442,8 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, 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 (format !== null && format !== undefined && typeof format.valueOf() !== 'string') { - throw new Error('format 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.'); @@ -21611,27 +22451,22 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, } catch (error) { return callback(error); } - let publishingProfileOptions; - if (format !== null && format !== undefined) { - publishingProfileOptions = new client.models['CsmPublishingProfileOptions'](); - publishingProfileOptions.format = format; - } // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml'; + 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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21649,45 +22484,30 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, } } } - // 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; + 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) { - 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; - 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) { @@ -21697,123 +22517,45 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, } return callback(error); } - // Create Result - let result = response; - return callback(null, result, httpRequest, response); - }); -} - - -/** - * @summary Recovers a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. - * - * {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 _recover(resourceGroupName, name, recoveryEntity, 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.beginRecover(resourceGroupName, name, recoveryEntity, 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 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); - }); + 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 Get the named public certificate for an app (or deployment slot, if + * specified). * - * Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * 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 @@ -21825,13 +22567,14 @@ function _recover(resourceGroupName, name, recoveryEntity, 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 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 _resetProductionSlotConfig(resourceGroupName, name, options, callback) { +function _getPublicCertificate(resourceGroupName, name, publicCertificateName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21841,7 +22584,6 @@ function _resetProductionSlotConfig(resourceGroupName, name, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21864,9 +22606,15 @@ function _resetProductionSlotConfig(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 (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.'); } @@ -21876,19 +22624,20 @@ function _resetProductionSlotConfig(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}/resetSlotConfig'; + 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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21923,12 +22672,13 @@ function _resetProductionSlotConfig(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) { @@ -21941,30 +22691,52 @@ function _resetProductionSlotConfig(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['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 Restarts an app (or deployment slot, if specified). + * @summary Creates a hostname binding for an app. * - * Restarts 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} [options] Optional Parameters. + * @param {string} publicCertificateName Public certificate name. * - * @param {boolean} [options.softRestart] Specify true to apply the - * configuration settings and restarts the app only if necessary. By default, - * the API always restarts and reprovisions the app. + * @param {object} publicCertificate Public certificate details. This is the + * JSON representation of a PublicCertificate object. * - * @param {boolean} [options.synchronous] Specify true to block until the app - * is restarted. By default, it is set to false, and the API responds - * immediately (asynchronous). + * @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 @@ -21975,13 +22747,14 @@ function _resetProductionSlotConfig(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} [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 _restart(resourceGroupName, name, options, callback) { +function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertificateName, publicCertificate, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21991,9 +22764,6 @@ function _restart(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let softRestart = (options && options.softRestart !== undefined) ? options.softRestart : undefined; - let synchronous = (options && options.synchronous !== undefined) ? options.synchronous : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22016,15 +22786,18 @@ function _restart(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 (softRestart !== null && softRestart !== undefined && typeof softRestart !== 'boolean') { - throw new Error('softRestart must be of type boolean.'); + 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 (synchronous !== null && synchronous !== undefined && typeof synchronous !== 'boolean') { - throw new Error('synchronous must be of type boolean.'); + 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.'); } @@ -22034,25 +22807,20 @@ function _restart(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}/restart'; + 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 = []; - if (softRestart !== null && softRestart !== undefined) { - queryParameters.push('softRestart=' + encodeURIComponent(softRestart.toString())); - } - if (synchronous !== null && synchronous !== undefined) { - queryParameters.push('synchronous=' + encodeURIComponent(synchronous.toString())); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -22070,7 +22838,21 @@ function _restart(resourceGroupName, name, options, callback) { } } } - httpRequest.body = null; + // 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) { @@ -22087,12 +22869,13 @@ function _restart(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) { @@ -22105,20 +22888,39 @@ function _restart(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['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 Get list of siteextensions for a web site, or a deployment slot. + * @summary Deletes a hostname binding for an app. * - * Get list of siteextensions for a web site, or a deployment slot. + * Deletes a hostname binding for 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} publicCertificateName Public certificate name. * * @param {object} [options] Optional Parameters. * @@ -22131,15 +22933,13 @@ function _restart(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 SiteExtensionInfoCollection} 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 _listSiteExtensions(resourceGroupName, name, options, callback) { +function _deletePublicCertificate(resourceGroupName, name, publicCertificateName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22149,7 +22949,6 @@ function _listSiteExtensions(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22172,9 +22971,15 @@ function _listSiteExtensions(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 (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.'); } @@ -22184,19 +22989,20 @@ function _listSiteExtensions(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}/siteextensions'; + 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(apiVersion)); + 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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -22221,7 +23027,7 @@ function _listSiteExtensions(resourceGroupName, name, options, callback) { 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); @@ -22249,44 +23055,29 @@ function _listSiteExtensions(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['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 site extension information by its ID for a web site, or a - * deployment slot. + * @summary Gets the publishing profile for an app (or deployment slot, if + * specified). * - * Get site extension information by its ID for a web site, or a deployment - * slot. + * 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 Site name. - * - * @param {string} siteExtensionId Site extension name. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -22297,13 +23088,12 @@ function _listSiteExtensions(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 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 _getSiteExtension(resourceGroupName, name, siteExtensionId, options, callback) { +function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22313,7 +23103,7 @@ function _getSiteExtension(resourceGroupName, name, siteExtensionId, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; + let format = (options && options.format !== undefined) ? options.format : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22336,35 +23126,42 @@ function _getSiteExtension(resourceGroupName, name, siteExtensionId, 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 (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 (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 (format !== null && format !== undefined && typeof format.valueOf() !== 'string') { + throw new Error('format 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); } + let publishingProfileOptions; + if (format !== null && format !== undefined) { + publishingProfileOptions = new client.models['CsmPublishingProfileOptions'](); + publishingProfileOptions.format = format; + } // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{siteExtensionId}', encodeURIComponent(siteExtensionId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 @@ -22382,29 +23179,46 @@ function _getSiteExtension(resourceGroupName, name, siteExtensionId, options, ca } } } - httpRequest.body = null; + // 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 && statusCode !== 404) { - let error = new Error(responseBody); + 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 { - 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; - 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) { @@ -22414,125 +23228,24 @@ function _getSiteExtension(resourceGroupName, name, siteExtensionId, options, ca } 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['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); - } - } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } - /** - * @summary Install site extension on a web site, or a deployment slot. - * - * 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 Site name. - * - * @param {string} siteExtensionId Site extension 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 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 _installSiteExtension(resourceGroupName, name, siteExtensionId, 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.beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, 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['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); - } - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * @summary Remove a site extension from a web site, or a deployment slot. + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * Remove a site extension from a web site, or a deployment slot. + * 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 Site name. - * - * @param {string} siteExtensionId Site extension name. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -22551,7 +23264,7 @@ function _installSiteExtension(resourceGroupName, name, siteExtensionId, options * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, callback) { +function _resetProductionSlotConfig(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22561,7 +23274,6 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22584,12 +23296,12 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, 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 (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 (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.'); } @@ -22599,20 +23311,19 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{siteExtensionId}', encodeURIComponent(siteExtensionId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -22637,7 +23348,7 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -22671,15 +23382,467 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, } /** - * @summary Gets an app's deployment slots. + * @summary Restarts an app (or deployment slot, if specified). * - * Gets an app's deployment slots. + * Restarts 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 {boolean} [options.softRestart] Specify true to apply the + * configuration settings and restarts the app only if necessary. By default, + * the API always restarts and reprovisions the app. + * + * @param {boolean} [options.synchronous] Specify true to block until the app + * is restarted. By default, it is set to false, and the API responds + * immediately (asynchronous). + * + * @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 _restart(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.'); + } + let softRestart = (options && options.softRestart !== undefined) ? options.softRestart : undefined; + let synchronous = (options && options.synchronous !== undefined) ? options.synchronous : 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 (softRestart !== null && softRestart !== undefined && typeof softRestart !== 'boolean') { + throw new Error('softRestart must be of type boolean.'); + } + if (synchronous !== null && synchronous !== undefined && typeof synchronous !== 'boolean') { + throw new Error('synchronous must be of type boolean.'); + } + 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}/restart'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (softRestart !== null && softRestart !== undefined) { + queryParameters.push('softRestart=' + encodeURIComponent(softRestart.toString())); + } + if (synchronous !== null && synchronous !== undefined) { + queryParameters.push('synchronous=' + encodeURIComponent(synchronous.toString())); + } + 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); + 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 an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.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. + * + * {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 _restoreFromBackupBlob(resourceGroupName, name, request, 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.beginRestoreFromBackupBlob(resourceGroupName, name, request, 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 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 {string} [restoreRequest.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. + * + * {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 _restoreFromDeletedApp(resourceGroupName, name, restoreRequest, 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.beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, 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 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 {string} [restoreRequest.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. + * + * {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 _restoreSnapshot(resourceGroupName, name, restoreRequest, 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.beginRestoreSnapshot(resourceGroupName, name, restoreRequest, 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 Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, 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 @@ -22692,13 +23855,14 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, 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 WebAppCollection} 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 _listSlots(resourceGroupName, name, options, callback) { +function _listSiteExtensions(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22708,7 +23872,6 @@ function _listSlots(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22734,6 +23897,9 @@ function _listSlots(resourceGroupName, name, options, callback) { 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.'); } @@ -22743,12 +23909,12 @@ function _listSlots(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}/slots'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -22780,7 +23946,7 @@ function _listSlots(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); @@ -22815,7 +23981,7 @@ function _listSlots(resourceGroupName, name, 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['SiteExtensionInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -22831,17 +23997,18 @@ function _listSlots(resourceGroupName, name, options, callback) { } /** - * @summary Gets the details of a web, mobile, or API app. + * @summary Get site extension information by its ID for a web site, or a + * deployment slot. * - * Gets the details of a web, mobile, or API app. + * Get site extension information by its ID for 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 the app. + * @param {string} name Site name. * - * @param {string} slot Name of the deployment slot. By default, this API - * returns the production slot. + * @param {string} siteExtensionId Site extension name. * * @param {object} [options] Optional Parameters. * @@ -22855,13 +24022,13 @@ function _listSlots(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 Site} for more information. + * 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 _getSlot(resourceGroupName, name, slot, options, callback) { +function _getSiteExtension(resourceGroupName, name, siteExtensionId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22871,7 +24038,6 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22894,12 +24060,15 @@ function _getSlot(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 (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 (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 (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.'); } @@ -22909,13 +24078,13 @@ function _getSlot(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}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{siteExtensionId}', encodeURIComponent(siteExtensionId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -22982,7 +24151,7 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Site']().mapper(); + let resultMapper = new client.models['SiteExtensionInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -22999,65 +24168,1248 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { /** - * @summary Creates a new web, mobile, or API app in an existing resource - * group, or updates an existing app. + * @summary Install site extension on a web site, or a deployment slot. * - * Creates a new web, mobile, or API app in an existing resource group, or - * updates an existing 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 Unique name of the app to create or update. To create - * or update a deployment slot, use the {slot} parameter. - * - * @param {object} siteEnvelope A JSON representation of the app properties. - * See example. - * - * @param {boolean} [siteEnvelope.enabled] true if the app is - * enabled; otherwise, false. Setting this value to false disables - * the app (takes the app offline). - * - * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used - * to manage the SSL bindings for app's hostnames. - * - * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated - * App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". - * - * @param {boolean} [siteEnvelope.reserved] true if reserved; - * otherwise, false. - * - * @param {object} [siteEnvelope.siteConfig] Configuration of the app. - * - * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. - * - * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * @param {string} name Site name. * - * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework - * version. + * @param {string} siteExtensionId Site extension name. * - * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * @param {object} [options] Optional Parameters. * - * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * @param {function} callback - The callback. * - * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework - * and version + * @returns {function} callback(err, result, request, response) * - * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] - * true if request tracing is enabled; otherwise, - * false. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request - * tracing expiration time. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SiteExtensionInfo} for more information. * - * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] - * true if remote debugging is enabled; otherwise, - * false. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _installSiteExtension(resourceGroupName, name, siteExtensionId, 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.beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, 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['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); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary Remove a site extension from a web site, or a deployment slot. + * + * Remove a site extension from a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension 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. + * + * {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 _deleteSiteExtension(resourceGroupName, name, siteExtensionId, 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 (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 (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}/siteextensions/{siteExtensionId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{siteExtensionId}', encodeURIComponent(siteExtensionId)); + 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 !== 204 && 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 Gets an app's deployment slots. + * + * Gets an app's deployment slots. + * + * @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 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 _listSlots(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}/slots'; + 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['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 the details of a web, mobile, or API app. + * + * Gets the details of a web, mobile, or API 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. By default, this API + * returns 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 Site} 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 _getSlot(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}'; + 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 && 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['Site']().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 new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /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 {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @param {string} slot Name of the deployment slot to create or update. By + * default, this API attempts to create or modify 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 Site} 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 _createOrUpdateSlot(resourceGroupName, name, siteEnvelope, 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.beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, 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['Site']().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 a web, mobile, or API app, or one of the deployment slots. + * + * Deletes a web, mobile, or API app, or one of the deployment slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app to delete. + * + * @param {string} slot Name of the deployment slot to delete. By default, the + * API deletes the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteMetrics] If true, web app metrics are also + * deleted. + * + * @param {boolean} [options.deleteEmptyServerFarm] Specify true if the App + * Service plan will be empty after app deletion and you want to delete the + * empty App Service plan. By default, the empty App Service plan is not + * deleted. + * + * @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 _deleteSlot(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 deleteMetrics = (options && options.deleteMetrics !== undefined) ? options.deleteMetrics : undefined; + let deleteEmptyServerFarm = (options && options.deleteEmptyServerFarm !== undefined) ? options.deleteEmptyServerFarm : 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 (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 (deleteMetrics !== null && deleteMetrics !== undefined && typeof deleteMetrics !== 'boolean') { + throw new Error('deleteMetrics must be of type boolean.'); + } + if (deleteEmptyServerFarm !== null && deleteEmptyServerFarm !== undefined && typeof deleteEmptyServerFarm !== 'boolean') { + throw new Error('deleteEmptyServerFarm must be of type boolean.'); + } + 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}'; + 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 (deleteMetrics !== null && deleteMetrics !== undefined) { + queryParameters.push('deleteMetrics=' + encodeURIComponent(deleteMetrics.toString())); + } + if (deleteEmptyServerFarm !== null && deleteEmptyServerFarm !== undefined) { + queryParameters.push('deleteEmptyServerFarm=' + encodeURIComponent(deleteEmptyServerFarm.toString())); + } + 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 && 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 Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote * debugging version. * * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] @@ -23210,195 +25562,1106 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * - * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /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 {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot to create or update. By + * default, this API attempts to create or modify 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 Site} 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 _updateSlot(resourceGroupName, name, siteEnvelope, 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 (siteEnvelope === null || siteEnvelope === undefined) { + throw new Error('siteEnvelope 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}'; + 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 = '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 (siteEnvelope !== null && siteEnvelope !== undefined) { + let requestModelMapper = new client.models['SitePatchResource']().mapper(); + requestModel = client.serialize(requestModelMapper, siteEnvelope, 'siteEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteEnvelope, 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) { + 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['Site']().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 === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Site']().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 Analyze a custom hostname. + * + * Analyze a custom hostname. + * + * @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.hostName] Custom hostname. + * + * @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 CustomHostnameAnalysisResult} 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 _analyzeCustomHostnameSlot(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 hostName = (options && options.hostName !== undefined) ? options.hostName : 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 (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 (hostName !== null && hostName !== undefined && typeof hostName.valueOf() !== 'string') { + throw new Error('hostName 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}/analyzeCustomHostname'; + 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 (hostName !== null && hostName !== undefined) { + queryParameters.push('hostName=' + encodeURIComponent(hostName)); + } + 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['CustomHostnameAnalysisResult']().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 Applies the configuration settings from the target slot onto the + * current slot. + * + * Applies the configuration settings from the target slot onto the current + * 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 {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. * - * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a - * flag indicating whether the Push endpoint is enabled. + * @param {object} [options] Optional Parameters. * - * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets - * a JSON string containing a list of tags that are whitelisted for use by the - * push registration endpoint. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or - * sets a JSON string containing a list of tags that require user - * authentication to be used in the push registration endpoint. - * Tags can consist of alphanumeric characters and the following: - * '_', '@', '#', '.', ':', '-'. - * Validation should be performed at the PushRequestHandler. + * @param {function} callback - The callback. * - * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets - * a JSON string containing a list of dynamic tags that will be evaluated from - * user claims in the push registration endpoint. + * @returns {function} callback(err, result, request, response) * - * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about - * the formal API definition for the app. + * {null} [result] - The deserialized result object if an error did not occur. * - * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the - * API definition. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot - * name. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, 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 (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.'); + } + 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}/applySlotConfig'; + 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 (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) { + 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 Creates a backup of an app. * - * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] - * true to enable local MySQL; otherwise, false. + * Creates a backup of an app. * - * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: - * configures a web site to allow clients to connect over http2.0 + * @param {string} name Name of the app. * - * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: - * configures the minimum version of TLS required for SSL requests. Possible - * values include: '1.0', '1.1', '1.2' + * @param {object} request Backup configuration. You can use the JSON response + * from the POST action as input here. * - * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop - * SCM (KUDU) site when the app is stopped; otherwise, false. The - * default is false. + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. * - * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service - * Environment to use for the app. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. * - * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to - * enable client affinity; false to stop sending session affinity - * cookies, which route client requests in the same session to the same - * instance. Default is true. + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) * - * @param {boolean} [siteEnvelope.clientCertEnabled] true to - * enable client certificate authentication (TLS mutual authentication); - * otherwise, false. Default is false. + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' * - * @param {boolean} [siteEnvelope.hostNamesDisabled] true to - * disable the public hostnames of the app; otherwise, false. - * If true, the app is only accessible via API management process. + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. * - * @param {number} [siteEnvelope.containerSize] Size of the function container. + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. * - * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily - * memory-time quota (applicable on dynamic apps only). + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. * - * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, - * the app is cloned from a source app. + * @param {array} [request.databases] Databases included in the backup. * - * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of - * cloning operation. This ID ties multiple cloning operations - * together to use the same snapshot. + * @param {string} [request.kind] Kind of resource. * - * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to - * overwrite destination app; otherwise, false. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a backup for the production slot. * - * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] - * true to clone custom hostnames from source app; otherwise, - * false. + * @param {object} [options] Optional Parameters. * - * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] - * true to clone source control from source app; otherwise, - * false. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of - * the source app. App resource ID is of the form - * /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 {function} callback - The callback. * - * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service - * Environment. + * @returns {function} callback(err, result, request, response) * - * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application - * setting overrides for cloned app. If specified, these settings override the - * settings cloned - * from source app. Otherwise, application settings from source app are - * retained. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] - * true to configure load balancing for source and destination - * app. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItem} for more information. * - * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM - * resource ID of the Traffic Manager profile to use, if it exists. Traffic - * Manager resource ID is of the form - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of - * Traffic Manager profile to create. This is only needed if Traffic Manager - * profile does not already exist. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _backupSlot(resourceGroupName, name, request, 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 (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}/backup'; + 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['BackupRequest']().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) { + 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['BackupItem']().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. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. + * Gets existing backups of an app. * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. + * @param {string} name Name of the app. * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get backups of the production slot. * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS + * @param {object} [options] Optional Parameters. * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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 {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. + * @param {function} callback - The callback. * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. + * @returns {function} callback(err, result, request, response) * - * @param {boolean} [siteEnvelope.snapshotInfo.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. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItemCollection} for more information. * - * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site - * to accept only https requests. Issues redirect for - * http requests + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [siteEnvelope.identity] + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listBackupsSlot(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}/backups'; + 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; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['BackupItemCollection']().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 backup of an app by its ID. * - * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * Gets a backup of an app by its ID. * - * @param {string} [siteEnvelope.kind] Kind of resource. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} siteEnvelope.location Resource Location. + * @param {string} name Name of the app. * - * @param {object} [siteEnvelope.tags] Resource tags. + * @param {string} backupId ID of the backup. * - * @param {string} slot Name of the deployment slot to create or update. By - * default, this API attempts to create or modify the production slot. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a backup of the production slot. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -23409,50 +26672,141 @@ function _getSlot(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 Site} for more information. + * See {@link BackupItem} 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 _createOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, options, callback) { +function _getBackupStatusSlot(resourceGroupName, name, backupId, 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 (backupId === null || backupId === undefined || typeof backupId.valueOf() !== 'string') { + throw new Error('backupId 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); + } - // Send request - this.beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, 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; + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); + 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('&'); + } - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; + // 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; - - // Deserialize Response + 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['Site']().mapper(); + let resultMapper = new client.models['BackupItem']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -23461,37 +26815,28 @@ function _createOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, option deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } + } - return callback(null, result, httpRequest, response); - }); + return callback(null, result, httpRequest, response); }); } /** - * @summary Deletes a web, mobile, or API app, or one of the deployment slots. + * @summary Deletes a backup of an app by its ID. * - * Deletes a web, mobile, or API app, or one of the deployment slots. + * Deletes a backup of an app by its ID. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app to delete. - * - * @param {string} slot Name of the deployment slot to delete. By default, the - * API deletes the production slot. - * - * @param {object} [options] Optional Parameters. + * @param {string} name Name of the app. * - * @param {boolean} [options.deleteMetrics] If true, web app metrics are also - * deleted. + * @param {string} backupId ID of the backup. * - * @param {boolean} [options.deleteEmptyServerFarm] Specify true if the App - * Service plan will be empty after app deletion and you want to delete the - * empty App Service plan. By default, the empty App Service plan is not - * deleted. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a backup of the production slot. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -23508,7 +26853,7 @@ function _createOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, option * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteSlot(resourceGroupName, name, slot, options, callback) { +function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -23518,10 +26863,6 @@ function _deleteSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let deleteMetrics = (options && options.deleteMetrics !== undefined) ? options.deleteMetrics : undefined; - let deleteEmptyServerFarm = (options && options.deleteEmptyServerFarm !== undefined) ? options.deleteEmptyServerFarm : undefined; - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -23544,21 +26885,18 @@ function _deleteSlot(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 (backupId === null || backupId === undefined || typeof backupId.valueOf() !== 'string') { + throw new Error('backupId 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 (deleteMetrics !== null && deleteMetrics !== undefined && typeof deleteMetrics !== 'boolean') { - throw new Error('deleteMetrics must be of type boolean.'); - } - if (deleteEmptyServerFarm !== null && deleteEmptyServerFarm !== undefined && typeof deleteEmptyServerFarm !== 'boolean') { - throw new Error('deleteEmptyServerFarm must be of type boolean.'); - } - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } 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.'); } @@ -23568,22 +26906,14 @@ function _deleteSlot(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}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - if (deleteMetrics !== null && deleteMetrics !== undefined) { - queryParameters.push('deleteMetrics=' + encodeURIComponent(deleteMetrics.toString())); - } - if (deleteEmptyServerFarm !== null && deleteEmptyServerFarm !== undefined) { - queryParameters.push('deleteEmptyServerFarm=' + encodeURIComponent(deleteEmptyServerFarm.toString())); - } - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -23615,7 +26945,7 @@ function _deleteSlot(resourceGroupName, name, slot, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -23649,396 +26979,365 @@ function _deleteSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Creates a new web, mobile, or API app in an existing resource - * group, or updates an existing app. + * @summary Gets status of a web app backup that may be in progress, including + * secrets associated with the backup, such as the Azure Storage SAS URL. Also + * can be used to update the SAS URL for the backup if a new URL is passed in + * the request body. * - * Creates a new web, mobile, or API app in an existing resource group, or - * updates an existing app. + * Gets status of a web app backup that may be in progress, including secrets + * associated with the backup, such as the Azure Storage SAS URL. Also can be + * used to update the SAS URL for the backup if a new URL is passed in the + * request body. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Unique name of the app to create or update. To create - * or update a deployment slot, use the {slot} parameter. - * - * @param {object} siteEnvelope A JSON representation of the app properties. - * See example. - * - * @param {boolean} [siteEnvelope.enabled] true if the app is - * enabled; otherwise, false. Setting this value to false disables - * the app (takes the app offline). - * - * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used - * to manage the SSL bindings for app's hostnames. - * - * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated - * App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". - * - * @param {boolean} [siteEnvelope.reserved] true if reserved; - * otherwise, false. - * - * @param {object} [siteEnvelope.siteConfig] Configuration of the app. - * - * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. - * - * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. - * - * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework - * version. - * - * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. - * - * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. - * - * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. - * - * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework - * and version - * - * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] - * true if request tracing is enabled; otherwise, - * false. - * - * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request - * tracing expiration time. - * - * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] - * true if remote debugging is enabled; otherwise, - * false. - * - * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote - * debugging version. - * - * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] - * true if HTTP logging is enabled; otherwise, false. - * - * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs - * directory size limit. - * - * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] - * true if detailed error logging is enabled; otherwise, - * false. - * - * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user - * name. - * - * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. - * - * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection - * strings. - * - * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. - * - * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. - * - * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values - * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', - * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', - * 'OneDrive', 'VSO' - * - * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] - * true to use 32-bit worker process; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] - * true if WebSocket is enabled; otherwise, false. - * - * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if - * Always On is enabled; otherwise, false. - * - * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. - * - * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. - * - * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java - * container version. - * - * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to - * launch. - * - * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed - * pipeline mode. Possible values include: 'Integrated', 'Classic' - * - * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual - * applications. - * - * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. - * Possible values include: 'WeightedRoundRobin', 'LeastRequests', - * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' - * - * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. - * - * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of - * ramp-up rules. - * - * @param {object} [siteEnvelope.siteConfig.limits] Site limits. - * - * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum - * allowed CPU usage percentage. - * - * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum - * allowed memory usage in MB. - * - * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum - * allowed disk size usage in MB. - * - * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true - * if Auto Heal is enabled; otherwise, false. - * - * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. - * - * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions - * that describe when to execute the auto-heal actions. - * - * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A - * rule based on total requests. - * - * @param {number} - * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request - * Count. - * - * @param {string} - * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time - * interval. - * - * @param {number} - * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule - * based on private bytes. - * - * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] - * A rule based on status codes. - * - * @param {object} - * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based - * on request execution time. - * - * @param {string} - * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time - * taken. - * - * @param {number} - * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request - * Count. - * - * @param {string} - * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] - * Time interval. - * - * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to - * be executed when a rule is triggered. - * - * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] - * Predefined action to be taken. Possible values include: 'Recycle', - * 'LogEvent', 'CustomAction' - * - * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] - * Custom action to be taken. - * - * @param {string} - * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable - * to be run. - * - * @param {string} - * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] - * Parameters for the executable. - * - * @param {string} - * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] - * Minimum time the process must execute - * before taking the action - * - * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. - * - * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * @param {string} name Name of web app. * - * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing - * (CORS) settings. + * @param {string} backupId ID of backup. * - * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets - * the list of origins that should be allowed to make cross-origin - * calls (for example: http://example.com:12345). Use "*" to allow all. + * @param {object} request Information on backup request. * - * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. * - * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a - * flag indicating whether the Push endpoint is enabled. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets - * a JSON string containing a list of tags that are whitelisted for use by the - * push registration endpoint. + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. * - * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or - * sets a JSON string containing a list of tags that require user - * authentication to be used in the push registration endpoint. - * Tags can consist of alphanumeric characters and the following: - * '_', '@', '#', '.', ':', '-'. - * Validation should be performed at the PushRequestHandler. + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) * - * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets - * a JSON string containing a list of dynamic tags that will be evaluated from - * user claims in the push registration endpoint. + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' * - * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. * - * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about - * the formal API definition for the app. + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. * - * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the - * API definition. + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. * - * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot - * name. + * @param {array} [request.databases] Databases included in the backup. * - * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] - * true to enable local MySQL; otherwise, false. + * @param {string} [request.kind] Kind of resource. * - * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. * - * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: - * configures a web site to allow clients to connect over http2.0 + * @param {object} [options] Optional Parameters. * - * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: - * configures the minimum version of TLS required for SSL requests. Possible - * values include: '1.0', '1.1', '1.2' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop - * SCM (KUDU) site when the app is stopped; otherwise, false. The - * default is false. + * @param {function} callback - The callback. * - * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service - * Environment to use for the app. + * @returns {function} callback(err, result, request, response) * - * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to - * enable client affinity; false to stop sending session affinity - * cookies, which route client requests in the same session to the same - * instance. Default is true. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItem} for more information. * - * @param {boolean} [siteEnvelope.clientCertEnabled] true to - * enable client certificate authentication (TLS mutual authentication); - * otherwise, false. Default is false. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {boolean} [siteEnvelope.hostNamesDisabled] true to - * disable the public hostnames of the app; otherwise, false. - * If true, the app is only accessible via API management process. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request, 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 (backupId === null || backupId === undefined || typeof backupId.valueOf() !== 'string') { + throw new Error('backupId 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 (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}/backups/{backupId}/list'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); + 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['BackupRequest']().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) { + 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['BackupItem']().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 Restores a specific backup to another app (or deployment slot, if + * specified). * - * @param {number} [siteEnvelope.containerSize] Size of the function container. + * Restores a specific backup to another app (or deployment slot, if + * specified). * - * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily - * memory-time quota (applicable on dynamic apps only). + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, - * the app is cloned from a source app. + * @param {string} name Name of the app. * - * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of - * cloning operation. This ID ties multiple cloning operations - * together to use the same snapshot. + * @param {string} backupId ID of the backup. * - * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to - * overwrite destination app; otherwise, false. + * @param {object} request Information on restore request . * - * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] - * true to clone custom hostnames from source app; otherwise, - * false. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] - * true to clone source control from source app; otherwise, - * false. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of - * the source app. App resource ID is of the form - * /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} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. * - * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service - * Environment. + * @param {string} [request.siteName] Name of an app. * - * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application - * setting overrides for cloned app. If specified, these settings override the - * settings cloned - * from source app. Otherwise, application settings from source app are - * retained. + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] - * true to configure load balancing for source and destination - * app. + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. * - * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM - * resource ID of the Traffic Manager profile to use, if it exists. Traffic - * Manager resource ID is of the form - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of - * Traffic Manager profile to create. This is only needed if Traffic Manager - * profile does not already exist. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. + * @param {string} [request.kind] Kind of resource. * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS + * @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} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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 {object} [options] Optional Parameters. * - * @param {boolean} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. + * @param {function} callback - The callback. * - * @param {boolean} [siteEnvelope.snapshotInfo.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. + * @returns {function} callback(err, result, request, response) * - * @param {string} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site - * to accept only https requests. Issues redirect for - * http requests + * {null} [result] - The deserialized result object if an error did not occur. * - * @param {string} [siteEnvelope.kind] Kind of resource. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} slot Name of the deployment slot to create or update. By - * default, this API attempts to create or modify the production slot. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _restoreSlot(resourceGroupName, name, backupId, request, 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.beginRestoreSlot(resourceGroupName, name, backupId, request, 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 + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary List the configurations of an app * - * @param {object} [options] Optional Parameters. + * List the configurations of an app * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. + * @param {string} name Name of the app. * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -24050,13 +27349,14 @@ function _deleteSlot(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 Site} 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 _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callback) { +function _listConfigurationsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -24066,11 +27366,6 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; - let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; - let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -24093,27 +27388,15 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, 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 (siteEnvelope === null || siteEnvelope === undefined) { - throw new Error('siteEnvelope 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { - throw new Error('skipCustomDomainVerification must be of type boolean.'); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { - throw new Error('forceDnsRegistration must be of type boolean.'); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { - throw new Error('ttlInSeconds 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.'); } @@ -24123,32 +27406,20 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, 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}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config'; 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { - queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { - queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined) { - queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -24166,28 +27437,14 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callb } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (siteEnvelope !== null && siteEnvelope !== undefined) { - let requestModelMapper = new client.models['SitePatchResource']().mapper(); - requestModel = client.serialize(requestModelMapper, siteEnvelope, 'siteEnvelope'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(siteEnvelope, 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); @@ -24197,12 +27454,13 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, 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) { @@ -24222,7 +27480,7 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callb parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Site']().mapper(); + let resultMapper = new client.models['SiteConfigResourceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -24232,44 +27490,32 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callb 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 = new client.models['Site']().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 Analyze a custom hostname. + * @summary Replaces the application settings of an app. * - * Analyze a custom hostname. + * Replaces the application settings of an app. * * @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 {object} appSettings Application settings of the app. * - * @param {object} [options] Optional Parameters. + * @param {object} [appSettings.properties] Settings. * - * @param {string} [options.hostName] Custom hostname. + * @param {string} [appSettings.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the application settings for the production + * slot. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -24281,14 +27527,13 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, 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 CustomHostnameAnalysisResult} for more - * information. + * See {@link StringDictionary} 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 _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, callback) { +function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -24298,8 +27543,6 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let hostName = (options && options.hostName !== undefined) ? options.hostName : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -24322,15 +27565,18 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, 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 (appSettings === null || appSettings === undefined) { + throw new Error('appSettings 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 (hostName !== null && hostName !== undefined && typeof hostName.valueOf() !== 'string') { - throw new Error('hostName 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.'); } @@ -24340,23 +27586,20 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, 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}/analyzeCustomHostname'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings'; 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 (hostName !== null && hostName !== undefined) { - queryParameters.push('hostName=' + encodeURIComponent(hostName)); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -24374,7 +27617,21 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (appSettings !== null && appSettings !== undefined) { + let requestModelMapper = new client.models['StringDictionary']().mapper(); + requestModel = client.serialize(requestModelMapper, appSettings, 'appSettings'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(appSettings, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -24391,12 +27648,13 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, 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) { @@ -24416,7 +27674,7 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['CustomHostnameAnalysisResult']().mapper(); + let resultMapper = new client.models['StringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -24432,28 +27690,18 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call } /** - * @summary Applies the configuration settings from the target slot onto the - * current slot. + * @summary Gets the application settings of an app. * - * Applies the configuration settings from the target slot onto the current - * slot. + * Gets the application settings 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 {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the application settings for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -24466,13 +27714,14 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, 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 StringDictionary} 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 _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, slot, options, callback) { +function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -24482,7 +27731,6 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, sl if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -24505,15 +27753,15 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, 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 (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.'); } + 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.'); } @@ -24523,13 +27771,13 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, sl // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -24554,21 +27802,7 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, sl } } } - // 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) { @@ -24585,12 +27819,13 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, sl 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) { @@ -24603,63 +27838,186 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, 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['StringDictionary']().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 backup of an app. + * @summary Updates the Authentication / Authorization settings associated with + * web app. * - * Creates a backup of an app. + * Updates the Authentication / Authorization settings associated with 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} request Backup configuration. You can use the JSON response - * from the POST action as input here. + * @param {object} siteAuthSettings Auth settings associated with web app. * - * @param {string} request.backupRequestName Name of the backup. + * @param {boolean} [siteAuthSettings.enabled] true if the + * Authentication / Authorization feature is enabled for the current app; + * otherwise, false. * - * @param {boolean} [request.enabled] True if the backup schedule is enabled - * (must be included in that case), false if the backup schedule should be - * disabled. + * @param {string} [siteAuthSettings.runtimeVersion] The RuntimeVersion of the + * Authentication / Authorization feature in use for the current app. + * The setting in this value can control the behavior of certain features in + * the Authentication / Authorization module. * - * @param {string} request.storageAccountUrl SAS URL to the container. + * @param {string} [siteAuthSettings.unauthenticatedClientAction] The action to + * take when an unauthenticated client attempts to access the app. Possible + * values include: 'RedirectToLoginPage', 'AllowAnonymous' * - * @param {object} [request.backupSchedule] Schedule for the backup if it is - * executed periodically. + * @param {boolean} [siteAuthSettings.tokenStoreEnabled] true to + * durably store platform-specific security tokens that are obtained during + * login flows; otherwise, false. + * The default is false. * - * @param {number} request.backupSchedule.frequencyInterval How often the - * backup should be executed (e.g. for weekly backup, this should be set to 7 - * and FrequencyUnit should be set to Day) + * @param {array} [siteAuthSettings.allowedExternalRedirectUrls] External URLs + * that can be redirected to as part of logging in or logging out of the app. + * Note that the query string part of the URL is ignored. + * This is an advanced setting typically only needed by Windows Store + * application backends. + * Note that URLs within the current domain are always implicitly allowed. * - * @param {string} request.backupSchedule.frequencyUnit The unit of time for - * how often the backup should be executed (e.g. for weekly backup, this should - * be set to Day and FrequencyInterval should be set to 7). Possible values - * include: 'Day', 'Hour' + * @param {string} [siteAuthSettings.defaultProvider] The default + * authentication provider to use when multiple providers are configured. + * This setting is only needed if multiple providers are configured and the + * unauthenticated client + * action is set to "RedirectToLoginPage". Possible values include: + * 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', 'Twitter' * - * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the - * retention policy should always keep at least one backup in the storage - * account, regardless how old it is; false otherwise. + * @param {number} [siteAuthSettings.tokenRefreshExtensionHours] The number of + * hours after session token expiration that a session token can be used to + * call the token refresh API. The default is 72 hours. * - * @param {number} request.backupSchedule.retentionPeriodInDays After how many - * days backups should be deleted. + * @param {string} [siteAuthSettings.clientId] The Client ID of this relying + * party application, known as the client_id. + * This setting is required for enabling OpenID Connection authentication with + * Azure Active Directory or + * other 3rd party OpenID Connect providers. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html * - * @param {date} [request.backupSchedule.startTime] When the schedule should - * start working. + * @param {string} [siteAuthSettings.clientSecret] The Client Secret of this + * relying party application (in Azure Active Directory, this is also referred + * to as the Key). + * This setting is optional. If no client secret is configured, the OpenID + * Connect implicit auth flow is used to authenticate end users. + * Otherwise, the OpenID Connect Authorization Code Flow is used to + * authenticate end users. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html * - * @param {array} [request.databases] Databases included in the backup. + * @param {string} [siteAuthSettings.issuer] The OpenID Connect Issuer URI that + * represents the entity which issues access tokens for this application. + * When using Azure Active Directory, this value is the URI of the directory + * tenant, e.g. https://sts.windows.net/{tenant-guid}/. + * This URI is a case-sensitive identifier for the token issuer. + * More information on OpenID Connect Discovery: + * http://openid.net/specs/openid-connect-discovery-1_0.html * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. * - * @param {string} [request.kind] Kind of resource. + * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values + * to consider when validating JWTs issued by + * Azure Active Directory. Note that the ClientID value is always + * considered an + * allowed audience, regardless of this setting. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will create a backup for the production slot. + * @param {array} [siteAuthSettings.additionalLoginParams] Login parameters to + * send to the OpenID Connect authorization endpoint when + * a user logs in. Each parameter must be in the form "key=value". + * + * @param {string} [siteAuthSettings.googleClientId] The OpenID Connect Client + * ID for the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.googleClientSecret] The client secret + * associated with the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {array} [siteAuthSettings.googleOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Google Sign-In authentication. + * This setting is optional. If not specified, "openid", "profile", and "email" + * are used as default scopes. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.facebookAppId] The App ID of the Facebook + * app used for login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.facebookAppSecret] The App Secret of the + * Facebook app used for Facebook Login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {array} [siteAuthSettings.facebookOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Facebook Login authentication. + * This setting is optional. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.twitterConsumerKey] The OAuth 1.0a + * consumer key of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.twitterConsumerSecret] The OAuth 1.0a + * consumer secret of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.microsoftAccountClientId] The OAuth 2.0 + * client ID that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {string} [siteAuthSettings.microsoftAccountClientSecret] The OAuth + * 2.0 client secret that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {array} [siteAuthSettings.microsoftAccountOAuthScopes] The OAuth 2.0 + * scopes that will be requested as part of Microsoft Account authentication. + * This setting is optional. If not specified, "wl.basic" is used as the + * default scope. + * Microsoft Account Scopes and permissions documentation: + * https://msdn.microsoft.com/en-us/library/dn631845.aspx + * + * @param {string} [siteAuthSettings.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. * @@ -24673,13 +28031,13 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, 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 BackupItem} for more information. + * See {@link SiteAuthSettings} 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 _backupSlot(resourceGroupName, name, request, slot, options, callback) { +function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -24689,7 +28047,6 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -24712,8 +28069,8 @@ function _backupSlot(resourceGroupName, name, request, 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 (request === null || request === undefined) { - throw new Error('request cannot be null or undefined.'); + if (siteAuthSettings === null || siteAuthSettings === undefined) { + throw new Error('siteAuthSettings 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.'); @@ -24721,6 +28078,9 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) 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.'); } @@ -24730,20 +28090,20 @@ function _backupSlot(resourceGroupName, name, request, 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}/backup'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings'; 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(apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -24765,14 +28125,14 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) let requestContent = null; let requestModel = null; try { - if (request !== null && request !== undefined) { - let requestModelMapper = new client.models['BackupRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, request, 'request'); + if (siteAuthSettings !== null && siteAuthSettings !== undefined) { + let requestModelMapper = new client.models['SiteAuthSettings']().mapper(); + requestModel = client.serialize(requestModelMapper, siteAuthSettings, 'siteAuthSettings'); 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(siteAuthSettings, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -24792,12 +28152,13 @@ function _backupSlot(resourceGroupName, name, request, 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) { @@ -24817,7 +28178,7 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupItem']().mapper(); + let resultMapper = new client.models['SiteAuthSettings']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -24833,9 +28194,9 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) } /** - * @summary Gets existing backups of an app. + * @summary Gets the Authentication/Authorization settings of an app. * - * Gets existing backups of an app. + * Gets the Authentication/Authorization settings of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -24843,7 +28204,7 @@ function _backupSlot(resourceGroupName, name, request, 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 backups of the production slot. + * specified, the API will get the settings for the production slot. * * @param {object} [options] Optional Parameters. * @@ -24857,13 +28218,13 @@ function _backupSlot(resourceGroupName, name, request, 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 BackupItemCollection} for more information. + * See {@link SiteAuthSettings} 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 _listBackupsSlot(resourceGroupName, name, slot, options, callback) { +function _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -24873,7 +28234,6 @@ function _listBackupsSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -24902,6 +28262,9 @@ function _listBackupsSlot(resourceGroupName, name, slot, options, callback) { 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.'); } @@ -24911,20 +28274,20 @@ function _listBackupsSlot(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}/backups'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list'; 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(apiVersion)); + 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 @@ -24959,12 +28322,13 @@ function _listBackupsSlot(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) { @@ -24984,7 +28348,7 @@ function _listBackupsSlot(resourceGroupName, name, slot, 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['SiteAuthSettings']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -25000,60 +28364,52 @@ function _listBackupsSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Discovers an existing app backup that can be restored from a blob - * in Azure storage. + * @summary Updates the backup configuration of an app. * - * Discovers an existing app backup that can be restored from a blob in Azure - * storage. + * Updates the backup 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} request A RestoreRequest object that includes Azure storage - * URL and blog name for discovery of backup. - * - * @param {string} request.storageAccountUrl SAS URL to the container. - * - * @param {string} [request.blobName] Name of a blob which contains the backup. + * @param {object} request Edited backup configuration. * - * @param {boolean} request.overwrite true if the restore - * operation can overwrite target app; otherwise, false. - * true is needed if trying to restore over an existing app. + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. * - * @param {string} [request.siteName] Name of an app. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {array} [request.databases] Collection of databases which should be - * restored. This list has to match the list of databases included in the - * backup. + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. * - * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when - * restoring an app with custom domains. true to remove custom - * domains automatically. If false, custom domains are added to - * the app's object when it is being restored, but that might fail due to - * conflicts during the operation. + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) * - * @param {boolean} [request.ignoreDatabases] Ignore the databases and only - * restore the site content + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' * - * @param {string} [request.appServicePlan] Specify app service plan that will - * own restored site. + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. * - * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. * - * @param {boolean} [request.adjustConnectionStrings] true if - * SiteConfig.ConnectionStrings should be set in new app; otherwise, - * false. + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. * - * @param {string} [request.hostingEnvironment] App Service Environment name, - * if needed (only when restoring an app to an App Service Environment). + * @param {array} [request.databases] Databases included in the backup. * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will perform discovery for the production slot. + * specified, the API will update the backup configuration for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -25067,13 +28423,13 @@ function _listBackupsSlot(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 RestoreRequest} for more information. + * See {@link BackupRequest} 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 _discoverRestoreSlot(resourceGroupName, name, request, slot, options, callback) { +function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -25083,7 +28439,6 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -25115,6 +28470,9 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, options, c 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.'); } @@ -25124,13 +28482,13 @@ function _discoverRestoreSlot(resourceGroupName, name, request, 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}/backups/discover'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -25160,7 +28518,7 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, options, c let requestModel = null; try { if (request !== null && request !== undefined) { - let requestModelMapper = new client.models['RestoreRequest']().mapper(); + let requestModelMapper = new client.models['BackupRequest']().mapper(); requestModel = client.serialize(requestModelMapper, request, 'request'); requestContent = JSON.stringify(requestModel); } @@ -25186,12 +28544,13 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, options, c 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) { @@ -25211,7 +28570,7 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, options, c parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RestoreRequest']().mapper(); + let resultMapper = new client.models['BackupRequest']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -25227,19 +28586,18 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, options, c } /** - * @summary Gets a backup of an app by its ID. + * @summary Deletes the backup configuration of an app. * - * Gets a backup of an app by its ID. + * Deletes the backup 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} backupId ID of the backup. - * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get a backup of the production slot. + * specified, the API will delete the backup configuration for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -25252,14 +28610,13 @@ function _discoverRestoreSlot(resourceGroupName, name, request, 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 BackupItem} 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 _getBackupStatusSlot(resourceGroupName, name, backupId, slot, options, callback) { +function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -25269,7 +28626,6 @@ function _getBackupStatusSlot(resourceGroupName, name, backupId, slot, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -25292,15 +28648,15 @@ function _getBackupStatusSlot(resourceGroupName, name, backupId, 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 (backupId === null || backupId === undefined || typeof backupId.valueOf() !== 'string') { - throw new Error('backupId 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.'); } @@ -25310,21 +28666,20 @@ function _getBackupStatusSlot(resourceGroupName, name, backupId, 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}/backups/{backupId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -25377,42 +28732,24 @@ function _getBackupStatusSlot(resourceGroupName, name, backupId, slot, 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['BackupItem']().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 a backup of an app by its ID. + * @summary Gets the backup configuration of an app. * - * Deletes a backup of an app by its ID. + * Gets the backup 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} backupId ID of the backup. - * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete a backup of the production slot. + * specified, the API will get the backup configuration for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -25425,13 +28762,14 @@ function _getBackupStatusSlot(resourceGroupName, name, backupId, slot, options, * * {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 BackupRequest} 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 _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, callback) { +function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -25441,7 +28779,6 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -25464,15 +28801,15 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, 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 (backupId === null || backupId === undefined || typeof backupId.valueOf() !== 'string') { - throw new Error('backupId 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.'); } @@ -25482,21 +28819,20 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, 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}/backups/{backupId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -25521,7 +28857,7 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, cal 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); @@ -25531,12 +28867,13 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, cal 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) { @@ -25549,70 +28886,48 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, 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['BackupRequest']().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 status of a web app backup that may be in progress, including - * secrets associated with the backup, such as the Azure Storage SAS URL. Also - * can be used to update the SAS URL for the backup if a new URL is passed in - * the request body. + * @summary Replaces the connection strings of an app. * - * Gets status of a web app backup that may be in progress, including secrets - * associated with the backup, such as the Azure Storage SAS URL. Also can be - * used to update the SAS URL for the backup if a new URL is passed in the - * request body. + * Replaces the connection strings of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. - * - * @param {string} backupId ID of backup. - * - * @param {object} request Information on backup request. - * - * @param {string} request.backupRequestName Name of the backup. - * - * @param {boolean} [request.enabled] True if the backup schedule is enabled - * (must be included in that case), false if the backup schedule should be - * disabled. - * - * @param {string} request.storageAccountUrl SAS URL to the container. - * - * @param {object} [request.backupSchedule] Schedule for the backup if it is - * executed periodically. - * - * @param {number} request.backupSchedule.frequencyInterval How often the - * backup should be executed (e.g. for weekly backup, this should be set to 7 - * and FrequencyUnit should be set to Day) - * - * @param {string} request.backupSchedule.frequencyUnit The unit of time for - * how often the backup should be executed (e.g. for weekly backup, this should - * be set to Day and FrequencyInterval should be set to 7). Possible values - * include: 'Day', 'Hour' - * - * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the - * retention policy should always keep at least one backup in the storage - * account, regardless how old it is; false otherwise. - * - * @param {number} request.backupSchedule.retentionPeriodInDays After how many - * days backups should be deleted. - * - * @param {date} [request.backupSchedule.startTime] When the schedule should - * start working. + * @param {string} name Name of the app. * - * @param {array} [request.databases] Databases included in the backup. + * @param {object} connectionStrings Connection strings of the app or + * deployment slot. See example. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * @param {object} [connectionStrings.properties] Connection strings. * - * @param {string} [request.kind] Kind of resource. + * @param {string} [connectionStrings.kind] Kind of resource. * - * @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 update the connection settings for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -25626,13 +28941,14 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, 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 BackupItem} for more information. + * See {@link ConnectionStringDictionary} 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 _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request, slot, options, callback) { +function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -25642,7 +28958,6 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -25665,11 +28980,8 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request 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 (backupId === null || backupId === undefined || typeof backupId.valueOf() !== 'string') { - throw new Error('backupId 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 (connectionStrings === null || connectionStrings === undefined) { + throw new Error('connectionStrings 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.'); @@ -25677,6 +28989,9 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request 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.'); } @@ -25686,21 +29001,20 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -25722,14 +29036,14 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request let requestContent = null; let requestModel = null; try { - if (request !== null && request !== undefined) { - let requestModelMapper = new client.models['BackupRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, request, 'request'); + if (connectionStrings !== null && connectionStrings !== undefined) { + let requestModelMapper = new client.models['ConnectionStringDictionary']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionStrings, 'connectionStrings'); 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(connectionStrings, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -25749,12 +29063,13 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request 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) { @@ -25774,7 +29089,7 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupItem']().mapper(); + let resultMapper = new client.models['ConnectionStringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -25789,138 +29104,10 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request }); } - -/** - * @summary Restores a specific backup to another app (or deployment slot, if - * specified). - * - * Restores a specific backup to another 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} backupId ID of the backup. - * - * @param {object} request Information on restore request . - * - * @param {string} request.storageAccountUrl SAS URL to the container. - * - * @param {string} [request.blobName] Name of a blob which contains the backup. - * - * @param {boolean} request.overwrite true if the restore - * operation can overwrite target app; otherwise, false. - * true is needed if trying to restore over an existing app. - * - * @param {string} [request.siteName] Name of an app. - * - * @param {array} [request.databases] Collection of databases which should be - * restored. This list has to match the list of databases included in the - * backup. - * - * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when - * restoring an app with custom domains. true to remove custom - * domains automatically. If false, custom domains are added to - * the app's object when it is being restored, but that might fail due to - * conflicts during the operation. - * - * @param {boolean} [request.ignoreDatabases] Ignore the databases and only - * restore the site content - * - * @param {string} [request.appServicePlan] Specify app service plan that will - * own restored site. - * - * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @param {boolean} [request.adjustConnectionStrings] true if - * SiteConfig.ConnectionStrings should be set in new app; otherwise, - * false. - * - * @param {string} [request.hostingEnvironment] App Service Environment name, - * if needed (only when restoring an app to an App Service Environment). - * - * @param {string} [request.kind] Kind of resource. - * - * @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 {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 RestoreResponse} 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 _restoreSlot(resourceGroupName, name, backupId, request, 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.beginRestoreSlot(resourceGroupName, name, backupId, request, 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['RestoreResponse']().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 the configurations of an app + * @summary Gets the connection strings of an app. * - * List the configurations of an app + * Gets the connection strings of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -25928,7 +29115,7 @@ function _restoreSlot(resourceGroupName, name, backupId, request, slot, options, * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will return configuration for the production slot. + * specified, the API will get the connection settings for the production slot. * * @param {object} [options] Optional Parameters. * @@ -25942,14 +29129,14 @@ function _restoreSlot(resourceGroupName, name, backupId, request, 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 SiteConfigResourceCollection} for more + * See {@link ConnectionStringDictionary} 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 _listConfigurationsSlot(resourceGroupName, name, slot, options, callback) { +function _listConnectionStringsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -25959,7 +29146,6 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -25988,6 +29174,9 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, options, callbac 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.'); } @@ -25997,20 +29186,20 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, options, callbac // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list'; 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(apiVersion)); + 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 @@ -26045,12 +29234,13 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, options, callbac 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) { @@ -26070,7 +29260,7 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, options, callbac 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['ConnectionStringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -26086,23 +29276,17 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, options, callbac } /** - * @summary Replaces the application settings of an app. + * @summary Gets the logging configuration of an app. * - * Replaces the application settings of an app. + * Gets the logging 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} appSettings Application settings of the app. - * - * @param {object} [appSettings.properties] Settings. - * - * @param {string} [appSettings.kind] Kind of resource. - * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will update the application settings for the production + * specified, the API will get the logging configuration for the production * slot. * * @param {object} [options] Optional Parameters. @@ -26117,13 +29301,13 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, 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 StringDictionary} for more information. + * See {@link SiteLogsConfig} 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 _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, slot, options, callback) { +function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -26133,7 +29317,6 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -26156,15 +29339,15 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, 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 (appSettings === null || appSettings === undefined) { - throw new Error('appSettings 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.'); } @@ -26174,20 +29357,20 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'; 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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -26205,21 +29388,7 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (appSettings !== null && appSettings !== undefined) { - let requestModelMapper = new client.models['StringDictionary']().mapper(); - requestModel = client.serialize(requestModelMapper, appSettings, 'appSettings'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(appSettings, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -26236,12 +29405,13 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl 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) { @@ -26261,7 +29431,7 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StringDictionary']().mapper(); + let resultMapper = new client.models['SiteLogsConfig']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -26277,17 +29447,101 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl } /** - * @summary Gets the application settings of an app. + * @summary Updates the logging configuration of an app. * - * Gets the application settings of an app. + * Updates the logging 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} siteLogsConfig A SiteLogsConfig JSON object that contains + * the logging configuration to change in the "properties" property. + * + * @param {object} [siteLogsConfig.applicationLogs] Application logs + * configuration. + * + * @param {object} [siteLogsConfig.applicationLogs.fileSystem] Application logs + * to file system configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.fileSystem.level] Log level. + * Possible values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' + * + * @param {object} [siteLogsConfig.applicationLogs.azureTableStorage] + * Application logs to azure table storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureTableStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} siteLogsConfig.applicationLogs.azureTableStorage.sasUrl SAS + * URL to an Azure table with add/query/delete permissions. + * + * @param {object} [siteLogsConfig.applicationLogs.azureBlobStorage] + * Application logs to blob storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.sasUrl] SAS + * url to a azure blob container with read/write/list/delete permissions. + * + * @param {number} + * [siteLogsConfig.applicationLogs.azureBlobStorage.retentionInDays] Retention + * in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {object} [siteLogsConfig.httpLogs] HTTP logs configuration. + * + * @param {object} [siteLogsConfig.httpLogs.fileSystem] Http logs to file + * system configuration. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInMb] Maximum + * size in megabytes that http log files can use. + * When reached old log files will be removed to make space for new ones. + * Value can range between 25 and 100. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInDays] + * Retention in days. + * Remove files older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.fileSystem.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.httpLogs.azureBlobStorage] Http logs to + * azure blob storage configuration. + * + * @param {string} [siteLogsConfig.httpLogs.azureBlobStorage.sasUrl] SAS url to + * a azure blob container with read/write/list/delete permissions. + * + * @param {number} [siteLogsConfig.httpLogs.azureBlobStorage.retentionInDays] + * Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.azureBlobStorage.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.failedRequestsTracing] Failed requests + * tracing configuration. + * + * @param {object} [siteLogsConfig.detailedErrorMessages] Detailed error + * messages configuration. + * + * @param {boolean} [siteLogsConfig.detailedErrorMessages.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {string} [siteLogsConfig.kind] Kind of resource. + * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the application settings for the production + * specified, the API will update the logging configuration for the production * slot. * * @param {object} [options] Optional Parameters. @@ -26302,13 +29556,13 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, 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 StringDictionary} for more information. + * See {@link SiteLogsConfig} 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 _listApplicationSettingsSlot(resourceGroupName, name, slot, options, callback) { +function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -26318,7 +29572,6 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -26341,12 +29594,18 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, 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 (siteLogsConfig === null || siteLogsConfig === undefined) { + throw new Error('siteLogsConfig 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.'); } @@ -26356,20 +29615,20 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'; 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(apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -26387,7 +29646,21 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteLogsConfig !== null && siteLogsConfig !== undefined) { + let requestModelMapper = new client.models['SiteLogsConfig']().mapper(); + requestModel = client.serialize(requestModelMapper, siteLogsConfig, 'siteLogsConfig'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteLogsConfig, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -26404,12 +29677,13 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca 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) { @@ -26429,7 +29703,7 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StringDictionary']().mapper(); + let resultMapper = new client.models['SiteLogsConfig']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -26445,160 +29719,24 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca } /** - * @summary Updates the Authentication / Authorization settings associated with - * web app. + * @summary Replaces the metadata of an app. * - * Updates the Authentication / Authorization settings associated with web app. + * Replaces the metadata 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} siteAuthSettings Auth settings associated with web app. - * - * @param {boolean} [siteAuthSettings.enabled] true if the - * Authentication / Authorization feature is enabled for the current app; - * otherwise, false. - * - * @param {string} [siteAuthSettings.runtimeVersion] The RuntimeVersion of the - * Authentication / Authorization feature in use for the current app. - * The setting in this value can control the behavior of certain features in - * the Authentication / Authorization module. - * - * @param {string} [siteAuthSettings.unauthenticatedClientAction] The action to - * take when an unauthenticated client attempts to access the app. Possible - * values include: 'RedirectToLoginPage', 'AllowAnonymous' - * - * @param {boolean} [siteAuthSettings.tokenStoreEnabled] true to - * durably store platform-specific security tokens that are obtained during - * login flows; otherwise, false. - * The default is false. - * - * @param {array} [siteAuthSettings.allowedExternalRedirectUrls] External URLs - * that can be redirected to as part of logging in or logging out of the app. - * Note that the query string part of the URL is ignored. - * This is an advanced setting typically only needed by Windows Store - * application backends. - * Note that URLs within the current domain are always implicitly allowed. - * - * @param {string} [siteAuthSettings.defaultProvider] The default - * authentication provider to use when multiple providers are configured. - * This setting is only needed if multiple providers are configured and the - * unauthenticated client - * action is set to "RedirectToLoginPage". Possible values include: - * 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', 'Twitter' - * - * @param {number} [siteAuthSettings.tokenRefreshExtensionHours] The number of - * hours after session token expiration that a session token can be used to - * call the token refresh API. The default is 72 hours. - * - * @param {string} [siteAuthSettings.clientId] The Client ID of this relying - * party application, known as the client_id. - * This setting is required for enabling OpenID Connection authentication with - * Azure Active Directory or - * other 3rd party OpenID Connect providers. - * More information on OpenID Connect: - * http://openid.net/specs/openid-connect-core-1_0.html - * - * @param {string} [siteAuthSettings.clientSecret] The Client Secret of this - * relying party application (in Azure Active Directory, this is also referred - * to as the Key). - * This setting is optional. If no client secret is configured, the OpenID - * Connect implicit auth flow is used to authenticate end users. - * Otherwise, the OpenID Connect Authorization Code Flow is used to - * authenticate end users. - * More information on OpenID Connect: - * http://openid.net/specs/openid-connect-core-1_0.html - * - * @param {string} [siteAuthSettings.issuer] The OpenID Connect Issuer URI that - * represents the entity which issues access tokens for this application. - * When using Azure Active Directory, this value is the URI of the directory - * tenant, e.g. https://sts.windows.net/{tenant-guid}/. - * This URI is a case-sensitive identifier for the token issuer. - * More information on OpenID Connect Discovery: - * http://openid.net/specs/openid-connect-discovery-1_0.html - * - * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values - * to consider when validating JWTs issued by - * Azure Active Directory. Note that the ClientID value is always - * considered an - * allowed audience, regardless of this setting. - * - * @param {array} [siteAuthSettings.additionalLoginParams] Login parameters to - * send to the OpenID Connect authorization endpoint when - * a user logs in. Each parameter must be in the form "key=value". - * - * @param {string} [siteAuthSettings.googleClientId] The OpenID Connect Client - * ID for the Google web application. - * This setting is required for enabling Google Sign-In. - * Google Sign-In documentation: - * https://developers.google.com/identity/sign-in/web/ - * - * @param {string} [siteAuthSettings.googleClientSecret] The client secret - * associated with the Google web application. - * This setting is required for enabling Google Sign-In. - * Google Sign-In documentation: - * https://developers.google.com/identity/sign-in/web/ - * - * @param {array} [siteAuthSettings.googleOAuthScopes] The OAuth 2.0 scopes - * that will be requested as part of Google Sign-In authentication. - * This setting is optional. If not specified, "openid", "profile", and "email" - * are used as default scopes. - * Google Sign-In documentation: - * https://developers.google.com/identity/sign-in/web/ - * - * @param {string} [siteAuthSettings.facebookAppId] The App ID of the Facebook - * app used for login. - * This setting is required for enabling Facebook Login. - * Facebook Login documentation: - * https://developers.facebook.com/docs/facebook-login - * - * @param {string} [siteAuthSettings.facebookAppSecret] The App Secret of the - * Facebook app used for Facebook Login. - * This setting is required for enabling Facebook Login. - * Facebook Login documentation: - * https://developers.facebook.com/docs/facebook-login - * - * @param {array} [siteAuthSettings.facebookOAuthScopes] The OAuth 2.0 scopes - * that will be requested as part of Facebook Login authentication. - * This setting is optional. - * Facebook Login documentation: - * https://developers.facebook.com/docs/facebook-login - * - * @param {string} [siteAuthSettings.twitterConsumerKey] The OAuth 1.0a - * consumer key of the Twitter application used for sign-in. - * This setting is required for enabling Twitter Sign-In. - * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in - * - * @param {string} [siteAuthSettings.twitterConsumerSecret] The OAuth 1.0a - * consumer secret of the Twitter application used for sign-in. - * This setting is required for enabling Twitter Sign-In. - * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in - * - * @param {string} [siteAuthSettings.microsoftAccountClientId] The OAuth 2.0 - * client ID that was created for the app used for authentication. - * This setting is required for enabling Microsoft Account authentication. - * Microsoft Account OAuth documentation: - * https://dev.onedrive.com/auth/msa_oauth.htm + * @param {string} name Name of the app. * - * @param {string} [siteAuthSettings.microsoftAccountClientSecret] The OAuth - * 2.0 client secret that was created for the app used for authentication. - * This setting is required for enabling Microsoft Account authentication. - * Microsoft Account OAuth documentation: - * https://dev.onedrive.com/auth/msa_oauth.htm + * @param {object} metadata Edited metadata of the app or deployment slot. See + * example. * - * @param {array} [siteAuthSettings.microsoftAccountOAuthScopes] The OAuth 2.0 - * scopes that will be requested as part of Microsoft Account authentication. - * This setting is optional. If not specified, "wl.basic" is used as the - * default scope. - * Microsoft Account Scopes and permissions documentation: - * https://msdn.microsoft.com/en-us/library/dn631845.aspx + * @param {object} [metadata.properties] Settings. * - * @param {string} [siteAuthSettings.kind] Kind of resource. + * @param {string} [metadata.kind] Kind of resource. * - * @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 update the metadata for the production slot. * * @param {object} [options] Optional Parameters. * @@ -26612,13 +29750,13 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, 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 SiteAuthSettings} for more information. + * See {@link StringDictionary} 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 _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot, options, callback) { +function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -26628,7 +29766,6 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -26651,8 +29788,8 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, 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 (siteAuthSettings === null || siteAuthSettings === undefined) { - throw new Error('siteAuthSettings cannot be null or undefined.'); + if (metadata === null || metadata === undefined) { + throw new Error('metadata 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.'); @@ -26660,6 +29797,9 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot 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.'); } @@ -26669,13 +29809,13 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -26704,14 +29844,14 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot let requestContent = null; let requestModel = null; try { - if (siteAuthSettings !== null && siteAuthSettings !== undefined) { - let requestModelMapper = new client.models['SiteAuthSettings']().mapper(); - requestModel = client.serialize(requestModelMapper, siteAuthSettings, 'siteAuthSettings'); + if (metadata !== null && metadata !== undefined) { + let requestModelMapper = new client.models['StringDictionary']().mapper(); + requestModel = client.serialize(requestModelMapper, metadata, 'metadata'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(siteAuthSettings, null, 2)}.`); + `payload - ${JSON.stringify(metadata, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -26731,12 +29871,13 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, 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) { @@ -26756,7 +29897,7 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteAuthSettings']().mapper(); + let resultMapper = new client.models['StringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -26772,9 +29913,9 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot } /** - * @summary Gets the Authentication/Authorization settings of an app. + * @summary Gets the metadata of an app. * - * Gets the Authentication/Authorization settings of an app. + * Gets the metadata of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -26782,7 +29923,7 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot * @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 settings for the production slot. + * specified, the API will get the metadata for the production slot. * * @param {object} [options] Optional Parameters. * @@ -26796,13 +29937,13 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, 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 SiteAuthSettings} for more information. + * See {@link StringDictionary} 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 _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) { +function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -26812,7 +29953,6 @@ function _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -26841,6 +29981,9 @@ function _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) 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.'); } @@ -26850,13 +29993,13 @@ function _getAuthSettingsSlot(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}/config/authsettings/list'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -26898,12 +30041,13 @@ function _getAuthSettingsSlot(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) { @@ -26923,7 +30067,7 @@ function _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteAuthSettings']().mapper(); + let resultMapper = new client.models['StringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -26938,58 +30082,125 @@ function _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) }); } + /** - * @summary Updates the backup configuration of an app. + * @summary Gets the Git/FTP publishing credentials of an app. * - * Updates the backup configuration of an app. + * Gets the Git/FTP publishing credentials 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} request Edited backup configuration. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the publishing credentials for the production + * slot. * - * @param {string} request.backupRequestName Name of the backup. + * @param {object} [options] Optional Parameters. * - * @param {boolean} [request.enabled] True if the backup schedule is enabled - * (must be included in that case), false if the backup schedule should be - * disabled. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} request.storageAccountUrl SAS URL to the container. + * @param {function} callback - The callback. * - * @param {object} [request.backupSchedule] Schedule for the backup if it is - * executed periodically. + * @returns {function} callback(err, result, request, response) * - * @param {number} request.backupSchedule.frequencyInterval How often the - * backup should be executed (e.g. for weekly backup, this should be set to 7 - * and FrequencyUnit should be set to Day) + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} request.backupSchedule.frequencyUnit The unit of time for - * how often the backup should be executed (e.g. for weekly backup, this should - * be set to Day and FrequencyInterval should be set to 7). Possible values - * include: 'Day', 'Hour' + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link User} for more information. * - * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the - * retention policy should always keep at least one backup in the storage - * account, regardless how old it is; false otherwise. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {number} request.backupSchedule.retentionPeriodInDays After how many - * days backups should be deleted. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listPublishingCredentialsSlot(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.'); + } + + // Send request + this.beginListPublishingCredentialsSlot(resourceGroupName, name, 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['User']().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 Push settings associated with web app. * - * @param {date} [request.backupSchedule.startTime] When the schedule should - * start working. + * Updates the Push settings associated with web app. * - * @param {array} [request.databases] Databases included in the backup. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * @param {string} name Name of web app. * - * @param {string} [request.kind] Kind of resource. + * @param {object} pushSettings Push settings associated with web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will update the backup configuration for the production - * slot. + * @param {boolean} pushSettings.isPushEnabled Gets or sets a flag indicating + * whether the Push endpoint is enabled. + * + * @param {string} [pushSettings.tagWhitelistJson] Gets or sets a JSON string + * containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [pushSettings.tagsRequiringAuth] Gets or sets a JSON string + * containing a list of tags that require user authentication to be used in the + * push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [pushSettings.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [pushSettings.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. * @@ -27003,13 +30214,13 @@ function _getAuthSettingsSlot(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 BackupRequest} for more information. + * See {@link PushSettings} 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 _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, options, callback) { +function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -27019,7 +30230,6 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -27042,8 +30252,8 @@ function _updateBackupConfigurationSlot(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 (pushSettings === null || pushSettings === undefined) { + throw new Error('pushSettings 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.'); @@ -27051,6 +30261,9 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, 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.'); } @@ -27060,13 +30273,13 @@ function _updateBackupConfigurationSlot(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}/config/backup'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -27095,14 +30308,14 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, let requestContent = null; let requestModel = null; try { - if (request !== null && request !== undefined) { - let requestModelMapper = new client.models['BackupRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, request, 'request'); + if (pushSettings !== null && pushSettings !== undefined) { + let requestModelMapper = new client.models['PushSettings']().mapper(); + requestModel = client.serialize(requestModelMapper, pushSettings, 'pushSettings'); 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(pushSettings, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -27122,12 +30335,13 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, 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) { @@ -27147,7 +30361,7 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupRequest']().mapper(); + let resultMapper = new client.models['PushSettings']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -27163,18 +30377,17 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, } /** - * @summary Deletes the backup configuration of an app. + * @summary Gets the Push settings associated with web app. * - * Deletes the backup configuration of an app. + * Gets the Push settings associated with 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 delete the backup configuration 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. * @@ -27187,13 +30400,14 @@ function _updateBackupConfigurationSlot(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 PushSettings} 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 _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, callback) { +function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -27203,7 +30417,6 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -27232,6 +30445,9 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, 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.'); } @@ -27241,20 +30457,20 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, 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}/config/backup'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings/list'; 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(apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -27289,12 +30505,13 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, 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) { @@ -27307,15 +30524,32 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, 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['PushSettings']().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 backup configuration of an app. + * @summary Gets a Swift Virtual Network connection. * - * Gets the backup configuration of an app. + * Gets a Swift Virtual Network connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -27323,8 +30557,8 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, * @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 backup configuration for the production - * slot. + * specified, the API will get a gateway for the production slot's Virtual + * Network. * * @param {object} [options] Optional Parameters. * @@ -27338,13 +30572,13 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, 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 BackupRequest} for more information. + * See {@link SwiftVirtualNetwork} 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 _getBackupConfigurationSlot(resourceGroupName, name, slot, options, callback) { +function _getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -27354,7 +30588,6 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -27383,6 +30616,9 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, cal 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.'); } @@ -27392,20 +30628,20 @@ function _getBackupConfigurationSlot(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}/config/backup/list'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/virtualNetwork'; 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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -27440,12 +30676,13 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, cal 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) { @@ -27465,7 +30702,7 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupRequest']().mapper(); + let resultMapper = new client.models['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -27481,25 +30718,35 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, cal } /** - * @summary Replaces the connection strings of an app. + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. * - * Replaces the connection strings of an app. + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {object} connectionStrings Connection strings of the app or - * deployment slot. See example. + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. * - * @param {object} [connectionStrings.properties] Connection strings. + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. * - * @param {string} [connectionStrings.kind] Kind of resource. + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will update the connection settings for the production - * slot. + * specified, the API will add or update connections for the production slot. * * @param {object} [options] Optional Parameters. * @@ -27513,14 +30760,13 @@ function _getBackupConfigurationSlot(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 ConnectionStringDictionary} for more - * information. + * See {@link SwiftVirtualNetwork} 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 _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings, slot, options, callback) { +function _createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -27530,7 +30776,6 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -27553,8 +30798,8 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings 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 (connectionStrings === null || connectionStrings === undefined) { - throw new Error('connectionStrings cannot be null or undefined.'); + 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.'); @@ -27562,6 +30807,9 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings 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.'); } @@ -27571,13 +30819,13 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/virtualNetwork'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -27606,14 +30854,14 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings let requestContent = null; let requestModel = null; try { - if (connectionStrings !== null && connectionStrings !== undefined) { - let requestModelMapper = new client.models['ConnectionStringDictionary']().mapper(); - requestModel = client.serialize(requestModelMapper, connectionStrings, 'connectionStrings'); + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['SwiftVirtualNetwork']().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(connectionStrings, null, 2)}.`); + `payload - ${JSON.stringify(connectionEnvelope, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -27633,12 +30881,13 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings 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) { @@ -27658,7 +30907,7 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ConnectionStringDictionary']().mapper(); + let resultMapper = new client.models['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -27674,9 +30923,10 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings } /** - * @summary Gets the connection strings of an app. + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). * - * Gets the connection strings of an app. + * Deletes a Swift Virtual Network connection from an app (or deployment slot). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -27684,7 +30934,7 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings * @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 connection settings for the production slot. + * specified, the API will delete the connection for the production slot. * * @param {object} [options] Optional Parameters. * @@ -27697,15 +30947,13 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings * * {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 ConnectionStringDictionary} 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 _listConnectionStringsSlot(resourceGroupName, name, slot, options, callback) { +function _deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -27715,7 +30963,6 @@ function _listConnectionStringsSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -27744,6 +30991,9 @@ function _listConnectionStringsSlot(resourceGroupName, name, slot, options, call 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.'); } @@ -27753,20 +31003,20 @@ function _listConnectionStringsSlot(resourceGroupName, name, 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}/config/connectionstrings/list'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/virtualNetwork'; 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(apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -27791,7 +31041,7 @@ function _listConnectionStringsSlot(resourceGroupName, name, slot, options, call 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); @@ -27819,41 +31069,41 @@ function _listConnectionStringsSlot(resourceGroupName, name, slot, options, call // 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['ConnectionStringDictionary']().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 logging configuration of an app. + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. * - * Gets the logging configuration of an app. + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the logging configuration for the production - * slot. + * specified, the API will add or update connections for the production slot. * * @param {object} [options] Optional Parameters. * @@ -27867,13 +31117,13 @@ function _listConnectionStringsSlot(resourceGroupName, name, 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 SiteLogsConfig} for more information. + * See {@link SwiftVirtualNetwork} 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 _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, options, callback) { +function _updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -27883,7 +31133,6 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -27906,12 +31155,18 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, 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 (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.'); } 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.'); } @@ -27921,20 +31176,20 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, 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}/config/logs'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/virtualNetwork'; 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(apiVersion)); + 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 = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -27952,7 +31207,21 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, opti } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['SwiftVirtualNetwork']().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) { @@ -27963,149 +31232,67 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, opti 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['SiteLogsConfig']().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 logging configuration of an app. - * - * Updates the logging 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} siteLogsConfig A SiteLogsConfig JSON object that contains - * the logging configuration to change in the "properties" property. - * - * @param {object} [siteLogsConfig.applicationLogs] Application logs - * configuration. - * - * @param {object} [siteLogsConfig.applicationLogs.fileSystem] Application logs - * to file system configuration. - * - * @param {string} [siteLogsConfig.applicationLogs.fileSystem.level] Log level. - * Possible values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' - * - * @param {object} [siteLogsConfig.applicationLogs.azureTableStorage] - * Application logs to azure table storage configuration. - * - * @param {string} [siteLogsConfig.applicationLogs.azureTableStorage.level] Log - * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', - * 'Error' - * - * @param {string} siteLogsConfig.applicationLogs.azureTableStorage.sasUrl SAS - * URL to an Azure table with add/query/delete permissions. - * - * @param {object} [siteLogsConfig.applicationLogs.azureBlobStorage] - * Application logs to blob storage configuration. - * - * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.level] Log - * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', - * 'Error' - * - * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.sasUrl] SAS - * url to a azure blob container with read/write/list/delete permissions. - * - * @param {number} - * [siteLogsConfig.applicationLogs.azureBlobStorage.retentionInDays] Retention - * in days. - * Remove blobs older than X days. - * 0 or lower means no retention. - * - * @param {object} [siteLogsConfig.httpLogs] HTTP logs configuration. - * - * @param {object} [siteLogsConfig.httpLogs.fileSystem] Http logs to file - * system configuration. - * - * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInMb] Maximum - * size in megabytes that http log files can use. - * When reached old log files will be removed to make space for new ones. - * Value can range between 25 and 100. - * - * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInDays] - * Retention in days. - * Remove files older than X days. - * 0 or lower means no retention. - * - * @param {boolean} [siteLogsConfig.httpLogs.fileSystem.enabled] True if - * configuration is enabled, false if it is disabled and null if configuration - * is not set. - * - * @param {object} [siteLogsConfig.httpLogs.azureBlobStorage] Http logs to - * azure blob storage configuration. - * - * @param {string} [siteLogsConfig.httpLogs.azureBlobStorage.sasUrl] SAS url to - * a azure blob container with read/write/list/delete permissions. - * - * @param {number} [siteLogsConfig.httpLogs.azureBlobStorage.retentionInDays] - * Retention in days. - * Remove blobs older than X days. - * 0 or lower means no retention. - * - * @param {boolean} [siteLogsConfig.httpLogs.azureBlobStorage.enabled] True if - * configuration is enabled, false if it is disabled and null if configuration - * is not set. - * - * @param {object} [siteLogsConfig.failedRequestsTracing] Failed requests - * tracing configuration. + 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['SwiftVirtualNetwork']().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 configuration of an app, such as platform version and + * bitness, default documents, virtual applications, Always On, etc. * - * @param {object} [siteLogsConfig.detailedErrorMessages] Detailed error - * messages configuration. + * Gets the configuration of an app, such as platform version and bitness, + * default documents, virtual applications, Always On, etc. * - * @param {boolean} [siteLogsConfig.detailedErrorMessages.enabled] True if - * configuration is enabled, false if it is disabled and null if configuration - * is not set. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} [siteLogsConfig.kind] Kind of resource. + * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will update the logging configuration for the production - * slot. + * specified, the API will return configuration for the production slot. * * @param {object} [options] Optional Parameters. * @@ -28119,13 +31306,13 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, 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 SiteLogsConfig} for more information. + * See {@link SiteConfigResource} 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 _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig, slot, options, callback) { +function _getConfigurationSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -28135,7 +31322,6 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -28158,15 +31344,15 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig 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 (siteLogsConfig === null || siteLogsConfig === undefined) { - throw new Error('siteLogsConfig 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.'); } @@ -28176,20 +31362,20 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -28207,21 +31393,7 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (siteLogsConfig !== null && siteLogsConfig !== undefined) { - let requestModelMapper = new client.models['SiteLogsConfig']().mapper(); - requestModel = client.serialize(requestModelMapper, siteLogsConfig, 'siteLogsConfig'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(siteLogsConfig, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -28238,12 +31410,13 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig 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) { @@ -28263,7 +31436,7 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteLogsConfig']().mapper(); + let resultMapper = new client.models['SiteConfigResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -28279,24 +31452,238 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig } /** - * @summary Replaces the metadata of an app. + * @summary Updates the configuration of an app. * - * Replaces the metadata of an app. + * Updates the 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} metadata Edited metadata of the app or deployment slot. See + * @param {object} siteConfig JSON representation of a SiteConfig object. See * example. * - * @param {object} [metadata.properties] Settings. + * @param {number} [siteConfig.numberOfWorkers] Number of workers. * - * @param {string} [metadata.kind] Kind of resource. + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will update the metadata for the production slot. + * specified, the API will update configuration for the production slot. * * @param {object} [options] Optional Parameters. * @@ -28310,13 +31697,13 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig * {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 StringDictionary} for more information. + * See {@link SiteConfigResource} 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 _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, callback) { +function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -28326,7 +31713,6 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -28349,8 +31735,8 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, 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 (metadata === null || metadata === undefined) { - throw new Error('metadata cannot be null or undefined.'); + if (siteConfig === null || siteConfig === undefined) { + throw new Error('siteConfig 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.'); @@ -28358,6 +31744,9 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c 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.'); } @@ -28367,13 +31756,13 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, 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}/config/metadata'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -28402,14 +31791,14 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c let requestContent = null; let requestModel = null; try { - if (metadata !== null && metadata !== undefined) { - let requestModelMapper = new client.models['StringDictionary']().mapper(); - requestModel = client.serialize(requestModelMapper, metadata, 'metadata'); + if (siteConfig !== null && siteConfig !== undefined) { + let requestModelMapper = new client.models['SiteConfigResource']().mapper(); + requestModel = client.serialize(requestModelMapper, siteConfig, 'siteConfig'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(metadata, null, 2)}.`); + `payload - ${JSON.stringify(siteConfig, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -28429,12 +31818,13 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c 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) { @@ -28454,7 +31844,7 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StringDictionary']().mapper(); + let resultMapper = new client.models['SiteConfigResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -28470,17 +31860,238 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c } /** - * @summary Gets the metadata of an app. + * @summary Updates the configuration of an app. + * + * Updates the 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} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. * - * Gets the metadata of an app. + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. * - * @param {string} name Name of the app. + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the metadata for the production slot. + * specified, the API will update configuration for the production slot. * * @param {object} [options] Optional Parameters. * @@ -28494,13 +32105,13 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, 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 StringDictionary} for more information. + * See {@link SiteConfigResource} 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 _listMetadataSlot(resourceGroupName, name, slot, options, callback) { +function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -28510,7 +32121,6 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -28533,12 +32143,18 @@ function _listMetadataSlot(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 (siteConfig === null || siteConfig === undefined) { + throw new Error('siteConfig 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.'); } @@ -28548,20 +32164,20 @@ function _listMetadataSlot(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}/config/metadata/list'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/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(apiVersion)); + 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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -28579,7 +32195,21 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteConfig !== null && siteConfig !== undefined) { + let requestModelMapper = new client.models['SiteConfigResource']().mapper(); + requestModel = client.serialize(requestModelMapper, siteConfig, 'siteConfig'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteConfig, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -28596,12 +32226,13 @@ function _listMetadataSlot(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) { @@ -28621,7 +32252,7 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StringDictionary']().mapper(); + let resultMapper = new client.models['SiteConfigResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -28636,11 +32267,12 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { }); } - /** - * @summary Gets the Git/FTP publishing credentials of an app. + * @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 the Git/FTP publishing credentials 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. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -28648,113 +32280,7 @@ function _listMetadataSlot(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 the publishing credentials 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 User} 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 _listPublishingCredentialsSlot(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.'); - } - - // Send request - this.beginListPublishingCredentialsSlot(resourceGroupName, name, 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['User']().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 Push settings associated with web app. - * - * Updates the Push settings associated with web app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} pushSettings Push settings associated with web app. - * - * @param {boolean} pushSettings.isPushEnabled Gets or sets a flag indicating - * whether the Push endpoint is enabled. - * - * @param {string} [pushSettings.tagWhitelistJson] Gets or sets a JSON string - * containing a list of tags that are whitelisted for use by the push - * registration endpoint. - * - * @param {string} [pushSettings.tagsRequiringAuth] Gets or sets a JSON string - * containing a list of tags that require user authentication to be used in the - * push registration endpoint. - * Tags can consist of alphanumeric characters and the following: - * '_', '@', '#', '.', ':', '-'. - * Validation should be performed at the PushRequestHandler. - * - * @param {string} [pushSettings.dynamicTagsJson] Gets or sets a JSON string - * containing a list of dynamic tags that will be evaluated from user claims in - * the push registration endpoint. - * - * @param {string} [pushSettings.kind] Kind of resource. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * specified, the API will return configuration for the production slot. * * @param {object} [options] Optional Parameters. * @@ -28768,13 +32294,14 @@ function _listPublishingCredentialsSlot(resourceGroupName, name, 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 PushSettings} 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 _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, callback) { +function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -28784,7 +32311,6 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -28807,15 +32333,15 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, 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 (pushSettings === null || pushSettings === undefined) { - throw new Error('pushSettings 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.'); } @@ -28825,20 +32351,20 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots'; 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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -28856,21 +32382,7 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (pushSettings !== null && pushSettings !== undefined) { - let requestModelMapper = new client.models['PushSettings']().mapper(); - requestModel = client.serialize(requestModelMapper, pushSettings, 'pushSettings'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(pushSettings, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -28887,12 +32399,13 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, 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) { @@ -28912,7 +32425,7 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PushSettings']().mapper(); + let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -28928,17 +32441,20 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot } /** - * @summary Gets the Push settings associated with web app. + * @summary Gets a snapshot of the configuration of an app at a previous point + * in time. * - * Gets the Push settings associated with web app. + * Gets a snapshot of the configuration of an app at a previous point in time. * * @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} snapshotId The ID of the snapshot to read. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. * * @param {object} [options] Optional Parameters. * @@ -28952,13 +32468,13 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, 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 PushSettings} for more information. + * See {@link SiteConfigResource} 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 _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callback) { +function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -28968,7 +32484,6 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -28991,12 +32506,18 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, 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 (snapshotId === null || snapshotId === undefined || typeof snapshotId.valueOf() !== 'string') { + throw new Error('snapshotId 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.'); } @@ -29006,20 +32527,21 @@ function _listSitePushSettingsSlot(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}/config/pushsettings/list'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{snapshotId}', encodeURIComponent(snapshotId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -29054,12 +32576,13 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, 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) { @@ -29079,7 +32602,7 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callb parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PushSettings']().mapper(); + let resultMapper = new client.models['SiteConfigResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -29095,17 +32618,17 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callb } /** - * @summary Gets the configuration of an app, such as platform version and - * bitness, default documents, virtual applications, Always On, etc. + * @summary Reverts the configuration of an app to a previous snapshot. * - * Gets the configuration of an app, such as platform version and bitness, - * default documents, virtual applications, Always On, etc. + * Reverts the configuration of an app to a previous snapshot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * + * @param {string} snapshotId The ID of the snapshot to read. + * * @param {string} slot Name of the deployment slot. If a slot is not * specified, the API will return configuration for the production slot. * @@ -29120,14 +32643,13 @@ function _listSitePushSettingsSlot(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 SiteConfigResource} 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 _getConfigurationSlot(resourceGroupName, name, slot, options, callback) { +function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -29137,7 +32659,6 @@ function _getConfigurationSlot(resourceGroupName, name, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -29160,12 +32681,18 @@ function _getConfigurationSlot(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 (snapshotId === null || snapshotId === undefined || typeof snapshotId.valueOf() !== 'string') { + throw new Error('snapshotId 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.'); } @@ -29175,20 +32702,21 @@ function _getConfigurationSlot(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}/config/web'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}/recover'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{snapshotId}', encodeURIComponent(snapshotId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 @@ -29213,7 +32741,7 @@ function _getConfigurationSlot(resourceGroupName, name, slot, 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); @@ -29238,248 +32766,26 @@ function _getConfigurationSlot(resourceGroupName, name, slot, options, callback) } 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['SiteConfigResource']().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 configuration of an app. - * - * Updates the 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} siteConfig JSON representation of a SiteConfig object. See - * example. - * - * @param {number} [siteConfig.numberOfWorkers] Number of workers. - * - * @param {array} [siteConfig.defaultDocuments] Default documents. - * - * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. - * - * @param {string} [siteConfig.phpVersion] Version of PHP. - * - * @param {string} [siteConfig.pythonVersion] Version of Python. - * - * @param {string} [siteConfig.nodeVersion] Version of Node.js. - * - * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version - * - * @param {boolean} [siteConfig.requestTracingEnabled] true if - * request tracing is enabled; otherwise, false. - * - * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing - * expiration time. - * - * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if - * remote debugging is enabled; otherwise, false. - * - * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging - * version. - * - * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP - * logging is enabled; otherwise, false. - * - * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size - * limit. - * - * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true - * if detailed error logging is enabled; otherwise, false. - * - * @param {string} [siteConfig.publishingUsername] Publishing user name. - * - * @param {array} [siteConfig.appSettings] Application settings. - * - * @param {array} [siteConfig.connectionStrings] Connection strings. - * - * @param {array} [siteConfig.handlerMappings] Handler mappings. - * - * @param {string} [siteConfig.documentRoot] Document root. - * - * @param {string} [siteConfig.scmType] SCM type. Possible values include: - * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', - * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', - * 'VSO' - * - * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use - * 32-bit worker process; otherwise, false. - * - * @param {boolean} [siteConfig.webSocketsEnabled] true if - * WebSocket is enabled; otherwise, false. - * - * @param {boolean} [siteConfig.alwaysOn] true if Always On is - * enabled; otherwise, false. - * - * @param {string} [siteConfig.javaVersion] Java version. - * - * @param {string} [siteConfig.javaContainer] Java container. - * - * @param {string} [siteConfig.javaContainerVersion] Java container version. - * - * @param {string} [siteConfig.appCommandLine] App command line to launch. - * - * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. - * Possible values include: 'Integrated', 'Classic' - * - * @param {array} [siteConfig.virtualApplications] Virtual applications. - * - * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible - * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', - * 'WeightedTotalTraffic', 'RequestHash' - * - * @param {object} [siteConfig.experiments] This is work around for polymophic - * types. - * - * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. - * - * @param {object} [siteConfig.limits] Site limits. - * - * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU - * usage percentage. - * - * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory - * usage in MB. - * - * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk - * size usage in MB. - * - * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal - * is enabled; otherwise, false. - * - * @param {object} [siteConfig.autoHealRules] Auto Heal rules. - * - * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe - * when to execute the auto-heal actions. - * - * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on - * total requests. - * - * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request - * Count. - * - * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] - * Time interval. - * - * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule - * based on private bytes. - * - * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based - * on status codes. - * - * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule - * based on request execution time. - * - * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] - * Time taken. - * - * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] - * Request Count. - * - * @param {string} - * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. - * - * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed - * when a rule is triggered. - * - * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined - * action to be taken. Possible values include: 'Recycle', 'LogEvent', - * 'CustomAction' - * - * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom - * action to be taken. - * - * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] - * Executable to be run. - * - * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] - * Parameters for the executable. - * - * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] - * Minimum time the process must execute - * before taking the action - * - * @param {string} [siteConfig.tracingOptions] Tracing options. - * - * @param {string} [siteConfig.vnetName] Virtual Network name. - * - * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) - * settings. - * - * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of - * origins that should be allowed to make cross-origin - * calls (for example: http://example.com:12345). Use "*" to allow all. - * - * @param {object} [siteConfig.push] Push endpoint settings. - * - * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag - * indicating whether the Push endpoint is enabled. - * - * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON - * string containing a list of tags that are whitelisted for use by the push - * registration endpoint. - * - * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON - * string containing a list of tags that require user authentication to be used - * in the push registration endpoint. - * Tags can consist of alphanumeric characters and the following: - * '_', '@', '#', '.', ':', '-'. - * Validation should be performed at the PushRequestHandler. - * - * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string - * containing a list of dynamic tags that will be evaluated from user claims in - * the push registration endpoint. - * - * @param {string} [siteConfig.push.kind] Kind of resource. - * - * @param {object} [siteConfig.apiDefinition] Information about the formal API - * definition for the app. - * - * @param {string} [siteConfig.apiDefinition.url] The URL of the API - * definition. - * - * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. - * - * @param {boolean} [siteConfig.localMySqlEnabled] true to enable - * local MySQL; otherwise, false. - * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets the last lines of docker logs for the given site * - * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web - * site to allow clients to connect over http2.0 + * Gets the last lines of docker logs for the given site * - * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the - * minimum version of TLS required for SSL requests. Possible values include: - * '1.0', '1.1', '1.2' + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} [siteConfig.kind] Kind of resource. + * @param {string} name Name of web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will update configuration 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. * @@ -29493,13 +32799,12 @@ function _getConfigurationSlot(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 SiteConfigResource} 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 _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, slot, options, callback) { +function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -29509,7 +32814,6 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -29532,15 +32836,15 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s 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 (siteConfig === null || siteConfig === undefined) { - throw new Error('siteConfig 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.'); } @@ -29550,20 +32854,20 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs'; 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(apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -29581,36 +32885,24 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (siteConfig !== null && siteConfig !== undefined) { - let requestModelMapper = new client.models['SiteConfigResource']().mapper(); - requestModel = client.serialize(requestModelMapper, siteConfig, 'siteConfig'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(siteConfig, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + 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) { - let error = new Error(responseBody); + if (statusCode !== 200 && statusCode !== 204) { + 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; @@ -29627,248 +32919,177 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s } 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['SiteConfigResource']().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 Updates the configuration of an app. + * @summary Gets the ZIP archived docker log files for the given site * - * Updates the configuration of an app. + * Gets the ZIP archived docker log files for the given site * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {object} siteConfig JSON representation of a SiteConfig object. See - * example. - * - * @param {number} [siteConfig.numberOfWorkers] Number of workers. - * - * @param {array} [siteConfig.defaultDocuments] Default documents. - * - * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. - * - * @param {string} [siteConfig.phpVersion] Version of PHP. - * - * @param {string} [siteConfig.pythonVersion] Version of Python. - * - * @param {string} [siteConfig.nodeVersion] Version of Node.js. - * - * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version - * - * @param {boolean} [siteConfig.requestTracingEnabled] true if - * request tracing is enabled; otherwise, false. - * - * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing - * expiration time. - * - * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if - * remote debugging is enabled; otherwise, false. - * - * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging - * version. - * - * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP - * logging is enabled; otherwise, false. - * - * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size - * limit. - * - * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true - * if detailed error logging is enabled; otherwise, false. - * - * @param {string} [siteConfig.publishingUsername] Publishing user name. - * - * @param {array} [siteConfig.appSettings] Application settings. - * - * @param {array} [siteConfig.connectionStrings] Connection strings. - * - * @param {array} [siteConfig.handlerMappings] Handler mappings. - * - * @param {string} [siteConfig.documentRoot] Document root. - * - * @param {string} [siteConfig.scmType] SCM type. Possible values include: - * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', - * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', - * 'VSO' - * - * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use - * 32-bit worker process; otherwise, false. - * - * @param {boolean} [siteConfig.webSocketsEnabled] true if - * WebSocket is enabled; otherwise, false. - * - * @param {boolean} [siteConfig.alwaysOn] true if Always On is - * enabled; otherwise, false. - * - * @param {string} [siteConfig.javaVersion] Java version. - * - * @param {string} [siteConfig.javaContainer] Java container. - * - * @param {string} [siteConfig.javaContainerVersion] Java container version. - * - * @param {string} [siteConfig.appCommandLine] App command line to launch. - * - * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. - * Possible values include: 'Integrated', 'Classic' - * - * @param {array} [siteConfig.virtualApplications] Virtual applications. - * - * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible - * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', - * 'WeightedTotalTraffic', 'RequestHash' - * - * @param {object} [siteConfig.experiments] This is work around for polymophic - * types. - * - * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. - * - * @param {object} [siteConfig.limits] Site limits. - * - * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU - * usage percentage. - * - * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory - * usage in MB. - * - * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk - * size usage in MB. - * - * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal - * is enabled; otherwise, false. - * - * @param {object} [siteConfig.autoHealRules] Auto Heal rules. - * - * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe - * when to execute the auto-heal actions. - * - * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on - * total requests. - * - * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request - * Count. - * - * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] - * Time interval. - * - * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule - * based on private bytes. - * - * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based - * on status codes. - * - * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule - * based on request execution time. - * - * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] - * Time taken. - * - * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] - * Request Count. - * - * @param {string} - * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. - * - * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed - * when a rule is triggered. - * - * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined - * action to be taken. Possible values include: 'Recycle', 'LogEvent', - * 'CustomAction' - * - * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom - * action to be taken. - * - * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] - * Executable to be run. - * - * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] - * Parameters for the executable. - * - * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] - * Minimum time the process must execute - * before taking the action - * - * @param {string} [siteConfig.tracingOptions] Tracing options. - * - * @param {string} [siteConfig.vnetName] Virtual Network name. - * - * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) - * settings. - * - * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of - * origins that should be allowed to make cross-origin - * calls (for example: http://example.com:12345). Use "*" to allow all. - * - * @param {object} [siteConfig.push] Push endpoint settings. - * - * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag - * indicating whether the Push endpoint is enabled. + * @param {string} name Name of web app. * - * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON - * string containing a list of tags that are whitelisted for use by the push - * registration endpoint. + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. * - * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON - * string containing a list of tags that require user authentication to be used - * in the push registration endpoint. - * Tags can consist of alphanumeric characters and the following: - * '_', '@', '#', '.', ':', '-'. - * Validation should be performed at the PushRequestHandler. + * @param {object} [options] Optional Parameters. * - * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string - * containing a list of dynamic tags that will be evaluated from user claims in - * the push registration endpoint. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [siteConfig.push.kind] Kind of resource. + * @param {function} callback - The callback. * - * @param {object} [siteConfig.apiDefinition] Information about the formal API - * definition for the app. + * @returns {function} callback(err, result, request, response) * - * @param {string} [siteConfig.apiDefinition.url] The URL of the API - * definition. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * {object} [result] - The deserialized result object if an error did not occur. * - * @param {boolean} [siteConfig.localMySqlEnabled] true to enable - * local MySQL; otherwise, false. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getContainerLogsZipSlot(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}/containerlogs/zip/download'; + 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 + httpRequest.streamedResponse = true; + 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(`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) { + 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 = response; + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List continuous web jobs for an app, or a deployment slot. * - * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web - * site to allow clients to connect over http2.0 + * List continuous web jobs for an app, or a deployment slot. * - * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the - * minimum version of TLS required for SSL requests. Possible values include: - * '1.0', '1.1', '1.2' + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} [siteConfig.kind] Kind of resource. + * @param {string} name Site name. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will update configuration for the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -29882,13 +33103,14 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s * {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 SiteConfigResource} 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 _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, options, callback) { +function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -29898,7 +33120,6 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -29921,15 +33142,15 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt 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 (siteConfig === null || siteConfig === undefined) { - throw new Error('siteConfig 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.'); } @@ -29939,20 +33160,20 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs'; 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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -29970,21 +33191,7 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (siteConfig !== null && siteConfig !== undefined) { - let requestModelMapper = new client.models['SiteConfigResource']().mapper(); - requestModel = client.serialize(requestModelMapper, siteConfig, 'siteConfig'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(siteConfig, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -30001,12 +33208,13 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt 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) { @@ -30026,7 +33234,7 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigResource']().mapper(); + let resultMapper = new client.models['ContinuousWebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -30042,19 +33250,20 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt } /** - * @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 Gets a continuous web job by its ID 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. + * Gets a continuous 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 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 return configuration for the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -30068,14 +33277,13 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt * {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 ContinuousWebJob} 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 _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, options, callback) { +function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30085,7 +33293,6 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30108,12 +33315,18 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio 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.'); } @@ -30123,13 +33336,14 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, 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}/config/web/snapshots'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -30161,7 +33375,7 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio 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); @@ -30196,7 +33410,7 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio 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['ContinuousWebJob']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -30212,20 +33426,20 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio } /** - * @summary Gets a snapshot of the configuration of an app at a previous point - * in time. + * @summary Delete a continuous web job by its ID for an app, or a deployment + * slot. * - * Gets a snapshot of the configuration of an app at a previous point in time. + * Delete a continuous 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 Name of the app. + * @param {string} name Site name. * - * @param {string} snapshotId The ID of the snapshot to read. + * @param {string} webJobName Name of Web Job. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will return configuration for the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -30238,14 +33452,13 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, 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 SiteConfigResource} 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 _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, options, callback) { +function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30255,7 +33468,6 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30278,8 +33490,8 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, 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 (snapshotId === null || snapshotId === undefined || typeof snapshotId.valueOf() !== 'string') { - throw new Error('snapshotId 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.'); @@ -30287,6 +33499,9 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot 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.'); } @@ -30296,21 +33511,21 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{snapshotId}', encodeURIComponent(snapshotId)); + 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(apiVersion)); + 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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -30335,7 +33550,7 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot 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); @@ -30363,42 +33578,25 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, 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['SiteConfigResource']().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 Reverts the configuration of an app to a previous snapshot. + * @summary Start a continuous web job for an app, or a deployment slot. * - * Reverts the configuration of an app to a previous snapshot. + * Start a continuous 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} snapshotId The ID of the snapshot to read. + * @param {string} webJobName Name of Web Job. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will return configuration for the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -30417,7 +33615,7 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, options, callback) { +function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30427,7 +33625,6 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30450,8 +33647,8 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot 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 (snapshotId === null || snapshotId === undefined || typeof snapshotId.valueOf() !== 'string') { - throw new Error('snapshotId 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.'); @@ -30459,6 +33656,9 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot 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.'); } @@ -30468,14 +33668,14 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}/recover'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/start'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{snapshotId}', encodeURIComponent(snapshotId)); + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -30507,7 +33707,7 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -30541,17 +33741,19 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot } /** - * @summary Gets the last lines of docker logs for the given site + * @summary Stop a continuous web job for an app, or a deployment slot. * - * Gets the last lines of docker logs for the given site + * Stop a continuous 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 web app. + * @param {string} name Site name. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -30564,13 +33766,13 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [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 _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, callback) { +function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30580,7 +33782,6 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30603,12 +33804,18 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, 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 (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.'); } @@ -30618,13 +33825,14 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/stop'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -30651,22 +33859,20 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, ca } 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 !== 204) { - let error = new Error(`Unexpected status code: ${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 { - 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; @@ -30683,25 +33889,26 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, ca } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + return callback(null, result, httpRequest, response); }); } /** - * @summary Gets the ZIP archived docker log files for the given site + * @summary List deployments for an app, or a deployment slot. * - * Gets the ZIP archived docker log files for the given site + * List deployments 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 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 returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -30715,12 +33922,13 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, 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 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 _getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, callback) { +function _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30730,7 +33938,6 @@ function _getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30759,6 +33966,9 @@ function _getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, 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.'); } @@ -30768,20 +33978,20 @@ function _getWebSiteContainerLogsZipSlot(resourceGroupName, name, 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}/containerlogs/zip/download'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments'; 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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -30801,29 +34011,28 @@ function _getWebSiteContainerLogsZipSlot(resourceGroupName, name, 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 !== 204) { - let error = new Error(`Unexpected status code: ${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 { - 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; - 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) { @@ -30833,25 +34042,45 @@ function _getWebSiteContainerLogsZipSlot(resourceGroupName, name, 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['DeploymentCollection']().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 continuous web jobs for an app, or a deployment slot. + * @summary Get a deployment by its ID for an app, or a deployment slot. * - * List continuous web jobs for an app, or a deployment slot. + * Get a deployment 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} name Name of the app. + * + * @param {string} id Deployment ID. * * @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 gets a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -30865,14 +34094,13 @@ function _getWebSiteContainerLogsZipSlot(resourceGroupName, name, 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 ContinuousWebJobCollection} for more - * information. + * See {@link Deployment} 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 _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, callback) { +function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30882,7 +34110,6 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30905,12 +34132,18 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, 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 (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.'); } 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.'); } @@ -30920,13 +34153,14 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, 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}/continuouswebjobs'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -30968,12 +34202,13 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, 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) { @@ -30993,7 +34228,7 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, call 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['Deployment']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -31009,20 +34244,42 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, call } /** - * @summary Gets a continuous web job by its ID for an app, or a deployment - * slot. + * @summary Create a deployment for an app, or a deployment slot. * - * Gets a continuous web job by its ID for an app, or a deployment slot. + * Create a deployment 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} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @param {string} id ID of an existing deployment. * * @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 creates a deployment for the production slot. + * + * @param {object} deployment Deployment details. + * + * @param {number} [deployment.status] Deployment status. + * + * @param {string} [deployment.message] Details about deployment status. + * + * @param {string} [deployment.author] Who authored the deployment. + * + * @param {string} [deployment.deployer] Who performed the deployment. + * + * @param {string} [deployment.authorEmail] Author email. + * + * @param {date} [deployment.startTime] Start time. + * + * @param {date} [deployment.endTime] End time. + * + * @param {boolean} [deployment.active] True if deployment is currently active, + * false if completed and null if not started. + * + * @param {string} [deployment.details] Details on deployment. + * + * @param {string} [deployment.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -31036,13 +34293,13 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, 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 ContinuousWebJob} for more information. + * See {@link Deployment} 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 _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31052,7 +34309,6 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31075,15 +34331,21 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt 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 (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.'); } + if (deployment === null || deployment === undefined) { + throw new Error('deployment 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.'); } @@ -31093,21 +34355,21 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -31125,14 +34387,28 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (deployment !== null && deployment !== undefined) { + let requestModelMapper = new client.models['Deployment']().mapper(); + requestModel = client.serialize(requestModelMapper, deployment, 'deployment'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(deployment, 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); @@ -31142,12 +34418,13 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt 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) { @@ -31167,7 +34444,7 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ContinuousWebJob']().mapper(); + let resultMapper = new client.models['Deployment']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -31183,17 +34460,16 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt } /** - * @summary Delete a continuous web job by its ID for an app, or a deployment - * slot. + * @summary Delete a deployment by its ID for an app, or a deployment slot. * - * Delete a continuous web job by its ID for an app, or a deployment slot. + * Delete a deployment 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} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @param {string} id Deployment ID. * * @param {string} slot Name of the deployment slot. If a slot is not * specified, the API deletes a deployment for the production slot. @@ -31215,7 +34491,7 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31225,7 +34501,6 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31248,8 +34523,8 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, 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 (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.'); @@ -31257,6 +34532,9 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, 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.'); } @@ -31266,14 +34544,14 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -31339,19 +34617,23 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, } /** - * @summary Start a continuous web job for an app, or a deployment slot. + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. * - * Start a continuous web job for an app, or a deployment slot. + * List deployment log for specific deployment 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} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @param {string} id The ID of a specific deployment. This is the value of the + * name property in the JSON response from "GET + * /api/sites/{siteName}/deployments". * * @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 returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -31364,13 +34646,14 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, 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 Deployment} 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 _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31380,7 +34663,6 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31403,8 +34685,8 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, 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 (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.'); @@ -31412,6 +34694,9 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, o 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.'); } @@ -31421,21 +34706,21 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, 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}/continuouswebjobs/{webJobName}/start'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log'; 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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -31460,7 +34745,7 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, o 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); @@ -31470,12 +34755,13 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, 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) { @@ -31488,25 +34774,84 @@ function _startContinuousWebJobSlot(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['Deployment']().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 Stop a continuous web job for an app, or a deployment slot. + * @summary Discovers an existing app backup that can be restored from a blob + * in Azure storage. Use this to get information about the databases stored in + * a backup. * - * Stop a continuous web job for an app, or a deployment slot. + * Discovers an existing app backup that can be restored from a blob in Azure + * storage. Use this to get information about the databases stored in a backup. * * @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 Web Job. + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.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 perform discovery for the production slot. * * @param {object} [options] Optional Parameters. * @@ -31519,13 +34864,14 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, o * * {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 RestoreRequest} 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 _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _discoverBackupSlot(resourceGroupName, name, request, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31535,7 +34881,6 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31558,8 +34903,8 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op 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 (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.'); @@ -31567,6 +34912,9 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op 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.'); } @@ -31576,14 +34924,13 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/stop'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -31608,14 +34955,28 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op } } } - httpRequest.body = null; + // 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 !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -31625,12 +34986,13 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op 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) { @@ -31643,15 +35005,32 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op // 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['RestoreRequest']().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 deployments for an app, or a deployment slot. + * @summary Lists ownership identifiers for domain associated with web app. * - * List deployments for an app, or a deployment slot. + * Lists ownership identifiers for domain associated with web app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -31659,7 +35038,7 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op * @param {string} name Name of the app. * * @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 delete the binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -31673,13 +35052,13 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op * {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 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 _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) { +function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31689,7 +35068,6 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31718,6 +35096,9 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) 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.'); } @@ -31727,13 +35108,13 @@ function _listDeploymentsSlot(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}/deployments'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -31775,12 +35156,13 @@ function _listDeploymentsSlot(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) { @@ -31800,7 +35182,7 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, 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['IdentifierCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -31816,19 +35198,20 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) } /** - * @summary Get a deployment by its ID for an app, or a deployment slot. + * @summary Get domain ownership identifier for web app. * - * Get a deployment by its ID for an app, or a deployment slot. + * Get domain ownership identifier 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} id Deployment ID. + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API gets a deployment for the production slot. + * specified, the API will delete the binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -31842,13 +35225,13 @@ function _listDeploymentsSlot(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 Deployment} for more information. + * See {@link Identifier} 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 _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback) { +function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31858,7 +35241,6 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31881,8 +35263,8 @@ function _getDeploymentSlot(resourceGroupName, name, id, 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 (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 (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { + throw new Error('domainOwnershipIdentifierName 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.'); @@ -31890,6 +35272,9 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback 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.'); } @@ -31899,14 +35284,14 @@ function _getDeploymentSlot(resourceGroupName, name, id, 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}/deployments/{id}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -31948,12 +35333,13 @@ function _getDeploymentSlot(resourceGroupName, name, id, 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) { @@ -31973,7 +35359,7 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Deployment']().mapper(); + let resultMapper = new client.models['Identifier']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -31989,44 +35375,30 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback } /** - * @summary Create a deployment for an app, or a deployment slot. + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. * - * Create a deployment for an app, or a deployment slot. + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} id ID of an existing deployment. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API creates a deployment for the production slot. - * - * @param {object} deployment Deployment details. - * - * @param {string} [deployment.deploymentId] Identifier for deployment. - * - * @param {number} [deployment.status] Deployment status. - * - * @param {string} [deployment.message] Details about deployment status. - * - * @param {string} [deployment.author] Who authored the deployment. - * - * @param {string} [deployment.deployer] Who performed the deployment. - * - * @param {string} [deployment.authorEmail] Author email. - * - * @param {date} [deployment.startTime] Start time. + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. * - * @param {date} [deployment.endTime] End time. + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. * - * @param {boolean} [deployment.active] True if deployment is currently active, - * false if completed and null if not started. + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. * - * @param {string} [deployment.details] Details on deployment. + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. * - * @param {string} [deployment.kind] Kind of resource. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -32040,13 +35412,13 @@ function _getDeploymentSlot(resourceGroupName, name, id, 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 Deployment} for more information. + * See {@link Identifier} 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 _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, options, callback) { +function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -32056,7 +35428,6 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32079,18 +35450,21 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op 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 (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 (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { + throw new Error('domainOwnershipIdentifierName cannot be null or undefined and it must be of type string.'); + } + if (domainOwnershipIdentifier === null || domainOwnershipIdentifier === undefined) { + throw new Error('domainOwnershipIdentifier 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 (deployment === null || deployment === undefined) { - throw new Error('deployment 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.'); } @@ -32100,14 +35474,14 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -32136,14 +35510,14 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op let requestContent = null; let requestModel = null; try { - if (deployment !== null && deployment !== undefined) { - let requestModelMapper = new client.models['Deployment']().mapper(); - requestModel = client.serialize(requestModelMapper, deployment, 'deployment'); + if (domainOwnershipIdentifier !== null && domainOwnershipIdentifier !== undefined) { + let requestModelMapper = new client.models['Identifier']().mapper(); + requestModel = client.serialize(requestModelMapper, domainOwnershipIdentifier, 'domainOwnershipIdentifier'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(deployment, null, 2)}.`); + `payload - ${JSON.stringify(domainOwnershipIdentifier, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -32163,12 +35537,13 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op 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) { @@ -32188,7 +35563,7 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Deployment']().mapper(); + let resultMapper = new client.models['Identifier']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -32204,19 +35579,20 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op } /** - * @summary Delete a deployment by its ID for an app, or a deployment slot. + * @summary Deletes a domain ownership identifier for a web app. * - * Delete a deployment by its ID for an app, or a deployment slot. + * Deletes a domain ownership identifier for a web app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} id Deployment ID. + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. * * @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 delete the binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -32235,7 +35611,7 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callback) { +function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -32245,7 +35621,6 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32268,8 +35643,8 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, slot, 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 (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 (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { + throw new Error('domainOwnershipIdentifierName 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.'); @@ -32277,6 +35652,9 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callb 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.'); } @@ -32286,14 +35664,14 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, 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}/deployments/{id}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -32359,23 +35737,30 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callb } /** - * @summary List deployment log for specific deployment for an app, or a - * deployment slot. + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. * - * List deployment log for specific deployment for an app, or a deployment - * slot. + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} id The ID of a specific deployment. This is the value of the - * name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.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 delete the binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -32389,13 +35774,13 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, 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 Deployment} for more information. + * See {@link Identifier} 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 _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, callback) { +function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -32405,7 +35790,6 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32428,8 +35812,11 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, 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 (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 (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { + throw new Error('domainOwnershipIdentifierName cannot be null or undefined and it must be of type string.'); + } + if (domainOwnershipIdentifier === null || domainOwnershipIdentifier === undefined) { + throw new Error('domainOwnershipIdentifier 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.'); @@ -32437,6 +35824,9 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call 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.'); } @@ -32446,21 +35836,21 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, 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}/deployments/{id}/log'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -32478,7 +35868,21 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (domainOwnershipIdentifier !== null && domainOwnershipIdentifier !== undefined) { + let requestModelMapper = new client.models['Identifier']().mapper(); + requestModel = client.serialize(requestModelMapper, domainOwnershipIdentifier, 'domainOwnershipIdentifier'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(domainOwnershipIdentifier, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -32495,12 +35899,13 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, 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) { @@ -32520,7 +35925,7 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Deployment']().mapper(); + let resultMapper = new client.models['Identifier']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -32536,17 +35941,17 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call } /** - * @summary Lists ownership identifiers for domain associated with web app. + * @summary Get the status of the last MSDeploy operation. * - * Lists ownership identifiers for domain associated with web app. + * Get the status of the last MSDeploy operation. * * @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 delete the binding 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. * @@ -32560,13 +35965,13 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, 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 IdentifierCollection} for more information. + * See {@link MSDeployStatus} 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 _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, options, callback) { +function _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -32576,7 +35981,6 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32605,6 +36009,9 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti 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.'); } @@ -32614,13 +36021,13 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, 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}/domainOwnershipIdentifiers'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -32662,12 +36069,13 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, 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) { @@ -32687,7 +36095,7 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti 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['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -32702,21 +36110,47 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti }); } + /** - * @summary Get domain ownership identifier for web app. + * @summary Invoke the MSDeploy web app extension. * - * Get domain ownership identifier for web app. + * Invoke the MSDeploy web app extension. * * @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} domainOwnershipIdentifierName Name of domain ownership - * identifier. + * @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 delete the binding for the production slot. + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -32730,13 +36164,96 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, 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 Identifier} for more information. + * See {@link MSDeployStatus} 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 _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, callback) { +function _createMSDeployOperationSlot(resourceGroupName, name, slot, mSDeploy, 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.beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDeploy, 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['MSDeployStatus']().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 MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @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 + * + * @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 MSDeployLog} 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 _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -32746,7 +36263,6 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32769,15 +36285,15 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners 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 (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { - throw new Error('domainOwnershipIdentifierName 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.'); } @@ -32787,14 +36303,13 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -32826,7 +36341,7 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners 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); @@ -32861,7 +36376,7 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Identifier']().mapper(); + let resultMapper = new client.models['MSDeployLog']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -32877,30 +36392,17 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners } /** - * @summary Creates a domain ownership identifier for web app, or updates an - * existing ownership identifier. + * @summary List the functions for a web site, or a deployment slot. * - * Creates a domain ownership identifier for web app, or updates an existing - * ownership identifier. + * List the functions for 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 the app. - * - * @param {string} domainOwnershipIdentifierName Name of domain ownership - * identifier. - * - * @param {object} domainOwnershipIdentifier A JSON representation of the - * domain ownership properties. - * - * @param {string} [domainOwnershipIdentifier.identifierId] String - * representation of the identity. - * - * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * @param {string} name Site name. * * @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 deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -32914,13 +36416,14 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners * {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 Identifier} for more information. + * 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 _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, callback) { +function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -32930,7 +36433,6 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32953,18 +36455,15 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d 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 (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { - throw new Error('domainOwnershipIdentifierName cannot be null or undefined and it must be of type string.'); - } - if (domainOwnershipIdentifier === null || domainOwnershipIdentifier === undefined) { - throw new Error('domainOwnershipIdentifier 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.'); } @@ -32974,21 +36473,20 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -33006,28 +36504,14 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (domainOwnershipIdentifier !== null && domainOwnershipIdentifier !== undefined) { - let requestModelMapper = new client.models['Identifier']().mapper(); - requestModel = client.serialize(requestModelMapper, domainOwnershipIdentifier, 'domainOwnershipIdentifier'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(domainOwnershipIdentifier, 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); @@ -33062,7 +36546,7 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Identifier']().mapper(); + let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -33078,20 +36562,17 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d } /** - * @summary Deletes a domain ownership identifier for a web app. + * @summary Fetch a short lived token that can be exchanged for a master key. * - * Deletes a domain ownership identifier for a web app. + * Fetch a short lived token that can be exchanged for a master key. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {string} domainOwnershipIdentifierName Name of domain ownership - * identifier. + * @param {string} name Name of web 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. + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -33104,13 +36585,13 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {string} [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 _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, callback) { +function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -33120,7 +36601,6 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -33143,15 +36623,15 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn 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 (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { - throw new Error('domainOwnershipIdentifierName 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.'); } @@ -33161,21 +36641,20 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -33200,7 +36679,7 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn 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); @@ -33210,12 +36689,13 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn 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) { @@ -33228,36 +36708,49 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn // 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: 'String' + } + }; + 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 domain ownership identifier for web app, or updates an - * existing ownership identifier. + * @summary Get function information by its ID for web site, or a deployment + * slot. * - * Creates a domain ownership identifier for web app, or updates an existing - * ownership identifier. + * Get function information by its ID for web site, 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} domainOwnershipIdentifierName Name of domain ownership - * identifier. - * - * @param {object} domainOwnershipIdentifier A JSON representation of the - * domain ownership properties. - * - * @param {string} [domainOwnershipIdentifier.identifierId] String - * representation of the identity. + * @param {string} name Site name. * - * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * @param {string} functionName Function name. * * @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 deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -33271,13 +36764,13 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn * {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 Identifier} for more information. + * See {@link FunctionEnvelope} 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 _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, callback) { +function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -33287,7 +36780,6 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -33310,11 +36802,8 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn 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 (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { - throw new Error('domainOwnershipIdentifierName cannot be null or undefined and it must be of type string.'); - } - if (domainOwnershipIdentifier === null || domainOwnershipIdentifier === undefined) { - throw new Error('domainOwnershipIdentifier cannot be null or undefined.'); + if (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { + throw new Error('functionName 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.'); @@ -33322,6 +36811,9 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn 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.'); } @@ -33331,21 +36823,21 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -33363,28 +36855,14 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (domainOwnershipIdentifier !== null && domainOwnershipIdentifier !== undefined) { - let requestModelMapper = new client.models['Identifier']().mapper(); - requestModel = client.serialize(requestModelMapper, domainOwnershipIdentifier, 'domainOwnershipIdentifier'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(domainOwnershipIdentifier, 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); @@ -33419,7 +36897,7 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Identifier']().mapper(); + let resultMapper = new client.models['FunctionEnvelope']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -33434,18 +36912,44 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn }); } + /** - * @summary Get the status of the last MSDeploy operation. + * @summary Create function for web site, or a deployment slot. * - * Get the status of the last MSDeploy operation. + * Create function for 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 {string} name Site name. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @param {string} functionName Function 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} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -33459,13 +36963,97 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn * {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 MSDeployStatus} for more information. + * See {@link FunctionEnvelope} 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 _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback) { +function _createInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, 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.beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, 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['FunctionEnvelope']().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 Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function 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. + * + * {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 _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -33475,7 +37063,6 @@ function _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -33498,12 +37085,18 @@ function _getMSDeployStatusSlot(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 (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { + throw new Error('functionName 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.'); } @@ -33513,20 +37106,21 @@ function _getMSDeployStatusSlot(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}/extensions/MSDeploy'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -33551,7 +37145,7 @@ function _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -33579,152 +37173,26 @@ function _getMSDeployStatusSlot(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['MSDeployStatus']().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 Invoke the MSDeploy web app extension. + * @summary Get function secrets for a function in a web site, or a deployment + * slot. * - * Invoke the MSDeploy web app extension. + * Get function secrets for a function in 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 {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {object} mSDeploy Details of MSDeploy operation - * - * @param {string} [mSDeploy.packageUri] Package URI - * - * @param {string} [mSDeploy.connectionString] SQL Connection String - * - * @param {string} [mSDeploy.dbType] Database Type - * - * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy - * Parameters file. Must not be set if SetParameters is used. - * - * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be - * set if SetParametersXmlFileUri is used. - * - * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy - * operation skips the App_Data directory. - * If set to true, the existing App_Data directory on the - * destination - * will not be deleted, and any App_Data directory in the source will be - * ignored. - * Setting is false by default. - * - * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the - * MSDeploy operation executes. - * Setting is false by default. - * - * @param {string} [mSDeploy.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 MSDeployStatus} 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 _createMSDeployOperationSlot(resourceGroupName, name, slot, mSDeploy, 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.beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDeploy, 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['MSDeployStatus']().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 MSDeploy Log for the last MSDeploy operation. - * - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @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} functionName Function 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. * @@ -33738,13 +37206,13 @@ function _createMSDeployOperationSlot(resourceGroupName, name, slot, mSDeploy, 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 MSDeployLog} for more information. + * See {@link FunctionSecrets} 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 _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { +function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -33754,7 +37222,6 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -33777,12 +37244,18 @@ function _getMSDeployLogSlot(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 (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { + throw new Error('functionName 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.'); } @@ -33792,20 +37265,21 @@ function _getMSDeployLogSlot(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}/extensions/MSDeploy/log'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 @@ -33830,7 +37304,7 @@ function _getMSDeployLogSlot(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); @@ -33840,12 +37314,13 @@ function _getMSDeployLogSlot(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) { @@ -33865,7 +37340,7 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MSDeployLog']().mapper(); + let resultMapper = new client.models['FunctionSecrets']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -33881,17 +37356,17 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary List the functions for a web site, or a deployment slot. + * @summary Get hostname bindings for an app or a deployment slot. * - * List the functions for a web site, or a deployment slot. + * Get hostname bindings 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} 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 gets hostname bindings for the production slot. * * @param {object} [options] Optional Parameters. * @@ -33905,14 +37380,14 @@ function _getMSDeployLogSlot(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 FunctionEnvelopeCollection} 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 _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, callback) { +function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -33922,7 +37397,6 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -33951,6 +37425,9 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call 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.'); } @@ -33960,13 +37437,13 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, 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}/functions'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -33998,7 +37475,7 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call 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); @@ -34008,12 +37485,13 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, 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) { @@ -34033,7 +37511,7 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call 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['HostNameBindingCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -34049,17 +37527,21 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call } /** - * @summary Fetch a short lived token that can be exchanged for a master key. + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). * - * Fetch a short lived token that can be exchanged for a master key. + * Get the named hostname binding 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 the named binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. * * @param {object} [options] Optional Parameters. * @@ -34072,13 +37554,14 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [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 HostNameBinding} 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 _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, callback) { +function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -34088,7 +37571,6 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34114,9 +37596,15 @@ function _getFunctionsAdminTokenSlot(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 (hostName === null || hostName === undefined || typeof hostName.valueOf() !== 'string') { + throw new Error('hostName 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.'); } @@ -34126,13 +37614,14 @@ function _getFunctionsAdminTokenSlot(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}/functions/admin/token'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -34174,12 +37663,13 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, cal 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) { @@ -34199,13 +37689,7 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; + let resultMapper = new client.models['HostNameBinding']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -34221,20 +37705,45 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, cal } /** - * @summary Get function information by its ID for web site, or a deployment - * slot. + * @summary Creates a hostname binding for an app. * - * Get function information by its ID for web site, or a deployment slot. + * Creates a hostname binding for 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} functionName Function name. + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.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 create a binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -34248,13 +37757,13 @@ function _getFunctionsAdminTokenSlot(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 FunctionEnvelope} for more information. + * See {@link HostNameBinding} 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 _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, callback) { +function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -34264,7 +37773,6 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34287,8 +37795,11 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, 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 (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { - throw new Error('functionName cannot be null or undefined and it must be of type string.'); + if (hostName === null || hostName === undefined || typeof hostName.valueOf() !== 'string') { + throw new Error('hostName cannot be null or undefined and it must be of type string.'); + } + if (hostNameBinding === null || hostNameBinding === undefined) { + throw new Error('hostNameBinding 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.'); @@ -34296,6 +37807,9 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, o 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.'); } @@ -34305,21 +37819,21 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, 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}/functions/{functionName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); + requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -34337,14 +37851,28 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, o } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (hostNameBinding !== null && hostNameBinding !== undefined) { + let requestModelMapper = new client.models['HostNameBinding']().mapper(); + requestModel = client.serialize(requestModelMapper, hostNameBinding, 'hostNameBinding'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(hostNameBinding, 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); @@ -34354,12 +37882,13 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, 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) { @@ -34379,7 +37908,7 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, o parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionEnvelope']().mapper(); + let resultMapper = new client.models['HostNameBinding']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -34394,127 +37923,20 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, o }); } - /** - * @summary Create function for web site, or a deployment slot. + * @summary Deletes a hostname binding for an app. * - * Create function for web site, or a deployment slot. + * Deletes a hostname binding for an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. - * - * @param {string} functionName Function 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. - * - * @param {object} functionEnvelope Function details. - * - * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. - * - * @param {string} [functionEnvelope.scriptHref] Script URI. - * - * @param {string} [functionEnvelope.configHref] Config URI. - * - * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. - * - * @param {string} [functionEnvelope.href] Function URI. - * - * @param {object} [functionEnvelope.config] Config information. - * - * @param {object} [functionEnvelope.files] File list. - * - * @param {string} [functionEnvelope.testData] Test data used when testing via - * the Azure Portal. - * - * @param {string} [functionEnvelope.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 FunctionEnvelope} 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 _createInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, 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.beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, 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['FunctionEnvelope']().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 Delete a function for web site, or a deployment slot. - * - * Delete a function for web site, or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} functionName Function name. + * specified, the API will delete the binding for the 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 {string} hostName Hostname in the hostname binding. * * @param {object} [options] Optional Parameters. * @@ -34533,7 +37955,7 @@ function _createInstanceFunctionSlot(resourceGroupName, name, functionName, slot * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, callback) { +function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -34543,7 +37965,6 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34566,15 +37987,18 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, 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 (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { - throw new Error('functionName 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 (hostName === null || hostName === undefined || typeof hostName.valueOf() !== 'string') { + throw new Error('hostName 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.'); } @@ -34584,14 +38008,14 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -34623,7 +38047,7 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -34657,20 +38081,21 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot } /** - * @summary Get function secrets for a function in a web site, or a deployment - * slot. + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. * - * Get function secrets for a function in a web site, or a deployment slot. + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. * * @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} functionName Function name. + * @param {string} namespaceName The namespace for this hybrid connection. * - * @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} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -34684,13 +38109,13 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, 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 FunctionSecrets} for more information. + * See {@link HybridConnection} 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 _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, callback) { +function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -34700,7 +38125,6 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34723,8 +38147,11 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, 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 (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { - throw new Error('functionName cannot be null or undefined and it must be of type string.'); + if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName 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.'); @@ -34732,6 +38159,9 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o 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.'); } @@ -34741,21 +38171,22 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, 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}/functions/{functionName}/listsecrets'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -34790,12 +38221,13 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, 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) { @@ -34815,7 +38247,7 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionSecrets']().mapper(); + let resultMapper = new client.models['HybridConnection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -34831,17 +38263,48 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o } /** - * @summary Get hostname bindings for an app or a deployment slot. + * @summary Creates a new Hybrid Connection using a Service Bus relay. * - * Get hostname bindings for an app or a deployment slot. + * Creates a new Hybrid Connection using a Service Bus relay. * * @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 gets hostname bindings for the production slot. + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -34855,14 +38318,13 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, 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 HostNameBindingCollection} for more - * information. + * See {@link HybridConnection} 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 _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callback) { +function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -34872,7 +38334,6 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34895,12 +38356,24 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, 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 (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName 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.'); } 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.'); } @@ -34910,20 +38383,22 @@ function _listHostNameBindingsSlot(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}/hostNameBindings'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -34941,7 +38416,21 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callb } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['HybridConnection']().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) { @@ -34958,12 +38447,13 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, 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) { @@ -34983,7 +38473,7 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callb 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['HybridConnection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -34999,21 +38489,20 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callb } /** - * @summary Get the named hostname binding for an app (or deployment slot, if - * specified). + * @summary Removes a Hybrid Connection from this site. * - * Get the named hostname binding for an app (or deployment slot, if - * specified). + * Removes a Hybrid Connection from this 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 the named binding for the production slot. + * @param {string} namespaceName The namespace for this hybrid connection. * - * @param {string} hostName Hostname in the hostname binding. + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -35026,14 +38515,13 @@ function _listHostNameBindingsSlot(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 HostNameBinding} 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 _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, callback) { +function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35043,7 +38531,6 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35066,15 +38553,21 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, 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 (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName 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 (hostName === null || hostName === undefined || typeof hostName.valueOf() !== 'string') { - throw new Error('hostName 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.'); } @@ -35084,21 +38577,22 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, option // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); - requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -35123,7 +38617,7 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, option 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); @@ -35151,68 +38645,54 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, option // 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['HostNameBinding']().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. + * @summary Creates a new Hybrid Connection using a Service Bus relay. * - * Creates a hostname binding for an app. + * Creates a new Hybrid Connection using a Service Bus relay. * * @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} hostName Hostname in the hostname binding. + * @param {string} namespaceName The namespace for this hybrid connection. * - * @param {object} hostNameBinding Binding details. This is the JSON - * representation of a HostNameBinding object. + * @param {string} relayName The relay name for this hybrid connection. * - * @param {string} [hostNameBinding.siteName] App Service app name. + * @param {object} connectionEnvelope The details of the hybrid connection. * - * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain - * resource URI. + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. * - * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. * - * @param {string} [hostNameBinding.azureResourceType] Azure resource type. - * Possible values include: 'Website', 'TrafficManager' + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. * - * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS - * record type. Possible values include: 'CName', 'A' + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. * - * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible - * values include: 'Verified', 'Managed' + * @param {number} [connectionEnvelope.port] The port of the endpoint. * - * @param {string} [hostNameBinding.sslState] SSL type. Possible values - * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. * - * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. * - * @param {string} [hostNameBinding.kind] Kind of resource. + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will create a binding for the production slot. + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -35226,13 +38706,13 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, 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 HostNameBinding} for more information. + * See {@link HybridConnection} 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 _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, callback) { +function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35242,7 +38722,6 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35265,11 +38744,14 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h 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 (hostName === null || hostName === undefined || typeof hostName.valueOf() !== 'string') { - throw new Error('hostName cannot be null or undefined and it must be of type string.'); + if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); } - if (hostNameBinding === null || hostNameBinding === undefined) { - throw new Error('hostNameBinding cannot be null or undefined.'); + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName 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.'); @@ -35277,6 +38759,9 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h 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.'); } @@ -35286,21 +38771,22 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -35322,14 +38808,14 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h let requestContent = null; let requestModel = null; try { - if (hostNameBinding !== null && hostNameBinding !== undefined) { - let requestModelMapper = new client.models['HostNameBinding']().mapper(); - requestModel = client.serialize(requestModelMapper, hostNameBinding, 'hostNameBinding'); + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['HybridConnection']().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(hostNameBinding, null, 2)}.`); + `payload - ${JSON.stringify(connectionEnvelope, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -35349,12 +38835,13 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h 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) { @@ -35374,7 +38861,7 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HostNameBinding']().mapper(); + let resultMapper = new client.models['HybridConnection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -35390,19 +38877,20 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h } /** - * @summary Deletes a hostname binding for an app. + * @summary Gets the send key name and value for a Hybrid Connection. * - * Deletes a hostname binding for an app. + * Gets the send key name and value for a Hybrid Connection. * * @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 delete the binding for the production slot. + * @param {string} namespaceName The namespace for this hybrid connection. * - * @param {string} hostName Hostname in the hostname binding. + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -35415,13 +38903,14 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h * * {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 HybridConnectionKey} 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 _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, callback) { +function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35431,7 +38920,6 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35454,15 +38942,21 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt 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 (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName 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 (hostName === null || hostName === undefined || typeof hostName.valueOf() !== 'string') { - throw new Error('hostName 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.'); } @@ -35472,21 +38966,22 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); - requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -35511,7 +39006,7 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt 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); @@ -35521,12 +39016,13 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt 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) { @@ -35539,26 +39035,38 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, 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['HybridConnectionKey']().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 Retrieves a specific Service Bus Hybrid Connection used by this Web - * App. + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. * - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * Retrieves all Service Bus Hybrid Connections used by this Web 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} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * * @param {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. @@ -35579,7 +39087,7 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { +function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35589,7 +39097,6 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35612,18 +39119,15 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN 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 (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { - throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); - } - if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { - throw new Error('relayName 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.'); } @@ -35633,15 +39137,13 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -35683,12 +39185,13 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN 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) { @@ -35724,48 +39227,19 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN } /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). * - * Creates a new Hybrid Connection using a Service Bus relay. + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} connectionEnvelope The details of the hybrid connection. - * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. - * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. - * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. - * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. - * - * @param {number} [connectionEnvelope.port] The port of the endpoint. - * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. - * - * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service - * Bus key. This is used to authenticate to Service Bus. In ARM this key will - * not be returned - * normally, use the POST /listKeys API instead. - * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net - * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} name Name of the app. * - * @param {string} slot The name of the slot for the web app. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get hybrid connections for the production slot. * * @param {object} [options] Optional Parameters. * @@ -35779,13 +39253,14 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN * {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 HybridConnection} for more information. + * See {@link RelayServiceConnectionEntity} 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 _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, callback) { +function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35795,7 +39270,6 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35818,21 +39292,15 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN 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 (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { - throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); - } - if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { - throw new Error('relayName 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.'); } 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.'); } @@ -35842,22 +39310,20 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -35875,21 +39341,7 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (connectionEnvelope !== null && connectionEnvelope !== undefined) { - let requestModelMapper = new client.models['HybridConnection']().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) { @@ -35906,12 +39358,13 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN 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) { @@ -35931,7 +39384,7 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HybridConnection']().mapper(); + let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -35947,20 +39400,19 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN } /** - * @summary Removes a Hybrid Connection from this site. + * @summary Gets a hybrid connection configuration by its name. * - * Removes a Hybrid Connection from this site. + * Gets a hybrid connection configuration by its name. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. + * @param {string} name Name of the app. * - * @param {string} relayName The relay name for this hybrid connection. + * @param {string} entityName Name of the hybrid connection. * - * @param {string} slot The name of the slot for the web app. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a hybrid connection for the production slot. * * @param {object} [options] Optional Parameters. * @@ -35973,13 +39425,15 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN * * {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 RelayServiceConnectionEntity} 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 _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { +function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35989,7 +39443,6 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36012,11 +39465,8 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel 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 (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { - throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); - } - if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { - throw new Error('relayName cannot be null or undefined and it must be of type string.'); + if (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { + throw new Error('entityName 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.'); @@ -36024,6 +39474,9 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel 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.'); } @@ -36033,22 +39486,21 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -36073,7 +39525,7 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel 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); @@ -36083,12 +39535,13 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel 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) { @@ -36101,54 +39554,64 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel // 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['RelayServiceConnectionEntity']().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 new Hybrid Connection using a Service Bus relay. + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). * - * Creates a new Hybrid Connection using a Service Bus relay. + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. + * @param {string} name Name of the app. * - * @param {object} connectionEnvelope The details of the hybrid connection. + * @param {string} entityName Name of the hybrid connection configuration. * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. + * @param {string} [connectionEnvelope.entityName] * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. + * @param {string} [connectionEnvelope.entityConnectionString] * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * @param {string} [connectionEnvelope.resourceType] * - * @param {number} [connectionEnvelope.port] The port of the endpoint. + * @param {string} [connectionEnvelope.resourceConnectionString] * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. + * @param {string} [connectionEnvelope.hostname] * - * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service - * Bus key. This is used to authenticate to Service Bus. In ARM this key will - * not be returned - * normally, use the POST /listKeys API instead. + * @param {number} [connectionEnvelope.port] * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net + * @param {string} [connectionEnvelope.biztalkUri] * * @param {string} [connectionEnvelope.kind] Kind of resource. * - * @param {string} slot The name of the slot for the web app. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. * * @param {object} [options] Optional Parameters. * @@ -36162,13 +39625,14 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel * {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 HybridConnection} for more information. + * See {@link RelayServiceConnectionEntity} 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 _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, callback) { +function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -36178,7 +39642,6 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36201,11 +39664,8 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel 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 (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { - throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); - } - if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { - throw new Error('relayName cannot be null or undefined and it must be of type string.'); + if (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { + throw new Error('entityName 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.'); @@ -36216,6 +39676,9 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel 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.'); } @@ -36225,22 +39688,21 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -36263,7 +39725,7 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel let requestModel = null; try { if (connectionEnvelope !== null && connectionEnvelope !== undefined) { - let requestModelMapper = new client.models['HybridConnection']().mapper(); + let requestModelMapper = new client.models['RelayServiceConnectionEntity']().mapper(); requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); requestContent = JSON.stringify(requestModel); } @@ -36289,12 +39751,13 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel 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) { @@ -36314,7 +39777,7 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HybridConnection']().mapper(); + let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -36330,20 +39793,19 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel } /** - * @summary Gets the send key name and value for a Hybrid Connection. + * @summary Deletes a relay service connection by its name. * - * Gets the send key name and value for a Hybrid Connection. + * Deletes a relay service connection by its name. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. + * @param {string} name Name of the app. * - * @param {string} relayName The relay name for this hybrid connection. + * @param {string} entityName Name of the hybrid connection configuration. * - * @param {string} slot The name of the slot for the web app. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a hybrid connection for the production slot. * * @param {object} [options] Optional Parameters. * @@ -36356,14 +39818,13 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel * * {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 HybridConnectionKey} 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 _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { +function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -36373,7 +39834,6 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36396,11 +39856,8 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r 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 (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { - throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); - } - if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { - throw new Error('relayName cannot be null or undefined and it must be of type string.'); + if (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { + throw new Error('entityName 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.'); @@ -36408,6 +39865,9 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r 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.'); } @@ -36417,22 +39877,21 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -36457,7 +39916,7 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r 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); @@ -36485,39 +39944,47 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r // 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['HybridConnectionKey']().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 Retrieves all Service Bus Hybrid Connections used by this Web App. + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). * - * Retrieves all Service Bus Hybrid Connections used by this Web App. + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). * * @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} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. * * @param {object} [options] Optional Parameters. * @@ -36531,13 +39998,14 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r * {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 HybridConnection} for more information. + * See {@link RelayServiceConnectionEntity} 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 _listHybridConnectionsSlot(resourceGroupName, name, slot, options, callback) { +function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -36547,7 +40015,6 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36570,12 +40037,21 @@ function _listHybridConnectionsSlot(resourceGroupName, name, 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 (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { + throw new Error('entityName 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.'); } 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.'); } @@ -36585,20 +40061,21 @@ function _listHybridConnectionsSlot(resourceGroupName, name, 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}/hybridConnectionRelays'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -36616,7 +40093,21 @@ function _listHybridConnectionsSlot(resourceGroupName, name, 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['RelayServiceConnectionEntity']().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) { @@ -36633,12 +40124,13 @@ function _listHybridConnectionsSlot(resourceGroupName, name, 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) { @@ -36658,7 +40150,7 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HybridConnection']().mapper(); + let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -36674,11 +40166,9 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call } /** - * @summary Gets hybrid connections configured for an app (or deployment slot, - * if specified). + * @summary Gets all scale-out instances of an app. * - * Gets hybrid connections configured for an app (or deployment slot, if - * specified). + * Gets all scale-out instances of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -36686,7 +40176,7 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call * @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 hybrid connections for the production slot. + * specified, the API gets the production slot instances. * * @param {object} [options] Optional Parameters. * @@ -36700,14 +40190,14 @@ function _listHybridConnectionsSlot(resourceGroupName, name, 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 RelayServiceConnectionEntity} 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 _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, callback) { +function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -36717,7 +40207,6 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36746,6 +40235,9 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options 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.'); } @@ -36755,13 +40247,13 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, 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}/hybridconnection'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -36803,12 +40295,13 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, 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) { @@ -36828,7 +40321,7 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + let resultMapper = new client.models['WebAppInstanceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -36844,19 +40337,19 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options } /** - * @summary Gets a hybrid connection configuration by its name. + * @summary Get the status of the last MSDeploy operation. * - * Gets a hybrid connection configuration by its name. + * Get the status of the last MSDeploy operation. * * @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} entityName Name of the hybrid connection. + * @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 get a hybrid connection for the production slot. + * @param {string} instanceId ID of web app instance. * * @param {object} [options] Optional Parameters. * @@ -36870,14 +40363,13 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, 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 RelayServiceConnectionEntity} for more - * information. + * See {@link MSDeployStatus} 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 _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, callback) { +function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -36887,7 +40379,6 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36910,15 +40401,18 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo 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 (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { - throw new Error('entityName 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 (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId 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.'); } @@ -36928,14 +40422,14 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -36977,12 +40471,13 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo 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) { @@ -37002,7 +40497,7 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + let resultMapper = new client.models['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -37017,42 +40512,49 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo }); } + /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). + * @summary Invoke the MSDeploy web app extension. * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). + * Invoke the MSDeploy web app extension. * * @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} entityName Name of the hybrid connection configuration. + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. + * @param {string} instanceId ID of web app instance. * - * @param {string} [connectionEnvelope.entityName] + * @param {object} mSDeploy Details of MSDeploy operation * - * @param {string} [connectionEnvelope.entityConnectionString] + * @param {string} [mSDeploy.packageUri] Package URI * - * @param {string} [connectionEnvelope.resourceType] + * @param {string} [mSDeploy.connectionString] SQL Connection String * - * @param {string} [connectionEnvelope.resourceConnectionString] + * @param {string} [mSDeploy.dbType] Database Type * - * @param {string} [connectionEnvelope.hostname] + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. * - * @param {number} [connectionEnvelope.port] + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. * - * @param {string} [connectionEnvelope.biztalkUri] + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will create or update a hybrid connection for the - * production slot. + * @param {string} [mSDeploy.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -37066,14 +40568,98 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, 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 RelayServiceConnectionEntity} for more - * information. + * See {@link MSDeployStatus} 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 _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, callback) { +function _createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, 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.beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, 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['MSDeployStatus']().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 MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @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 {string} instanceId ID of web app instance. + * + * @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 MSDeployLog} 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 _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -37083,7 +40669,6 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -37106,18 +40691,18 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti 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 (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { - throw new Error('entityName 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.'); } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId 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.'); } @@ -37127,21 +40712,21 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -37159,28 +40744,14 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (connectionEnvelope !== null && connectionEnvelope !== undefined) { - let requestModelMapper = new client.models['RelayServiceConnectionEntity']().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); @@ -37215,7 +40786,7 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + let resultMapper = new client.models['MSDeployLog']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -37231,19 +40802,23 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti } /** - * @summary Deletes a relay service connection by its name. + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. * - * Deletes a relay service connection by its name. + * 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 * resource belongs. * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. + * @param {string} name Site name. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete a hybrid connection for the production slot. + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". * * @param {object} [options] Optional Parameters. * @@ -37256,13 +40831,14 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti * * {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 _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, callback) { +function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -37272,7 +40848,6 @@ function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -37295,15 +40870,18 @@ function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, 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 (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { - throw new Error('entityName 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 (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId 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.'); } @@ -37313,21 +40891,21 @@ function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -37380,47 +40958,48 @@ function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, // 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 Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). + * 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. * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. - * - * @param {string} [connectionEnvelope.entityName] - * - * @param {string} [connectionEnvelope.entityConnectionString] - * - * @param {string} [connectionEnvelope.resourceType] - * - * @param {string} [connectionEnvelope.resourceConnectionString] - * - * @param {string} [connectionEnvelope.hostname] - * - * @param {number} [connectionEnvelope.port] - * - * @param {string} [connectionEnvelope.biztalkUri] + * @param {string} name Site name. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} processId PID. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will create or update a hybrid connection for the - * production slot. + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". * * @param {object} [options] Optional Parameters. * @@ -37434,14 +41013,13 @@ function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, * {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 RelayServiceConnectionEntity} for more - * information. + * 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 _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, callback) { +function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -37451,7 +41029,6 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -37474,18 +41051,21 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, 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 (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { - throw new Error('entityName 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 (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.'); } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId 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.'); } @@ -37495,21 +41075,22 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -37527,28 +41108,14 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (connectionEnvelope !== null && connectionEnvelope !== undefined) { - let requestModelMapper = new client.models['RelayServiceConnectionEntity']().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); @@ -37583,7 +41150,7 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + let resultMapper = new client.models['ProcessInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -37599,17 +41166,25 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, } /** - * @summary Gets all scale-out instances of an app. + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. * - * Gets all scale-out instances of an app. + * 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. * - * @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 the production slot instances. + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". * * @param {object} [options] Optional Parameters. * @@ -37622,15 +41197,13 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, * * {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 - * 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 _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, callback) { +function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -37640,7 +41213,6 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -37663,12 +41235,21 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, 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 (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.'); } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId 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.'); } @@ -37678,20 +41259,22 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'; 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('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -37716,7 +41299,7 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, ca return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -37744,42 +41327,31 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, ca // 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 the status of the last MSDeploy operation. + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. * - * Get the status of the last MSDeploy operation. + * 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 Name of web app. + * @param {string} name Site name. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @param {string} processId PID. * - * @param {string} instanceId ID of web app instance. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". * * @param {object} [options] Optional Parameters. * @@ -37793,13 +41365,12 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, 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 MSDeployStatus} 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 _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, callback) { +function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -37809,7 +41380,6 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -37832,6 +41402,9 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI 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.'); } @@ -37841,6 +41414,9 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI 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.'); } @@ -37850,14 +41426,15 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump'; 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('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -37884,20 +41461,22 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI } 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) { - let error = new Error(responseBody); + 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 { - 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; @@ -37914,159 +41493,33 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI } 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['MSDeployStatus']().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 Invoke the MSDeploy web app extension. + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * Invoke the MSDeploy web app extension. + * 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. * - * @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 {string} instanceId ID of web app instance. - * - * @param {object} mSDeploy Details of MSDeploy operation - * - * @param {string} [mSDeploy.packageUri] Package URI - * - * @param {string} [mSDeploy.connectionString] SQL Connection String - * - * @param {string} [mSDeploy.dbType] Database Type - * - * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy - * Parameters file. Must not be set if SetParameters is used. - * - * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be - * set if SetParametersXmlFileUri is used. - * - * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy - * operation skips the App_Data directory. - * If set to true, the existing App_Data directory on the - * destination - * will not be deleted, and any App_Data directory in the source will be - * ignored. - * Setting is false by default. - * - * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the - * MSDeploy operation executes. - * Setting is false by default. - * - * @param {string} [mSDeploy.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 MSDeployStatus} 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 _createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, 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.beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, 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['MSDeployStatus']().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 MSDeploy Log for the last MSDeploy operation. - * - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @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} processId PID. * - * @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 returns deployments for the production slot. * - * @param {string} instanceId ID of web app instance. + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". * * @param {object} [options] Optional Parameters. * @@ -38080,13 +41533,14 @@ function _createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, ins * {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 MSDeployLog} 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 _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, callback) { +function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -38096,7 +41550,6 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38119,6 +41572,9 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, 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.'); } @@ -38128,6 +41584,9 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, 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.'); } @@ -38137,14 +41596,15 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules'; 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('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -38211,7 +41671,7 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MSDeployLog']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -38227,17 +41687,21 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, } /** - * @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 Get process information 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. + * 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. * * @param {string} name Site name. * + * @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. * @@ -38257,13 +41721,13 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, * {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 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 _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, callback) { +function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -38273,7 +41737,6 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38296,6 +41759,12 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, 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 (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.'); } @@ -38305,6 +41774,9 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, o 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.'); } @@ -38314,14 +41786,16 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, o // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/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('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -38388,7 +41862,7 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, o 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['ProcessModuleInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -38404,11 +41878,11 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, o } /** - * @summary Get process information by its ID for a specific scaled-out + * @summary 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. + * 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. @@ -38436,13 +41910,14 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, 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 ProcessInfo} 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 _getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { +function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -38452,7 +41927,6 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38487,6 +41961,9 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta 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.'); } @@ -38496,7 +41973,7 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); @@ -38504,7 +41981,7 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -38571,7 +42048,7 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta 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['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -38587,12 +42064,12 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta } /** - * @summary Terminate a process by its ID for a web site, or a deployment slot, - * or specific scaled-out instance in a web site. - * - * Terminate a process by its ID for a web site, or a deployment slot, or + * @summary Get thread information by Thread ID for a specific process, in 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. + * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * @@ -38600,6 +42077,8 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta * * @param {string} processId PID. * + * @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. * @@ -38618,13 +42097,14 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta * * {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 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 _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { +function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -38634,7 +42114,6 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38660,6 +42139,9 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in 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.'); } @@ -38669,6 +42151,9 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in 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.'); } @@ -38678,22 +42163,23 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/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('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -38718,7 +42204,7 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in 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); @@ -38746,31 +42232,212 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in // 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['ProcessThreadInfo']().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 - * instance in a web site. + * @summary Shows whether an app can be cloned to another resource group or + * subscription. * - * Get a memory dump of a process by its ID for a specific scaled-out instance - * in a web site. + * Shows whether an app can be cloned to another resource group or + * subscription. * * @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} slot Name of the deployment slot. By default, this API + * returns information on the production slot. * - * @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. * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". + * @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 SiteCloneability} 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 _isCloneableSlot(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}/iscloneable'; + 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); + 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['SiteCloneability']().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 This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @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 restore a backup of the production slot. * * @param {object} [options] Optional Parameters. * @@ -38784,12 +42451,13 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in * {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 FunctionSecrets} 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 _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { +function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -38799,7 +42467,6 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38822,18 +42489,15 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i 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.'); } - if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { - throw new Error('instanceId 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.'); } @@ -38843,22 +42507,20 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus'; 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('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 @@ -38878,29 +42540,28 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i } 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}`); + 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 { - 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; - 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) { @@ -38910,33 +42571,44 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i } 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['FunctionSecrets']().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 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} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. - * - * @param {string} processId PID. + * @param {string} name Name of the 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} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". + * specified, the API will get metric definitions of the production slot. * * @param {object} [options] Optional Parameters. * @@ -38950,14 +42622,14 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i * {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 _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { +function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -38967,7 +42639,6 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38990,18 +42661,15 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo 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.'); } - if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { - throw new Error('instanceId 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.'); } @@ -39011,15 +42679,13 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metricdefinitions'; 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('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -39051,7 +42717,7 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo 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); @@ -39061,12 +42727,13 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo 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) { @@ -39086,7 +42753,7 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo 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) { @@ -39102,30 +42769,29 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo } /** - * @summary Get process information 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). * - * Get process information 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} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} baseAddress Module base address. + * @param {string} name Name of the 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} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". + * specified, the API will get metrics of the production slot. * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics 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 * @@ -39136,13 +42802,14 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, 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 ProcessModuleInfo} for more information. + * 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 _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, callback) { +function _listMetricsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -39152,7 +42819,8 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; + let details = (options && options.details !== undefined) ? options.details : undefined; + let filter = (options && options.filter !== undefined) ? options.filter : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -39175,21 +42843,21 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA 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 (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.'); } - if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { - throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + if (details !== null && details !== undefined && typeof details !== 'boolean') { + throw new Error('details must be of type boolean.'); + } + 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.'); } + 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.'); } @@ -39199,16 +42867,19 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metrics'; 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('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (details !== null && details !== undefined) { + queryParameters.push('details=' + encodeURIComponent(details.toString())); + } + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -39240,7 +42911,7 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA 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); @@ -39250,12 +42921,13 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA 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) { @@ -39275,7 +42947,7 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA 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['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -39291,25 +42963,18 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @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. + * @param {string} name Name of web app. * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". + * @param {string} slot Name of the deployment slot. * * @param {object} [options] Optional Parameters. * @@ -39323,14 +42988,13 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA * {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 MigrateMySqlStatus} 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 _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { +function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -39340,7 +43004,6 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -39363,18 +43026,15 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo 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.'); } - if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { - throw new Error('instanceId 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.'); } @@ -39384,15 +43044,13 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status'; 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('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -39424,7 +43082,7 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo 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); @@ -39434,12 +43092,13 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo 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) { @@ -39459,7 +43118,7 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo 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['MigrateMySqlStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -39475,27 +43134,22 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo } /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. + * @summary Gets all network features used by the 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. + * Gets all network features used by the 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} processId PID. + * @param {string} name Name of the app. * - * @param {string} threadId TID. + * @param {string} view The type of view. This can either be "summary" or + * "detailed". * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". + * specified, the API will get network features for the production slot. * * @param {object} [options] Optional Parameters. * @@ -39509,13 +43163,13 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, 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 ProcessThreadInfo} for more information. + * See {@link NetworkFeatures} 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 _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, callback) { +function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -39525,7 +43179,6 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -39548,21 +43201,18 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa 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 (view === null || view === undefined || typeof view.valueOf() !== 'string') { + throw new Error('view 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 (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { - throw new Error('instanceId 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.'); } @@ -39572,16 +43222,14 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads/{threadId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}'; 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('{view}', encodeURIComponent(view)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); - requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -39648,7 +43296,7 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa 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['NetworkFeatures']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -39664,22 +43312,27 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa } /** - * @summary Shows whether an app can be cloned to another resource group or - * subscription. + * @summary Start capturing network packets for the site. * - * Shows whether an app can be cloned to another resource group or - * subscription. + * 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. By default, this API - * returns information on 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 * @@ -39689,14 +43342,13 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa * * {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 SiteCloneability} for more information. + * {string} [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 _isCloneableSlot(resourceGroupName, name, slot, options, callback) { +function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -39706,7 +43358,9 @@ function _isCloneableSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; + 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') { @@ -39729,12 +43383,24 @@ function _isCloneableSlot(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 (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.'); } @@ -39744,13 +43410,22 @@ function _isCloneableSlot(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}/iscloneable'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/start'; 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(apiVersion)); + 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('&'); } @@ -39792,12 +43467,13 @@ function _isCloneableSlot(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) { @@ -39817,7 +43493,13 @@ function _isCloneableSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteCloneability']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -39833,17 +43515,16 @@ function _isCloneableSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary This is to allow calling via powershell and ARM template. + * @summary Stop ongoing capturing network packets for the site. * - * This is to allow calling via powershell and ARM template. + * 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. * @@ -39856,14 +43537,13 @@ function _isCloneableSlot(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 FunctionSecrets} for more information. + * {string} [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 _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, callback) { +function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -39873,7 +43553,6 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -39902,6 +43581,9 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c 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.'); } @@ -39911,13 +43593,13 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, 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}/listsyncfunctiontriggerstatus'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -39959,12 +43641,13 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c 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) { @@ -39984,7 +43667,13 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionSecrets']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -40000,10 +43689,11 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c } /** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). * - * Gets all metric definitions of 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. @@ -40011,7 +43701,8 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c * @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 metric definitions of the production slot. + * specified, the API generate a new publishing password for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -40024,15 +43715,13 @@ function _listSyncFunctionTriggersSlot(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. - * See {@link ResourceMetricDefinitionCollection} 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 _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, callback) { +function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -40042,7 +43731,6 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40071,6 +43759,9 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, call 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.'); } @@ -40080,20 +43771,20 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, 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}/metricdefinitions'; + 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)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 @@ -40118,7 +43809,7 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, call 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); @@ -40146,6 +43837,172 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, call // 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} 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 {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 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 _listPerfMonCountersSlot(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 filter = (options && options.filter !== undefined) ? options.filter : 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 (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.'); + } + 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}/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('&'); + } + + // 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; @@ -40153,7 +44010,7 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, call 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) { @@ -40169,29 +44026,20 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, call } /** - * @summary Gets performance metrics of an app (or deployment slot, if - * specified). + * @summary Gets web app's event logs. * - * Gets performance metrics of an app (or deployment slot, if specified). + * 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} name Name of web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get metrics 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. * - * @param {boolean} [options.details] Specify "true" to include metric details - * in the response. It is "false" by default. - * - * @param {string} [options.filter] Return only metrics 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 * @@ -40202,14 +44050,13 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, 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 ResourceMetricCollection} 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 _listMetricsSlot(resourceGroupName, name, slot, options, callback) { +function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -40219,9 +44066,6 @@ function _listMetricsSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let details = (options && options.details !== undefined) ? options.details : undefined; - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40247,15 +44091,12 @@ function _listMetricsSlot(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 (details !== null && details !== undefined && typeof details !== 'boolean') { - throw new Error('details must be of type boolean.'); - } - 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.'); } + 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.'); } @@ -40265,19 +44106,13 @@ function _listMetricsSlot(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}/metrics'; + 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('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - if (details !== null && details !== undefined) { - queryParameters.push('details=' + encodeURIComponent(details.toString())); - } - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + filter); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -40319,12 +44154,13 @@ function _listMetricsSlot(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) { @@ -40344,7 +44180,7 @@ function _listMetricsSlot(resourceGroupName, name, slot, 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['SitePhpErrorLogFlag']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -40360,18 +44196,17 @@ function _listMetricsSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Returns the status of MySql in app migration, if one is active, and - * whether or not MySql in app is enabled + * @summary Gets the premier add-ons of an app. * - * Returns the status of MySql in app migration, if one is active, and whether - * or not MySql in app is enabled + * 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 web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of the deployment slot. + * @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 {object} [options] Optional Parameters. * @@ -40385,13 +44220,13 @@ function _listMetricsSlot(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 MigrateMySqlStatus} 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 _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, callback) { +function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -40401,7 +44236,6 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40430,6 +44264,9 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, call 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.'); } @@ -40439,13 +44276,13 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, 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}/migratemysql/status'; + 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('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -40487,12 +44324,13 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, 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) { @@ -40512,7 +44350,7 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MigrateMySqlStatus']().mapper(); + let resultMapper = new client.models['PremierAddOn']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -40528,22 +44366,19 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, call } /** - * @summary Gets all network features used by the app (or deployment slot, if - * specified). + * @summary Gets a named add-on of an app. * - * Gets all network features used by the app (or deployment slot, if - * specified). + * Gets 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} view The type of view. This can either be "summary" or - * "detailed". + * @param {string} premierAddOnName Add-on name. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get network features for the production slot. + * specified, the API will get the named add-on for the production slot. * * @param {object} [options] Optional Parameters. * @@ -40557,13 +44392,13 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, 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 NetworkFeatures} 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 _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, callback) { +function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -40573,7 +44408,6 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40596,8 +44430,8 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, 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 (view === null || view === undefined || typeof view.valueOf() !== 'string') { - throw new Error('view 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.'); @@ -40605,6 +44439,9 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, 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.'); } @@ -40614,14 +44451,14 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, 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}/networkFeatures/{view}'; + 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('{view}', encodeURIComponent(view)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -40653,7 +44490,7 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, 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); @@ -40663,12 +44500,13 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, 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) { @@ -40688,7 +44526,7 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NetworkFeatures']().mapper(); + let resultMapper = new client.models['PremierAddOn']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -40704,26 +44542,42 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, } /** - * @summary Start capturing network packets for the site. + * @summary Updates a named add-on of an app. * - * Start capturing network packets for 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 {string} slot The name of the slot for this web app. + * @param {string} premierAddOnName Add-on name. * - * @param {object} [options] Optional Parameters. + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. * - * @param {number} [options.durationInSeconds] The duration to keep capturing - * in seconds. + * @param {string} [premierAddOn.sku] Premier add on SKU. * - * @param {number} [options.maxFrameLength] The maximum frame length in bytes - * (Optional). + * @param {string} [premierAddOn.product] Premier add on Product. * - * @param {string} [options.sasUrl] The Blob URL to store capture file. + * @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. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -40734,13 +44588,14 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [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 _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { +function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -40750,10 +44605,6 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c 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; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40776,21 +44627,21 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, 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 (durationInSeconds !== null && durationInSeconds !== undefined && typeof durationInSeconds !== 'number') { - throw new Error('durationInSeconds must be of type number.'); + 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.'); } - 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.'); } @@ -40800,29 +44651,21 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, 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}/networkTrace/start'; + 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 = []; - 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(apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -40840,7 +44683,21 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c } } } - httpRequest.body = null; + // 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; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -40857,12 +44714,13 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c 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) { @@ -40882,13 +44740,7 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; + let resultMapper = new client.models['PremierAddOn']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -40904,16 +44756,19 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c } /** - * @summary Stop ongoing capturing network packets for the site. + * @summary Delete a premier add-on from an app. * - * Stop ongoing capturing network packets for 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 this 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. * @@ -40926,13 +44781,13 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [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 _stopWebSiteNetworkTraceSlot(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') { @@ -40942,7 +44797,6 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40965,12 +44819,18 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, 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 (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.'); } @@ -40980,20 +44840,21 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/stop'; + 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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -41046,49 +44907,42 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, ca // 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: 'String' - } - }; - 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 Generates a new publishing password for an app (or deployment slot, - * if specified). + * @summary Updates a named add-on of an app. * - * Generates a new publishing password for an app (or deployment slot, if - * specified). + * 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} 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 update the named add-on for the production slot. * * @param {object} [options] Optional Parameters. * @@ -41101,13 +44955,14 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, ca * * {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 _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, callback) { +function _updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41117,7 +44972,6 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -41140,12 +44994,21 @@ 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 (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.'); } 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.'); } @@ -41155,20 +45018,21 @@ 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}/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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -41186,14 +45050,28 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + 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(premierAddOn, 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 !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -41203,12 +45081,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) { @@ -41221,31 +45100,44 @@ 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 = 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); }); } /** - * @summary Gets perfmon counters for web app. + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Gets perfmon counters for web app. + * 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 Name of web app. + * @param {string} name The name of the web app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @param {string} slot The name of the slot for the 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 * @@ -41256,14 +45148,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. + * 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 _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callback) { +function _getPrivateAccessSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41273,8 +45164,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; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -41300,12 +45189,12 @@ function _listPerfMonCountersSlot(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.'); } + 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.'); } @@ -41315,16 +45204,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}/privateAccess/virtualNetworks'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -41366,12 +45252,13 @@ function _listPerfMonCountersSlot(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) { @@ -41391,7 +45278,7 @@ 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 = new client.models['PrivateAccess']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -41407,17 +45294,27 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba } /** - * @summary Gets web app's event logs. + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Gets web app's event logs. + * 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 Name of web app. + * @param {string} name The name of the web app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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 {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -41431,13 +45328,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. + * 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 _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, callback) { +function _putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41447,7 +45344,6 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -41470,12 +45366,18 @@ function _getSitePhpErrorLogFlagSlot(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 (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.'); } 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.'); } @@ -41485,20 +45387,20 @@ 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}/privateAccess/virtualNetworks'; 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(apiVersion)); + 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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -41516,7 +45418,21 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal } } } - 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) { @@ -41533,12 +45449,13 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal 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) { @@ -41558,7 +45475,7 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SitePhpErrorLogFlag']().mapper(); + let resultMapper = new client.models['PrivateAccess']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -41574,17 +45491,19 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal } /** - * @summary Gets the premier add-ons of an app. + * @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 the premier add-ons 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. * * @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 will get the premier add-ons for the production slot. + * specified, the API returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -41598,13 +45517,13 @@ 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 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 _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback) { +function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41614,7 +45533,6 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -41643,6 +45561,9 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback 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.'); } @@ -41652,13 +45573,13 @@ 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}/processes'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -41690,7 +45611,7 @@ function _listPremierAddOnsSlot(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); @@ -41725,7 +45646,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['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -41741,19 +45662,21 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback } /** - * @summary Gets a named add-on of an app. + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. * - * Gets a named add-on of an app. + * 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. * - * @param {string} name Name of the app. + * @param {string} name Site name. * - * @param {string} premierAddOnName Add-on name. + * @param {string} processId PID. * * @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. + * specified, the API returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -41767,13 +45690,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 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 _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, callback) { +function _getProcessSlot(resourceGroupName, name, processId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41783,7 +45706,6 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -41806,8 +45728,8 @@ 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 (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.'); @@ -41815,6 +45737,9 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o 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.'); } @@ -41824,14 +45749,14 @@ 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}/processes/{processId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -41863,7 +45788,7 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, 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); @@ -41898,7 +45823,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['ProcessInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -41914,46 +45839,21 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o } /** - * @summary Updates a named add-on of an app. + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. * - * Updates a named add-on of an app. + * 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. * - * @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.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * - * @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 {string} name Site name. * - * @param {object} [premierAddOn.tags] Resource tags. + * @param {string} processId PID. * * @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 returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -41966,14 +45866,13 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, 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 PremierAddOn} 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 _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, callback) { +function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41983,7 +45882,6 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42006,11 +45904,8 @@ 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 (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.'); @@ -42018,6 +45913,9 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier 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.'); } @@ -42027,21 +45925,21 @@ 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}/processes/{processId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -42059,28 +45957,14 @@ 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) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -42108,42 +45992,27 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier // 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); }); } /** - * @summary Delete a premier add-on from an app. + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. * - * Delete a premier add-on from an app. + * 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 Name of the app. + * @param {string} name Site name. * - * @param {string} premierAddOnName Add-on name. + * @param {string} processId PID. * * @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 returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -42156,13 +46025,13 @@ 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. * * {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 _getProcessDumpSlot(resourceGroupName, name, processId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -42172,7 +46041,6 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42195,8 +46063,8 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, 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 (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 (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.'); @@ -42204,6 +46072,9 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot 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.'); } @@ -42213,21 +46084,21 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot // 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}/processes/{processId}/dump'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -42247,20 +46118,22 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot } 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) { - let error = new Error(responseBody); + 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 { - 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; @@ -42277,26 +46150,27 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; + // Create Result + let result = response; 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. + * @summary 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. + * 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. * * @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. * @@ -42312,13 +46186,14 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, 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 ProcessInfoCollection} 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 _listProcessesSlot(resourceGroupName, name, slot, options, callback) { +function _listProcessModulesSlot(resourceGroupName, name, processId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -42328,7 +46203,6 @@ function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42351,12 +46225,18 @@ function _listProcessesSlot(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 (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.'); } 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.'); } @@ -42366,13 +46246,14 @@ 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}/processes/{processId}/modules'; 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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -42439,7 +46320,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['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -42468,6 +46349,8 @@ function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { * * @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. * @@ -42483,13 +46366,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 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 _getProcessSlot(resourceGroupName, name, processId, slot, options, callback) { +function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -42499,7 +46382,6 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42525,12 +46407,18 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call 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.'); } 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.'); } @@ -42540,14 +46428,15 @@ 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}/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('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -42614,7 +46503,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['ProcessModuleInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -42630,11 +46519,11 @@ 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 List the threads in 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. + * 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. @@ -42657,13 +46546,15 @@ 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 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 _deleteProcessSlot(resourceGroupName, name, processId, slot, options, callback) { +function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -42673,7 +46564,6 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42705,6 +46595,9 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c 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.'); } @@ -42714,21 +46607,21 @@ 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/{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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -42753,7 +46646,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); @@ -42781,17 +46674,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['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 Get a memory dump of a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Get thread information by Thread ID for a specific process, in 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 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. @@ -42800,6 +46710,8 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c * * @param {string} processId PID. * + * @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. * @@ -42815,12 +46727,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 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 _getProcessDumpSlot(resourceGroupName, name, processId, slot, options, callback) { +function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -42830,7 +46743,6 @@ function _getProcessDumpSlot(resourceGroupName, name, processId, slot, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42856,12 +46768,18 @@ function _getProcessDumpSlot(resourceGroupName, name, processId, slot, 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 (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.'); } @@ -42871,14 +46789,15 @@ 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}/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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -42905,22 +46824,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; @@ -42937,29 +46854,43 @@ 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['ProcessThreadInfo']().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 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} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. - * - * @param {string} processId PID. + * @param {string} name Name of the app. * * @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 gets hostname bindings for the production slot. * * @param {object} [options] Optional Parameters. * @@ -42973,14 +46904,14 @@ 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 + * 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 _listProcessModulesSlot(resourceGroupName, name, processId, slot, options, callback) { +function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -42990,7 +46921,6 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43013,15 +46943,15 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio 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.'); } 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.'); } @@ -43031,14 +46961,13 @@ 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}/publicCertificates'; 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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -43070,7 +46999,7 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio 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); @@ -43080,12 +47009,13 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio 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) { @@ -43105,7 +47035,7 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio 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) { @@ -43121,23 +47051,21 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary Get the named public certificate for an app (or deployment slot, if + * specified). * - * Get process information by its ID for a specific scaled-out instance in a - * web site. + * 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} processId PID. - * - * @param {string} baseAddress Module base address. + * @param {string} name Name of the app. * * @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 the named binding for the production slot. + * + * @param {string} publicCertificateName Public certificate name. * * @param {object} [options] Optional Parameters. * @@ -43151,13 +47079,13 @@ 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. + * 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 _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, options, callback) { +function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -43167,7 +47095,6 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43190,18 +47117,18 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, 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 (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.'); } + 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.'); } @@ -43211,15 +47138,14 @@ 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}/publicCertificates/{publicCertificateName}'; 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('{publicCertificateName}', encodeURIComponent(publicCertificateName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -43251,7 +47177,7 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, 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); @@ -43261,12 +47187,13 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, 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) { @@ -43286,7 +47213,7 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, 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['PublicCertificate']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -43302,21 +47229,30 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Creates a hostname binding for an app. * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * Creates a hostname binding for 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} processId PID. + * @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 returns deployments for the production slot. + * specified, the API will create a binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -43330,14 +47266,13 @@ 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 - * information. + * 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 _listProcessThreadsSlot(resourceGroupName, name, processId, slot, options, callback) { +function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCertificateName, publicCertificate, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -43347,7 +47282,6 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43370,8 +47304,11 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio 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 (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.'); @@ -43379,6 +47316,9 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio 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.'); } @@ -43388,21 +47328,21 @@ 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}/publicCertificates/{publicCertificateName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -43420,14 +47360,28 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio } } } - httpRequest.body = null; + // 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) { 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); @@ -43437,12 +47391,13 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio 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) { @@ -43462,7 +47417,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['PublicCertificate']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -43478,23 +47433,19 @@ 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 Deletes a hostname binding for an app. * - * Get thread information by Thread ID for a specific process, in a specific - * scaled-out instance in a web site. + * Deletes a hostname binding for an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} threadId TID. + * @param {string} name Name of the app. * * @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 delete the binding for the production slot. + * + * @param {string} publicCertificateName Public certificate name. * * @param {object} [options] Optional Parameters. * @@ -43507,14 +47458,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. + * {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 _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, options, callback) { +function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -43524,7 +47474,6 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43547,18 +47496,18 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo 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.'); } + 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.'); } @@ -43568,22 +47517,21 @@ 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}/publicCertificates/{publicCertificateName}'; 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(apiVersion)); + 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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -43608,7 +47556,7 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo 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); @@ -43636,32 +47584,16 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo // 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['ProcessThreadInfo']().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 public certificates for an app or a deployment slot. + * @summary Gets the publishing profile for an app (or deployment slot, if + * specified). * - * Get public certificates for an app or a deployment slot. + * 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. @@ -43669,10 +47601,15 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo * @param {string} name Name of the app. * * @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 will get the publishing profile for the production slot. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -43683,14 +47620,12 @@ 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 - * 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 _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -43700,7 +47635,7 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; + let format = (options && options.format !== undefined) ? options.format : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43729,29 +47664,40 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal 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 (format !== null && format !== undefined && typeof format.valueOf() !== 'string') { + throw new Error('format 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); } + let publishingProfileOptions; + if (format !== null && format !== undefined) { + publishingProfileOptions = new client.models['CsmPublishingProfileOptions'](); + publishingProfileOptions.format = format; + } // 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}/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(apiVersion)); + 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 @@ -43769,29 +47715,46 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal } } } - httpRequest.body = null; + // 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(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; - 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) { @@ -43801,37 +47764,19 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal } 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); - } - } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } /** - * @summary Get the named public certificate for an app (or deployment slot, if - * specified). + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * Get the named public certificate for an app (or deployment slot, if - * specified). + * 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. @@ -43839,9 +47784,7 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal * @param {string} name Name of the app. * * @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} publicCertificateName Public certificate name. + * specified, the API resets configuration settings for the production slot. * * @param {object} [options] Optional Parameters. * @@ -43854,14 +47797,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. + * {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 _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, callback) { +function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -43871,7 +47813,6 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43897,12 +47838,12 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific 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.'); } + 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.'); } @@ -43912,21 +47853,20 @@ 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}/resetSlotConfig'; 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(apiVersion)); + 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 @@ -43979,56 +47919,34 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific // 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. + * @summary Restarts an app (or deployment slot, if specified). * - * Creates a hostname binding for an app. + * Restarts 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} 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 will restart the production slot. * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.softRestart] Specify true to apply the + * configuration settings and restarts the app only if necessary. By default, + * the API always restarts and reprovisions the app. + * + * @param {boolean} [options.synchronous] Specify true to block until the app + * is restarted. By default, it is set to false, and the API responds + * immediately (asynchronous). + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -44038,14 +47956,13 @@ 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. + * {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 _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCertificateName, publicCertificate, slot, options, callback) { +function _restartSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -44055,7 +47972,8 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; + let softRestart = (options && options.softRestart !== undefined) ? options.softRestart : undefined; + let synchronous = (options && options.synchronous !== undefined) ? options.synchronous : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -44078,18 +47996,21 @@ 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.'); } + if (softRestart !== null && softRestart !== undefined && typeof softRestart !== 'boolean') { + throw new Error('softRestart must be of type boolean.'); + } + if (synchronous !== null && synchronous !== undefined && typeof synchronous !== 'boolean') { + throw new Error('synchronous must be of type boolean.'); + } 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.'); } @@ -44099,21 +48020,26 @@ 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}/restart'; 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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (softRestart !== null && softRestart !== undefined) { + queryParameters.push('softRestart=' + encodeURIComponent(softRestart.toString())); + } + if (synchronous !== null && synchronous !== undefined) { + queryParameters.push('synchronous=' + encodeURIComponent(synchronous.toString())); + } + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -44131,21 +48057,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) { @@ -44180,42 +48092,148 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer // 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 Deletes a hostname binding for an app. + * @summary Restores an app from a backup blob in Azure Storage. * - * Deletes a hostname binding for an app. + * Restores an app from a backup blob in Azure Storage. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * * @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 will restore a backup of the production slot. * - * @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. + * + * {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 _restoreFromBackupBlobSlot(resourceGroupName, name, request, 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.beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, 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 + + 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 {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. * @@ -44234,7 +48252,179 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, callback) { +function _restoreFromDeletedAppSlot(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.'); + } + + // Send request + this.beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, 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 + + 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 {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 _restoreSnapshotSlot(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.'); + } + + // Send request + this.beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, 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 + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, 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 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 _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -44244,7 +48434,6 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -44270,12 +48459,12 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti 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.'); } + 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.'); } @@ -44285,21 +48474,20 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti // 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}/siteextensions'; 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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -44324,7 +48512,7 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti 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); @@ -44352,32 +48540,47 @@ 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['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 the publishing profile for an app (or deployment slot, if - * specified). + * @summary Get site extension information by its ID for a web site, or a + * deployment slot. * - * Gets the publishing profile for an app (or deployment slot, if specified). + * Get site extension information by its ID for 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 the app. + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. * * @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 deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -44388,12 +48591,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 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 _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, options, callback) { +function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -44403,8 +48607,6 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, if (!callback) { throw new Error('callback cannot be null.'); } - let format = (options && options.format !== undefined) ? options.format : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -44427,14 +48629,17 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, 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 (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.'); } 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 (format !== null && format !== undefined && typeof format.valueOf() !== 'string') { - throw new Error('format 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.'); @@ -44442,28 +48647,24 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, } catch (error) { return callback(error); } - let publishingProfileOptions; - if (format !== null && format !== undefined) { - publishingProfileOptions = new client.models['CsmPublishingProfileOptions'](); - publishingProfileOptions.format = format; - } // 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}/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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -44481,38 +48682,22 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, } } } - // 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; + 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) { - let error = new Error(`Unexpected status code: ${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 { - 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; @@ -44529,58 +48714,46 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, } 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['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); + } + } + return callback(null, result, httpRequest, response); }); } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Install site extension on a web site, or a deployment slot. * - * Recovers a web app to a previous snapshot. + * 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} name Site name. * - * @param {string} [recoveryEntity.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. * @@ -44593,13 +48766,14 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, 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 _recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, callback) { +function _installSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -44612,7 +48786,7 @@ function _recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, ca } // Send request - this.beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, parsedResult, httpRequest, response) => { + this.beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -44631,6 +48805,20 @@ function _recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, ca 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['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); + } return callback(null, result, httpRequest, response); }); @@ -44638,19 +48826,19 @@ function _recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, ca } /** - * @summary Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * @summary Remove a site extension from a web site, or a deployment slot. * - * Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * Remove a site extension from 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 the app. + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. * * @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 deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -44669,7 +48857,7 @@ function _recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, ca * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, callback) { +function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -44679,7 +48867,6 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -44702,12 +48889,18 @@ function _resetSlotConfigurationSlot(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 (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.'); } 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.'); } @@ -44717,20 +48910,21 @@ 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}/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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -44755,7 +48949,7 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -44789,27 +48983,29 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal } /** - * @summary Restarts an app (or deployment slot, if specified). + * @summary Get the difference in configuration settings between two web app + * slots. * - * Restarts an app (or deployment slot, if specified). + * 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 {string} slot Name of the deployment slot. If a slot is not - * specified, the API will restart the production slot. + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. * - * @param {object} [options] Optional Parameters. + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. * - * @param {boolean} [options.softRestart] Specify true to apply the - * configuration settings and restarts the app only if necessary. By default, - * the API always restarts and reprovisions the app. + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. * - * @param {boolean} [options.synchronous] Specify true to block until the app - * is restarted. By default, it is set to false, and the API responds - * immediately (asynchronous). + * @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 @@ -44820,13 +49016,15 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal * * {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 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 _restartSlot(resourceGroupName, name, slot, options, callback) { +function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -44836,9 +49034,6 @@ function _restartSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let softRestart = (options && options.softRestart !== undefined) ? options.softRestart : undefined; - let synchronous = (options && options.synchronous !== undefined) ? options.synchronous : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -44861,18 +49056,18 @@ function _restartSlot(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 (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 (softRestart !== null && softRestart !== undefined && typeof softRestart !== 'boolean') { - throw new Error('softRestart must be of type boolean.'); - } - if (synchronous !== null && synchronous !== undefined && typeof synchronous !== 'boolean') { - throw new Error('synchronous must be of type boolean.'); - } 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.'); } @@ -44882,19 +49077,13 @@ function _restartSlot(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}/restart'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs'; 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 (softRestart !== null && softRestart !== undefined) { - queryParameters.push('softRestart=' + encodeURIComponent(softRestart.toString())); - } - if (synchronous !== null && synchronous !== undefined) { - queryParameters.push('synchronous=' + encodeURIComponent(synchronous.toString())); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -44919,7 +49108,21 @@ function _restartSlot(resourceGroupName, name, slot, 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) { @@ -44936,12 +49139,13 @@ function _restartSlot(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) { @@ -44954,23 +49158,117 @@ function _restartSlot(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['SlotDifferenceCollection']().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 siteextensions for a web site, or a deployment slot. + * @summary Swaps two deployment slots of an app. * - * Get list of siteextensions for a web site, or a deployment slot. + * Swaps two deployment slots 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} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * @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} 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 _swapSlotSlot(resourceGroupName, name, slotSwapEntity, 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.beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, 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 + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @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. * @@ -44984,14 +49282,13 @@ function _restartSlot(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 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 _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callback) { +function _listSnapshotsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -45001,7 +49298,6 @@ function _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -45030,6 +49326,9 @@ function _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callbac 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.'); } @@ -45039,13 +49338,13 @@ function _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callbac // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -45077,7 +49376,7 @@ function _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callbac 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); @@ -45087,12 +49386,13 @@ function _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callbac 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) { @@ -45112,7 +49412,7 @@ function _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callbac 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['SnapshotCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -45128,21 +49428,18 @@ function _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callbac } /** - * @summary Get site extension information by its ID for a web site, or a - * deployment slot. + * @summary Gets the source control configuration of an app. * - * Get site extension information by its ID for a web site, or a deployment - * slot. + * Gets 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} siteExtensionId Site extension 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 get the source control configuration for the + * production slot. * * @param {object} [options] Optional Parameters. * @@ -45156,13 +49453,13 @@ function _listSiteExtensionsSlot(resourceGroupName, name, slot, 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 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 _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { +function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -45172,7 +49469,6 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -45195,15 +49491,15 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, 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 (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.'); } 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.'); } @@ -45213,14 +49509,13 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, 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}/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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -45252,7 +49547,7 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, o return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -45262,12 +49557,13 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, 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) { @@ -45287,7 +49583,7 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, o 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) { @@ -45297,6 +49593,40 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, o 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); }); @@ -45304,19 +49634,40 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, o /** - * @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. * @@ -45330,13 +49681,13 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, 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 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 _installSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { +function _createOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -45349,7 +49700,7 @@ function _installSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slo } // Send request - this.beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, (err, parsedResult, httpRequest, response) => { + this.beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -45373,7 +49724,7 @@ function _installSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slo 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) { @@ -45389,19 +49740,18 @@ function _installSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slo } /** - * @summary Remove a site extension from a web site, or a deployment slot. + * @summary Deletes the source control configuration of an app. * - * Remove a site extension from a web site, or a deployment slot. + * Deletes 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} siteExtensionId Site extension 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 delete the source control configuration for the + * production slot. * * @param {object} [options] Optional Parameters. * @@ -45420,7 +49770,7 @@ function _installSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slo * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { +function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -45430,7 +49780,6 @@ function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -45453,15 +49802,15 @@ function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, 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 (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.'); } 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.'); } @@ -45471,14 +49820,13 @@ function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot // 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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -45510,7 +49858,7 @@ function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -45544,27 +49892,40 @@ function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot } /** - * @summary Get the difference in configuration settings between two web app - * slots. + * @summary Updates the source control configuration of an app. * - * Get the difference in configuration settings between two web app slots. + * 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} slotSwapEntity JSON object that contains the target slot - * name. See example. + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. * - * @param {string} slotSwapEntity.targetSlot Destination deployment slot during - * swap operation. + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. * - * @param {boolean} slotSwapEntity.preserveVnet true to preserve - * Virtual Network to the slot during swap; otherwise, false. + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. * - * @param {string} slot Name of the source slot. If a slot is not specified, - * the production slot is used as the source slot. + * @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. * @@ -45578,14 +49939,13 @@ function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, 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 SlotDifferenceCollection} 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 _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, callback) { +function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -45595,7 +49955,6 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -45618,8 +49977,8 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, 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 (slotSwapEntity === null || slotSwapEntity === undefined) { - throw new Error('slotSwapEntity cannot be null or undefined.'); + 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.'); @@ -45627,6 +49986,9 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, 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.'); } @@ -45636,20 +49998,20 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs'; + 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)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -45671,14 +50033,14 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, 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'); + 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(slotSwapEntity, null, 2)}.`); + `payload - ${JSON.stringify(siteSourceControl, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -45688,7 +50050,7 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, 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); @@ -45698,12 +50060,13 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, 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) { @@ -45723,7 +50086,7 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, 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['SiteSourceControl']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -45733,33 +50096,57 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, 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 Swaps two deployment slots of an app. + * @summary Starts an app (or deployment slot, if specified). * - * Swaps two deployment slots of an app. + * 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} 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 {string} slot Name of the deployment slot. If a slot is not + * specified, the API will start the production slot. * * @param {object} [options] Optional Parameters. * @@ -45778,75 +50165,7 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _swapSlotSlot(resourceGroupName, name, slotSwapEntity, 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.beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, 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 - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * @summary Returns all Snapshots to the user. - * - * Returns all Snapshots to the user. - * - * @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 {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 _listSnapshotsSlot(resourceGroupName, name, slot, options, callback) { +function _startSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -45856,7 +50175,6 @@ function _listSnapshotsSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -45885,6 +50203,9 @@ function _listSnapshotsSlot(resourceGroupName, name, slot, options, callback) { 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.'); } @@ -45894,20 +50215,20 @@ function _listSnapshotsSlot(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}/snapshots'; + 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)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 @@ -45960,32 +50281,15 @@ function _listSnapshotsSlot(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['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. + * @summary Stops an app (or deployment slot, if specified). * - * Gets the source control configuration of an app. + * Stops an app (or deployment slot, if specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -45993,8 +50297,7 @@ function _listSnapshotsSlot(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 the source control configuration for the - * production slot. + * specified, the API will stop the production slot. * * @param {object} [options] Optional Parameters. * @@ -46007,14 +50310,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. + * {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 _getSourceControlSlot(resourceGroupName, name, slot, options, callback) { +function _stopSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -46024,7 +50326,6 @@ function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46053,6 +50354,9 @@ function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) 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.'); } @@ -46062,20 +50366,20 @@ 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}/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(apiVersion)); + 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 @@ -46100,7 +50404,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); @@ -46128,182 +50432,23 @@ function _getSourceControlSlot(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 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 {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 - * 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 _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. + * @summary Sync web app repository. * - * Deletes the source control configuration of an app. + * 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 delete the source control configuration 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. * @@ -46322,7 +50467,7 @@ function _createOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceCon * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callback) { +function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -46332,7 +50477,6 @@ function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46361,6 +50505,9 @@ function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callba 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.'); } @@ -46370,20 +50517,20 @@ function _deleteSourceControlSlot(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}/sourcecontrols/web'; + 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)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -46408,7 +50555,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) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -46442,40 +50589,168 @@ function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callba } /** - * @summary Updates the source control configuration of an app. + * @summary Syncs function trigger metadata to the scale controller * - * Updates the source control configuration of an app. + * Syncs function trigger metadata to the scale controller * * @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} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. * - * @param {string} [siteSourceControl.repoUrl] Repository or source control - * URL. + * @param {object} [options] Optional Parameters. * - * @param {string} [siteSourceControl.branch] Name of branch to use for - * deployment. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [siteSourceControl.isManualIntegration] true - * to limit to manual integration; false to enable continuous - * integration (which configures webhooks into online repos like GitHub). + * @param {function} callback - The callback. * - * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] - * true to enable deployment rollback; otherwise, - * false. + * @returns {function} callback(err, result, request, response) * - * @param {boolean} [siteSourceControl.isMercurial] true for a - * Mercurial repository; false for a Git repository. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} [siteSourceControl.kind] Kind of resource. + * {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 _syncFunctionTriggersSlot(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}/syncfunctiontriggers'; + 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 !== 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 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 will update the source control configuration for the - * production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -46489,13 +50764,14 @@ function _deleteSourceControlSlot(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 SiteSourceControl} 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 _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, callback) { +function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -46505,7 +50781,6 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46528,15 +50803,15 @@ 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.'); } 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.'); } @@ -46546,20 +50821,20 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl // 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}/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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -46577,28 +50852,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) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -46608,12 +50869,13 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl 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) { @@ -46633,7 +50895,7 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl 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['TriggeredWebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -46643,40 +50905,26 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl 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); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Starts an app (or deployment slot, if specified). + * @summary Gets a triggered web job by its ID for an app, or a deployment + * slot. * - * Starts an app (or deployment slot, if specified). + * 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. * - * @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 start the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -46689,13 +50937,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 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 _startSlot(resourceGroupName, name, slot, options, callback) { +function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -46705,7 +50954,6 @@ function _startSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46728,12 +50976,18 @@ 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 (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.'); } @@ -46743,20 +50997,21 @@ 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}/triggeredwebjobs/{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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -46781,7 +51036,7 @@ function _startSlot(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); @@ -46809,23 +51064,43 @@ 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['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 Stops an app (or deployment slot, if specified). + * @summary Delete a triggered web job by its ID for an app, or a deployment + * slot. * - * Stops an app (or deployment slot, if specified). + * 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 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 stop the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -46844,7 +51119,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 _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -46854,7 +51129,6 @@ function _stopSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46877,12 +51151,18 @@ function _stopSlot(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 (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.'); } @@ -46892,20 +51172,21 @@ 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}/triggeredwebjobs/{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(apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -46930,7 +51211,7 @@ function _stopSlot(resourceGroupName, name, slot, 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); @@ -46964,17 +51245,20 @@ function _stopSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Sync web app repository. + * @summary List a triggered web job's history for an app, or a deployment + * slot. * - * Sync web app repository. + * 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. * - * @param {string} name Name of web app. + * @param {string} name Site name. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -46987,13 +51271,15 @@ function _stopSlot(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. + * {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 _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { +function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47003,7 +51289,6 @@ function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47026,12 +51311,18 @@ function _syncRepositorySlot(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 (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.'); } @@ -47041,20 +51332,21 @@ 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}/triggeredwebjobs/{webJobName}/history'; 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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -47079,7 +51371,7 @@ function _syncRepositorySlot(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); @@ -47107,23 +51399,46 @@ function _syncRepositorySlot(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['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 Syncs function trigger metadata to the scale controller + * @summary Gets a triggered web job's history by its ID for an app, , or a + * deployment slot. * - * Syncs function trigger metadata to the scale controller + * 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 {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 will restore a backup of the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -47136,13 +51451,14 @@ function _syncRepositorySlot(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. + * {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 _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callback) { +function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47152,7 +51468,6 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47175,12 +51490,21 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, 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 (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.'); } 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.'); } @@ -47190,20 +51514,22 @@ 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}/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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -47228,7 +51554,7 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callb return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -47256,21 +51582,40 @@ function _syncFunctionTriggersSlot(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['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 List triggered web jobs for an app, or a deployment slot. + * @summary Run a triggered web job for an app, or a deployment slot. * - * List triggered web jobs 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. * @@ -47285,15 +51630,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 _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47303,7 +51646,6 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47326,12 +51668,18 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, 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 (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.'); } @@ -47341,20 +51689,21 @@ 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}/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(apiVersion)); + 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 @@ -47379,7 +51728,7 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb 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); @@ -47407,46 +51756,34 @@ 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 Gets the quota usage information of an app (or deployment slot, if + * specified). * - * Gets a triggered web job by its ID for an app, or a deployment slot. + * 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 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 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 * @@ -47457,13 +51794,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 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 _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47473,7 +51811,7 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; + let filter = (options && options.filter !== undefined) ? options.filter : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47496,15 +51834,18 @@ 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.'); } + 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.'); } + 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.'); } @@ -47514,14 +51855,16 @@ 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}/usages'; 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(apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -47553,7 +51896,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); @@ -47563,12 +51906,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) { @@ -47588,7 +51932,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['CsmUsageQuotaCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -47604,20 +51948,19 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti } /** - * @summary Delete a triggered web job by its ID for an app, or a deployment - * slot. + * @summary Gets the virtual networks the app (or deployment slot) is connected + * to. * - * Delete a triggered web job by its ID for an app, or a deployment slot. + * 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 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 get virtual network connections for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -47630,13 +51973,13 @@ 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. + * {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 _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47646,7 +51989,6 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47669,15 +52011,15 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, 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 (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.'); } @@ -47687,21 +52029,20 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, 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}/triggeredwebjobs/{webJobName}'; + 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('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -47726,7 +52067,7 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, o 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); @@ -47736,12 +52077,13 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, 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) { @@ -47754,26 +52096,58 @@ 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 = { + 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 List a triggered web job's history for an app, or a deployment - * slot. + * @summary Gets a virtual network the app (or deployment slot) is connected to + * by name. * - * List a triggered web job's history for an app, or a deployment slot. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @param {string} vnetName Name of the virtual network. * * @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 get the named virtual network for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -47787,14 +52161,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. + * 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 _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47804,7 +52177,6 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47827,8 +52199,8 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, 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 (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 (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); @@ -47836,6 +52208,9 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl 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.'); } @@ -47845,14 +52220,14 @@ 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}/virtualNetworkConnections/{vnetName}'; 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('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -47884,7 +52259,7 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl 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); @@ -47894,12 +52269,13 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl 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) { @@ -47919,7 +52295,7 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl 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['VnetInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -47935,23 +52311,36 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl } /** - * @summary Gets a triggered web job's history by its ID for an app, , or a - * deployment slot. + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). * - * Gets a triggered web job's history by its ID for an app, , or a deployment - * slot. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @param {string} vnetName Name of an existing Virtual Network. * - * @param {string} id History ID. + * @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} 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 add or update connections for the production slot. * * @param {object} [options] Optional Parameters. * @@ -47965,13 +52354,13 @@ 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 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 _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, slot, options, callback) { +function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47981,7 +52370,6 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48004,11 +52392,11 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, 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 (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 (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.'); @@ -48016,6 +52404,9 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, 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.'); } @@ -48025,22 +52416,21 @@ 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}/virtualNetworkConnections/{vnetName}'; 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('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -48058,14 +52448,28 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, } } } - httpRequest.body = null; + // 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; // 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); @@ -48075,12 +52479,13 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, 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) { @@ -48100,7 +52505,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['VnetInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -48116,19 +52521,21 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, } /** - * @summary Run a triggered web job for an app, or a deployment slot. + * @summary Deletes a connection from an app (or deployment slot to a named + * virtual network. * - * Run a triggered web job for an app, or a deployment slot. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @param {string} vnetName Name of the virtual network. * * @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 delete the connection for the production slot. * * @param {object} [options] Optional Parameters. * @@ -48147,7 +52554,7 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -48157,7 +52564,6 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48180,8 +52586,8 @@ function _runTriggeredWebJobSlot(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 (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.'); @@ -48189,6 +52595,9 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti 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.'); } @@ -48198,21 +52607,21 @@ 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}/virtualNetworkConnections/{vnetName}'; 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('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -48271,28 +52680,39 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti } /** - * @summary Gets the quota usage information of an app (or deployment slot, if - * specified). + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). * - * Gets the quota usage information of an app (or deployment slot, if - * specified). + * 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 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} 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 will add or update connections 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 * @@ -48303,14 +52723,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. + * 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 _listUsagesSlot(resourceGroupName, name, slot, options, callback) { +function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -48320,8 +52739,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; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48344,15 +52761,21 @@ 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 (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.'); } - 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.'); } + 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.'); } @@ -48362,23 +52785,21 @@ 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}/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 = []; - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + filter); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -48396,7 +52817,21 @@ function _listUsagesSlot(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['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; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -48413,12 +52848,13 @@ function _listUsagesSlot(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) { @@ -48438,7 +52874,7 @@ function _listUsagesSlot(resourceGroupName, name, slot, 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['VnetInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -48454,19 +52890,23 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Gets the virtual networks the app (or deployment slot) is connected - * to. + * @summary Gets an app's Virtual Network gateway. * - * Gets the virtual networks the app (or deployment slot) is connected to. + * Gets an app's Virtual Network gateway. * * @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} 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 a gateway for the production slot's Virtual + * Network. * * @param {object} [options] Optional Parameters. * @@ -48479,13 +52919,14 @@ 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 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 _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callback) { +function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -48495,7 +52936,6 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48518,12 +52958,21 @@ function _listVnetConnectionsSlot(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 (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.'); } 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.'); } @@ -48533,13 +52982,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}/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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -48571,7 +53022,7 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba 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); @@ -48606,21 +53057,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['VnetGateway']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -48636,21 +53073,34 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba } /** - * @summary Gets a virtual network the app (or deployment slot) is connected to - * by name. + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). * - * Gets a virtual network the app (or deployment slot) is connected to by name. + * 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 Name of the app. * - * @param {string} vnetName Name of the virtual network. + * @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 will get the named virtual network 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. * @@ -48664,13 +53114,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. + * 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 _getVnetConnectionSlot(resourceGroupName, name, vnetName, 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') { @@ -48680,7 +53130,6 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48706,12 +53155,21 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options 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.'); } 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.'); } @@ -48721,21 +53179,22 @@ 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/{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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -48753,7 +53212,21 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options } } } - 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) { @@ -48770,12 +53243,13 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, 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) { @@ -48795,7 +53269,7 @@ 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 = new client.models['VnetGateway']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -48811,36 +53285,34 @@ 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 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). + * 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 Name of the app. * - * @param {string} vnetName Name of an existing Virtual Network. + * @param {string} vnetName Name of the Virtual Network. * - * @param {object} connectionEnvelope Properties of the Virtual Network - * connection. See example. + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". * - * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's - * resource ID. + * @param {object} connectionEnvelope The properties to update this gateway + * with. * - * @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.vnetName] The Virtual Network name. * - * @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.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 connections 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. * @@ -48854,13 +53326,13 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, 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 VnetInfo} 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 _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, 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') { @@ -48870,7 +53342,6 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48896,6 +53367,9 @@ 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 (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.'); } @@ -48905,6 +53379,9 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co 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.'); } @@ -48914,21 +53391,22 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co // 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/{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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -48951,7 +53429,7 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co let requestModel = null; try { if (connectionEnvelope !== null && connectionEnvelope !== undefined) { - let requestModelMapper = new client.models['VnetInfo']().mapper(); + let requestModelMapper = new client.models['VnetGateway']().mapper(); requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); requestContent = JSON.stringify(requestModel); } @@ -48977,12 +53455,13 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co 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) { @@ -49002,7 +53481,7 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co 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['VnetGateway']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -49018,21 +53497,17 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co } /** - * @summary Deletes a connection from an app (or deployment slot to a named - * virtual network. + * @summary List webjobs for an app, or a deployment slot. * - * Deletes a connection from an app (or deployment slot to a named virtual - * network. + * 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 {string} vnetName Name of the virtual network. + * @param {string} name Site name. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete the connection for the production slot. + * specified, the API returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -49045,13 +53520,14 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co * * {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 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 _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, callback) { +function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -49061,7 +53537,6 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49084,15 +53559,15 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, 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 (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.'); } @@ -49102,21 +53577,20 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, 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}/virtualNetworkConnections/{vnetName}'; + 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('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -49141,7 +53615,7 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, 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); @@ -49151,12 +53625,13 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, 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) { @@ -49169,42 +53644,42 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, 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['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 Adds a Virtual Network connection to an app or slot (PUT) or - * updates the connection properties (PATCH). + * @summary Get webjob information for an app, or a deployment slot. * - * Adds a Virtual Network connection to an app or slot (PUT) or updates the - * connection properties (PATCH). + * 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 {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} name Site name. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} webJobName Name of the web job. * * @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 returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -49218,13 +53693,13 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, 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 VnetInfo} 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 _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, callback) { +function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -49234,7 +53709,6 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49257,11 +53731,8 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection 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 (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.'); @@ -49269,6 +53740,9 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection 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.'); } @@ -49278,21 +53752,21 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection // 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}/webjobs/{webJobName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + 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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -49310,21 +53784,7 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection } } } - // 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) { @@ -49341,12 +53801,13 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection 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) { @@ -49366,7 +53827,7 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection 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['WebJob']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -49382,23 +53843,24 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection } /** - * @summary Gets an app's Virtual Network gateway. + * @summary Get the difference in configuration settings between two web app + * slots. * - * Gets an app's Virtual Network gateway. + * 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 {string} vnetName Name of the Virtual Network. + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. * - * @param {string} gatewayName Name of the gateway. Currently, the only - * supported string is "primary". + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. * - * @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. + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. * * @param {object} [options] Optional Parameters. * @@ -49412,13 +53874,14 @@ 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. + * 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 _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, slot, options, callback) { +function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -49428,7 +53891,6 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49451,18 +53913,15 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa 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 (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 (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 (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.'); } @@ -49472,22 +53931,19 @@ 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}/slotsdiffs'; 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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 @@ -49505,14 +53961,28 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa } } } - 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 !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -49522,12 +53992,13 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa 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) { @@ -49547,7 +54018,7 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa 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['SlotDifferenceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -49562,35 +54033,90 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa }); } + /** - * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it - * (PATCH). + * @summary Swaps two deployment slots of an app. * - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * 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 {string} vnetName Name of the Virtual Network. + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. * - * @param {string} gatewayName Name of the gateway. Currently, the only - * supported string is "primary". + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. * - * @param {object} connectionEnvelope The properties to update this gateway - * with. + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. * - * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * @param {object} [options] Optional Parameters. * - * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN - * package can be downloaded. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {function} callback - The callback. * - * @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. + * @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} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. * * @param {object} [options] Optional Parameters. * @@ -49604,13 +54130,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 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 _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options, callback) { +function _listSnapshots(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -49620,7 +54146,6 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49643,21 +54168,12 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN 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.'); - } 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.'); } @@ -49667,22 +54183,19 @@ 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}/snapshots'; 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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -49700,21 +54213,7 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN } } } - // 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) { @@ -49731,12 +54230,13 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN 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) { @@ -49756,7 +54256,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['SnapshotCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -49772,35 +54272,15 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN } /** - * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it - * (PATCH). + * @summary Gets the source control configuration of an app. * - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * 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 {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 will add or update a gateway for the production slot's - * Virtual Network. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -49813,13 +54293,13 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN * {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 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 _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options, callback) { +function _getSourceControl(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -49829,7 +54309,6 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49852,21 +54331,12 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat 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.'); - } 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.'); } @@ -49876,22 +54346,19 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat // 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}/sourcecontrols/web'; 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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -49909,28 +54376,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 !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -49940,12 +54393,13 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat 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) { @@ -49965,7 +54419,144 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat 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['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) { @@ -49974,24 +54565,21 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } - } - return callback(null, result, httpRequest, response); + return callback(null, result, httpRequest, response); + }); }); } /** - * @summary List webjobs for an app, or a deployment slot. + * @summary Deletes the source control configuration of an app. * - * List webjobs for an app, or a deployment slot. + * Deletes 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} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -50004,14 +54592,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. + * {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 _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { +function _deleteSourceControl(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50021,7 +54608,6 @@ function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -50044,12 +54630,12 @@ 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 (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.'); } @@ -50059,20 +54645,19 @@ 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}/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(apiVersion)); + 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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -50097,7 +54682,7 @@ function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -50125,42 +54710,42 @@ function _listWebJobsSlot(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['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. + * @summary Updates the source control configuration of an app. * - * Get webjob information for an app, 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} webJobName Name of the web job. + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. + * @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. * @@ -50174,13 +54759,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 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 _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _updateSourceControl(resourceGroupName, name, siteSourceControl, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50190,7 +54775,6 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -50213,15 +54797,15 @@ 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 (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 (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 (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.'); } @@ -50231,21 +54815,19 @@ 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}/sourcecontrols/web'; 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(apiVersion)); + 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 = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -50263,14 +54845,28 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call } } } - 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); @@ -50280,12 +54876,13 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, 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) { @@ -50305,7 +54902,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['SiteSourceControl']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -50315,31 +54912,55 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call 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 Get the difference in configuration settings between two web app - * slots. + * @summary Starts an app (or deployment slot, if specified). * - * Get the difference in configuration settings between two web app slots. + * 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} 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 @@ -50351,15 +54972,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. + * {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 _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, options, callback) { +function _start(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50369,7 +54988,6 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -50392,12 +55010,12 @@ 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 (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.'); } @@ -50407,12 +55025,12 @@ 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}/start'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -50437,21 +55055,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) { @@ -50486,48 +55090,21 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt // 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['SlotDifferenceCollection']().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 Swaps two deployment slots of an app. + * @summary Stops an app (or deployment slot, if specified). * - * Swaps two deployment slots of an app. + * 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 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 @@ -50545,73 +55122,7 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt * * {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} 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 _listSnapshots(resourceGroupName, name, options, callback) { +function _stop(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50621,7 +55132,6 @@ function _listSnapshots(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -50647,6 +55157,9 @@ function _listSnapshots(resourceGroupName, name, options, callback) { 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.'); } @@ -50656,19 +55169,19 @@ 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}/stop'; 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(apiVersion)); + 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 @@ -50721,37 +55234,20 @@ function _listSnapshots(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['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. + * @summary Sync web app repository. * - * Gets the source control configuration of an app. + * 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. * @@ -50764,14 +55260,13 @@ 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. + * {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 _getSourceControl(resourceGroupName, name, options, callback) { +function _syncRepository(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50781,7 +55276,6 @@ function _getSourceControl(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -50807,6 +55301,9 @@ function _getSourceControl(resourceGroupName, name, options, callback) { 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.'); } @@ -50816,19 +55313,19 @@ 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}/sync'; 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(apiVersion)); + 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 @@ -50853,7 +55350,7 @@ function _getSourceControl(resourceGroupName, name, 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); @@ -50881,169 +55378,15 @@ function _getSourceControl(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['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. + * @summary Syncs function trigger metadata to the scale controller * - * Deletes the source control configuration of an app. + * Syncs function trigger metadata to the scale controller * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -51067,7 +55410,7 @@ function _createOrUpdateSourceControl(resourceGroupName, name, siteSourceControl * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteSourceControl(resourceGroupName, name, options, callback) { +function _syncFunctionTriggers(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -51077,7 +55420,6 @@ function _deleteSourceControl(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51103,6 +55445,9 @@ function _deleteSourceControl(resourceGroupName, name, options, callback) { 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.'); } @@ -51112,19 +55457,19 @@ function _deleteSourceControl(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}/syncfunctiontriggers'; 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(apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -51149,7 +55494,7 @@ function _deleteSourceControl(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 404) { + if (statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -51183,36 +55528,14 @@ function _deleteSourceControl(resourceGroupName, name, options, callback) { } /** - * @summary Updates the source control configuration of an app. + * @summary List triggered web jobs for an app, or a deployment slot. * - * Updates the source control configuration of an app. + * 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 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} name Site name. * * @param {object} [options] Optional Parameters. * @@ -51226,13 +55549,14 @@ function _deleteSourceControl(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 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 _updateSourceControl(resourceGroupName, name, siteSourceControl, options, callback) { +function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -51242,7 +55566,6 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51265,12 +55588,12 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, 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 (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 (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.'); } @@ -51280,19 +55603,19 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option // 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}/triggeredwebjobs'; 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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -51310,28 +55633,14 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option } } } - // 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) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -51341,12 +55650,13 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option 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) { @@ -51366,7 +55676,7 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option 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['TriggeredWebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -51376,37 +55686,23 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option 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); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Starts an app (or deployment slot, if specified). + * @summary Gets a triggered web job by its ID for an app, or a deployment + * slot. * - * Starts an app (or deployment slot, if specified). + * 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. * - * @param {string} name Name of the app. + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -51419,13 +55715,14 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option * * {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 _start(resourceGroupName, name, options, callback) { +function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -51435,7 +55732,6 @@ function _start(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51458,9 +55754,15 @@ function _start(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.'); } + 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.'); } @@ -51470,19 +55772,20 @@ function _start(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}/start'; + 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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -51507,7 +55810,7 @@ function _start(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); @@ -51535,162 +55838,40 @@ function _start(resourceGroupName, name, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary Stops 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. - * - * @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 _stop(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.'); - } - let apiVersion = '2016-08-01'; - // 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.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}/stop'; - 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(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); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; + // Deserialize Response + if (statusCode === 200) { + 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 = new client.models['TriggeredWebJob']().mapper(); + 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); }); } /** - * @summary Sync web app repository. + * @summary Delete a triggered web job by its ID for an app, or a deployment + * slot. * - * Sync web app repository. + * 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 Name of web app. + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -51709,7 +55890,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 _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -51719,7 +55900,6 @@ function _syncRepository(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51742,9 +55922,15 @@ function _syncRepository(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.'); } + 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.'); } @@ -51754,19 +55940,20 @@ 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}/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(apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -51791,7 +55978,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); @@ -51825,14 +56012,17 @@ function _syncRepository(resourceGroupName, name, options, callback) { } /** - * @summary Syncs function trigger metadata to the scale controller + * @summary List a triggered web job's history for an app, or a deployment + * slot. * - * Syncs function trigger metadata to the scale controller + * 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. * - * @param {string} name Name of the app. + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -51845,13 +56035,15 @@ function _syncRepository(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} [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 _syncFunctionTriggers(resourceGroupName, name, options, callback) { +function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -51861,7 +56053,6 @@ function _syncFunctionTriggers(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51884,9 +56075,15 @@ function _syncFunctionTriggers(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.'); } + 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.'); } @@ -51896,19 +56093,20 @@ 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}/triggeredwebjobs/{webJobName}/history'; 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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -51933,7 +56131,7 @@ function _syncFunctionTriggers(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -51961,21 +56159,44 @@ function _syncFunctionTriggers(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['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 List triggered web jobs 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. * - * List triggered web jobs 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. * * @param {string} name Site name. * + * @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 @@ -51988,14 +56209,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. + * 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 _listTriggeredWebJobs(resourceGroupName, name, options, callback) { +function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52005,7 +56225,6 @@ function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52028,9 +56247,18 @@ function _listTriggeredWebJobs(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 (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.'); } + 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.'); } @@ -52040,12 +56268,14 @@ 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}/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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -52077,7 +56307,7 @@ function _listTriggeredWebJobs(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); @@ -52112,7 +56342,7 @@ function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredWebJobCollection']().mapper(); + let resultMapper = new client.models['TriggeredJobHistory']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -52128,10 +56358,9 @@ function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { } /** - * @summary Gets a triggered web job by its ID for an app, or a deployment - * slot. + * @summary Run a triggered web job for an app, or a deployment slot. * - * Gets a triggered web job by its ID 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. @@ -52151,14 +56380,13 @@ 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. + * {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 _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { +function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52168,7 +56396,6 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52197,6 +56424,9 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb 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.'); } @@ -52206,20 +56436,20 @@ 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/{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(apiVersion)); + 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 @@ -52272,6 +56502,168 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb // Create Result let result = null; if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * 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 {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 + * + * @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 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 _listUsages(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.'); + } + let filter = (options && options.filter !== undefined) ? options.filter : 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 (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.'); + } + 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}/usages'; + 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('&'); + } + + // 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; @@ -52279,7 +56671,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['CsmUsageQuotaCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -52295,17 +56687,15 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb } /** - * @summary Delete a triggered web job by its ID for an app, or a deployment - * slot. + * @summary Gets the virtual networks the app (or deployment slot) is connected + * to. * - * Delete a triggered web job by its ID for an app, or a deployment slot. + * 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 Site name. - * - * @param {string} webJobName Name of Web Job. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -52318,13 +56708,13 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb * * {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 _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { +function _listVnetConnections(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52334,7 +56724,6 @@ function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52357,12 +56746,12 @@ function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, 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 (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.'); } @@ -52372,20 +56761,19 @@ function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, ca // 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}/virtualNetworkConnections'; 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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -52410,7 +56798,7 @@ function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, ca 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); @@ -52420,12 +56808,13 @@ function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, ca 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) { @@ -52438,23 +56827,54 @@ function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, ca // 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 List a triggered web job's history for an app, or a deployment - * slot. + * @summary Gets a virtual network the app (or deployment slot) is connected to + * by name. * - * List a triggered web job's history for an app, or a deployment slot. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @param {string} vnetName Name of the virtual network. * * @param {object} [options] Optional Parameters. * @@ -52468,14 +56888,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 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 _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, options, callback) { +function _getVnetConnection(resourceGroupName, name, vnetName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52485,7 +56904,6 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52508,12 +56926,15 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, 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 (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 (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.'); } @@ -52523,13 +56944,13 @@ 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}/virtualNetworkConnections/{vnetName}'; 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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -52561,7 +56982,7 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option 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); @@ -52571,12 +56992,13 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option 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) { @@ -52596,7 +57018,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['VnetInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -52612,20 +57034,33 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option } /** - * @summary Gets a triggered web job's history by its ID for an app, , or a - * deployment slot. + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). * - * Gets a triggered web job's history by its ID for an app, , or a deployment - * slot. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @param {string} vnetName Name of an existing Virtual Network. * - * @param {string} id History ID. + * @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. * @@ -52639,13 +57074,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. + * 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 _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, options, callback) { +function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52655,7 +57090,6 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52678,15 +57112,18 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt 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 (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 (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.'); } @@ -52696,21 +57133,20 @@ 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}/virtualNetworkConnections/{vnetName}'; 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('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -52728,14 +57164,28 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt } } } - httpRequest.body = null; + // 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; // 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); @@ -52745,12 +57195,13 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt 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) { @@ -52770,7 +57221,7 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt 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['VnetInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -52786,16 +57237,18 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt } /** - * @summary Run a triggered web job for an app, or a deployment slot. + * @summary Deletes a connection from an app (or deployment slot to a named + * virtual network. * - * Run a triggered web job for an app, or a deployment slot. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @param {string} vnetName Name of the virtual network. * * @param {object} [options] Optional Parameters. * @@ -52814,7 +57267,7 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { +function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52824,7 +57277,6 @@ function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52847,12 +57299,15 @@ function _runTriggeredWebJob(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 (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 (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.'); } @@ -52862,20 +57317,20 @@ 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}/virtualNetworkConnections/{vnetName}'; 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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -52934,24 +57389,35 @@ function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callb } /** - * @summary Gets the quota usage information of an app (or deployment slot, if - * specified). + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). * - * Gets the quota usage information of an app (or deployment slot, if - * specified). + * 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 {object} [options] Optional Parameters. + * @param {string} vnetName Name of an existing Virtual Network. * - * @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} 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 * request @@ -52963,14 +57429,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 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 _listUsages(resourceGroupName, name, options, callback) { +function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52980,8 +57445,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; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53004,12 +57467,18 @@ 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 (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.'); } + 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.'); } @@ -53019,22 +57488,20 @@ 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}/virtualNetworkConnections/{vnetName}'; 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(apiVersion)); + 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 = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -53052,7 +57519,21 @@ function _listUsages(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['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; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -53069,12 +57550,13 @@ function _listUsages(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) { @@ -53094,7 +57576,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['VnetInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -53110,16 +57592,20 @@ function _listUsages(resourceGroupName, name, options, callback) { } /** - * @summary Gets the virtual networks the app (or deployment slot) is connected - * to. + * @summary Gets an app's Virtual Network gateway. * - * Gets the virtual networks the app (or deployment slot) is connected to. + * Gets an app's Virtual Network gateway. * * @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 {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -53131,13 +57617,14 @@ 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. + * {object} [result] - The deserialized result object if an error did not occur. + * 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 _listVnetConnections(resourceGroupName, name, options, callback) { +function _getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53147,7 +57634,6 @@ function _listVnetConnections(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53170,9 +57656,18 @@ 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 (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.'); } + 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.'); } @@ -53182,12 +57677,14 @@ 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}/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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -53219,7 +57716,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); @@ -53254,21 +57751,7 @@ function _listVnetConnections(resourceGroupName, name, options, callback) { 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['VnetGateway']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -53284,17 +57767,30 @@ function _listVnetConnections(resourceGroupName, name, options, callback) { } /** - * @summary Gets a virtual network the app (or deployment slot) is connected to - * by name. + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * 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 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". * - * Gets a virtual network the app (or deployment slot) is connected to by name. + * @param {object} connectionEnvelope The properties to update this gateway + * with. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. * - * @param {string} name Name of the app. + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. * - * @param {string} vnetName Name of the virtual network. + * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -53308,13 +57804,13 @@ 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 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 _getVnetConnection(resourceGroupName, name, vnetName, options, callback) { +function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53324,7 +57820,6 @@ function _getVnetConnection(resourceGroupName, name, vnetName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53350,9 +57845,18 @@ function _getVnetConnection(resourceGroupName, name, vnetName, options, callback 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.'); } @@ -53362,20 +57866,21 @@ 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}/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(apiVersion)); + 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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -53393,7 +57898,21 @@ function _getVnetConnection(resourceGroupName, name, vnetName, 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) { @@ -53410,12 +57929,13 @@ function _getVnetConnection(resourceGroupName, name, vnetName, 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) { @@ -53435,7 +57955,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['VnetGateway']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -53451,31 +57971,28 @@ 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 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). + * 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 Name of the app. * - * @param {string} vnetName Name of an existing Virtual Network. + * @param {string} vnetName Name of the Virtual Network. * - * @param {object} connectionEnvelope Properties of the Virtual Network - * connection. See example. + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". * - * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's - * resource ID. + * @param {object} connectionEnvelope The properties to update this gateway + * with. * - * @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.vnetName] The Virtual Network name. * - * @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.vpnPackageUri The URI where the VPN + * package can be downloaded. * * @param {string} [connectionEnvelope.kind] Kind of resource. * @@ -53491,13 +58008,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. + * 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 _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, callback) { +function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53507,7 +58024,6 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53533,12 +58049,18 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec 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.'); } @@ -53548,20 +58070,21 @@ 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/{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(apiVersion)); + 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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -53584,7 +58107,7 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec let requestModel = null; try { if (connectionEnvelope !== null && connectionEnvelope !== undefined) { - let requestModelMapper = new client.models['VnetInfo']().mapper(); + let requestModelMapper = new client.models['VnetGateway']().mapper(); requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); requestContent = JSON.stringify(requestModel); } @@ -53610,12 +58133,13 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec 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) { @@ -53635,7 +58159,7 @@ 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 = new client.models['VnetGateway']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -53651,18 +58175,14 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec } /** - * @summary Deletes a connection from an app (or deployment slot to a named - * virtual network. + * @summary List webjobs for an app, or a deployment slot. * - * Deletes a connection from an app (or deployment slot to a named virtual - * network. + * 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 {string} vnetName Name of the virtual network. + * @param {string} name Site name. * * @param {object} [options] Optional Parameters. * @@ -53675,13 +58195,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 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 _deleteVnetConnection(resourceGroupName, name, vnetName, options, callback) { +function _listWebJobs(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53691,7 +58212,6 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53714,12 +58234,12 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, 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 (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 (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.'); } @@ -53729,20 +58249,19 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callb // 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}/webjobs'; 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(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -53767,7 +58286,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); @@ -53777,12 +58296,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) { @@ -53795,39 +58315,39 @@ 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['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 Adds a Virtual Network connection to an app or slot (PUT) or - * updates the connection properties (PATCH). + * @summary Get webjob information for an app, or a deployment slot. * - * Adds a Virtual Network connection to an app or slot (PUT) or updates the - * connection properties (PATCH). + * 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 {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} name Site name. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} webJobName Name of the web job. * * @param {object} [options] Optional Parameters. * @@ -53841,13 +58361,13 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, 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 VnetInfo} 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 _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, callback) { +function _getWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53857,7 +58377,6 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53880,15 +58399,15 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve 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 (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.'); } @@ -53898,20 +58417,20 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve // 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}/webjobs/{webJobName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -53929,21 +58448,7 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve } } } - // 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) { @@ -53960,12 +58465,13 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve 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) { @@ -53985,7 +58491,7 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve 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['WebJob']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -54001,203 +58507,371 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve } /** - * @summary Gets an app's Virtual Network gateway. + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. * - * Gets an app's Virtual Network gateway. + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. * - * @param {string} vnetName Name of the Virtual Network. + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. * - * @param {string} gatewayName Name of the gateway. Currently, the only - * supported string is "primary". + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). * - * @param {object} [options] Optional Parameters. + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". * - * @param {function} callback - The callback. + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. * - * @returns {function} callback(err, result, request, response) + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /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. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link VnetGateway} for more information. + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, 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 apiVersion = '2016-08-01'; - // 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 (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.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(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 !== 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['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). + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. * - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. * - * @param {string} name Name of the app. + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests * - * @param {string} vnetName Name of the Virtual Network. + * @param {object} [siteEnvelope.identity] * - * @param {string} gatewayName Name of the gateway. Currently, the only - * supported string is "primary". + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' * - * @param {object} connectionEnvelope The properties to update this gateway - * with. + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * - * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * @param {string} [siteEnvelope.kind] Kind of resource. * - * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN - * package can be downloaded. + * @param {string} siteEnvelope.location Resource Location. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {object} [siteEnvelope.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -54211,13 +58885,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 Site} 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 _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -54227,7 +58901,6 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -54250,18 +58923,15 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, 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 (siteEnvelope === null || siteEnvelope === undefined) { + throw new Error('siteEnvelope 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.'); } @@ -54271,14 +58941,12 @@ 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}'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -54307,14 +58975,14 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, 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'); + if (siteEnvelope !== null && siteEnvelope !== undefined) { + let requestModelMapper = new client.models['Site']().mapper(); + requestModel = client.serialize(requestModelMapper, siteEnvelope, 'siteEnvelope'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(connectionEnvelope, null, 2)}.`); + `payload - ${JSON.stringify(siteEnvelope, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -54324,7 +58992,7 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, 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); @@ -54334,12 +59002,13 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, 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) { @@ -54359,7 +59028,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['Site']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -54369,36 +59038,81 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, 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 = new client.models['Site']().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 Adds a gateway to a connected Virtual Network (PUT) or updates it - * (PATCH). + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). * - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * Restores a specific backup to another 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 {string} backupId ID of the backup. * - * @param {string} gatewayName Name of the gateway. Currently, the only - * supported string is "primary". + * @param {object} request Information on restore request . * - * @param {object} connectionEnvelope The properties to update this gateway - * with. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN - * package can be downloaded. + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -54411,14 +59125,13 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, * * {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 _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, callback) { +function _beginRestore(resourceGroupName, name, backupId, request, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -54428,7 +59141,6 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -54451,18 +59163,18 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway 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 (backupId === null || backupId === undefined || typeof backupId.valueOf() !== 'string') { + throw new Error('backupId 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 (request === null || request === undefined) { + throw new Error('request 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.'); } @@ -54472,21 +59184,20 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway // 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}/backups/{backupId}/restore'; 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('{backupId}', encodeURIComponent(backupId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -54508,14 +59219,14 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway 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'); + 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(connectionEnvelope, null, 2)}.`); + `payload - ${JSON.stringify(request, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -54525,167 +59236,7 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway 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) { - 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['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.'); - } - let apiVersion = '2016-08-01'; - // 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.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(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) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -54703,49 +59254,30 @@ function _listWebJobs(resourceGroupName, name, options, callback) { 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['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); + } 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 Get webjob information for an app, or a deployment slot. + * @summary Gets the Git/FTP publishing credentials of an app. * - * Get webjob information for an app, or a deployment slot. + * Gets the Git/FTP publishing credentials of an app. * * @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 {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -54759,13 +59291,13 @@ 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 User} 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 _beginListPublishingCredentials(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -54775,7 +59307,6 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -54798,12 +59329,12 @@ function _getWebJob(resourceGroupName, name, webJobName, 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.'); } + 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.'); } @@ -54813,20 +59344,19 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs/{webJobName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list'; 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(apiVersion)); + 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 @@ -54861,12 +59391,13 @@ function _getWebJob(resourceGroupName, name, webJobName, 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) { @@ -54886,7 +59417,7 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { 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['User']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -54902,387 +59433,42 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { } /** - * @summary Creates a new web, mobile, or API app in an existing resource - * group, or updates an existing app. + * @summary Invoke the MSDeploy web app extension. * - * Creates a new web, mobile, or API app in an existing resource group, or - * updates an existing app. + * Invoke the MSDeploy web app extension. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Unique name of the app to create or update. To create - * or update a deployment slot, use the {slot} parameter. - * - * @param {object} siteEnvelope A JSON representation of the app properties. - * See example. - * - * @param {boolean} [siteEnvelope.enabled] true if the app is - * enabled; otherwise, false. Setting this value to false disables - * the app (takes the app offline). - * - * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used - * to manage the SSL bindings for app's hostnames. - * - * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated - * App Service plan, formatted as: - * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". - * - * @param {boolean} [siteEnvelope.reserved] true if reserved; - * otherwise, false. - * - * @param {object} [siteEnvelope.siteConfig] Configuration of the app. - * - * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. - * - * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. - * - * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework - * version. - * - * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. - * - * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. - * - * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. - * - * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework - * and version - * - * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] - * true if request tracing is enabled; otherwise, - * false. - * - * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request - * tracing expiration time. - * - * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] - * true if remote debugging is enabled; otherwise, - * false. - * - * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote - * debugging version. - * - * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] - * true if HTTP logging is enabled; otherwise, false. - * - * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs - * directory size limit. - * - * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] - * true if detailed error logging is enabled; otherwise, - * false. - * - * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user - * name. - * - * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. - * - * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection - * strings. - * - * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. - * - * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. - * - * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values - * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', - * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', - * 'OneDrive', 'VSO' - * - * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] - * true to use 32-bit worker process; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] - * true if WebSocket is enabled; otherwise, false. - * - * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if - * Always On is enabled; otherwise, false. - * - * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. - * - * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. - * - * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java - * container version. - * - * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to - * launch. - * - * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed - * pipeline mode. Possible values include: 'Integrated', 'Classic' - * - * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual - * applications. - * - * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. - * Possible values include: 'WeightedRoundRobin', 'LeastRequests', - * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' - * - * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. - * - * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of - * ramp-up rules. - * - * @param {object} [siteEnvelope.siteConfig.limits] Site limits. - * - * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum - * allowed CPU usage percentage. - * - * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum - * allowed memory usage in MB. - * - * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum - * allowed disk size usage in MB. - * - * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true - * if Auto Heal is enabled; otherwise, false. - * - * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. - * - * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions - * that describe when to execute the auto-heal actions. - * - * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A - * rule based on total requests. - * - * @param {number} - * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request - * Count. - * - * @param {string} - * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time - * interval. - * - * @param {number} - * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule - * based on private bytes. - * - * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] - * A rule based on status codes. - * - * @param {object} - * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based - * on request execution time. - * - * @param {string} - * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time - * taken. - * - * @param {number} - * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request - * Count. - * - * @param {string} - * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] - * Time interval. - * - * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to - * be executed when a rule is triggered. - * - * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] - * Predefined action to be taken. Possible values include: 'Recycle', - * 'LogEvent', 'CustomAction' - * - * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] - * Custom action to be taken. - * - * @param {string} - * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable - * to be run. - * - * @param {string} - * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] - * Parameters for the executable. - * - * @param {string} - * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] - * Minimum time the process must execute - * before taking the action - * - * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. - * - * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. - * - * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing - * (CORS) settings. - * - * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets - * the list of origins that should be allowed to make cross-origin - * calls (for example: http://example.com:12345). Use "*" to allow all. - * - * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. - * - * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a - * flag indicating whether the Push endpoint is enabled. - * - * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets - * a JSON string containing a list of tags that are whitelisted for use by the - * push registration endpoint. - * - * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or - * sets a JSON string containing a list of tags that require user - * authentication to be used in the push registration endpoint. - * Tags can consist of alphanumeric characters and the following: - * '_', '@', '#', '.', ':', '-'. - * Validation should be performed at the PushRequestHandler. - * - * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets - * a JSON string containing a list of dynamic tags that will be evaluated from - * user claims in the push registration endpoint. - * - * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. - * - * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about - * the formal API definition for the app. - * - * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the - * API definition. - * - * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot - * name. - * - * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] - * true to enable local MySQL; otherwise, false. - * - * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. - * - * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: - * configures a web site to allow clients to connect over http2.0 - * - * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: - * configures the minimum version of TLS required for SSL requests. Possible - * values include: '1.0', '1.1', '1.2' - * - * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop - * SCM (KUDU) site when the app is stopped; otherwise, false. The - * default is false. - * - * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service - * Environment to use for the app. - * - * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. - * - * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to - * enable client affinity; false to stop sending session affinity - * cookies, which route client requests in the same session to the same - * instance. Default is true. - * - * @param {boolean} [siteEnvelope.clientCertEnabled] true to - * enable client certificate authentication (TLS mutual authentication); - * otherwise, false. Default is false. - * - * @param {boolean} [siteEnvelope.hostNamesDisabled] true to - * disable the public hostnames of the app; otherwise, false. - * If true, the app is only accessible via API management process. - * - * @param {number} [siteEnvelope.containerSize] Size of the function container. - * - * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily - * memory-time quota (applicable on dynamic apps only). - * - * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, - * the app is cloned from a source app. - * - * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of - * cloning operation. This ID ties multiple cloning operations - * together to use the same snapshot. - * - * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to - * overwrite destination app; otherwise, false. - * - * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] - * true to clone custom hostnames from source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] - * true to clone source control from source app; otherwise, - * false. - * - * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of - * the source app. App resource ID is of the form - * /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 {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service - * Environment. - * - * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application - * setting overrides for cloned app. If specified, these settings override the - * settings cloned - * from source app. Otherwise, application settings from source app are - * retained. - * - * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] - * true to configure load balancing for source and destination - * app. - * - * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM - * resource ID of the Traffic Manager profile to use, if it exists. Traffic - * Manager resource ID is of the form - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. - * - * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of - * Traffic Manager profile to create. This is only needed if Traffic Manager - * profile does not already exist. - * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. + * @param {string} name Name of web app. * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. + * @param {object} mSDeploy Details of MSDeploy operation * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [mSDeploy.packageUri] Package URI * - * @param {string} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * @param {string} [mSDeploy.connectionString] SQL Connection String * - * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site - * to accept only https requests. Issues redirect for - * http requests + * @param {string} [mSDeploy.dbType] Database Type * - * @param {object} [siteEnvelope.identity] + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. * - * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. * - * @param {string} [siteEnvelope.kind] Kind of resource. + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. * - * @param {string} siteEnvelope.location Resource Location. + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. * - * @param {object} [siteEnvelope.tags] Resource tags. + * @param {string} [mSDeploy.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -55296,13 +59482,13 @@ function _getWebJob(resourceGroupName, name, webJobName, 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 Site} for more information. + * See {@link MSDeployStatus} 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 _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, callback) { +function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -55312,7 +59498,6 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -55335,12 +59520,15 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, 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 (siteEnvelope === null || siteEnvelope === undefined) { - throw new Error('siteEnvelope cannot be null or undefined.'); + if (mSDeploy === null || mSDeploy === undefined) { + throw new Error('mSDeploy 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.'); } @@ -55350,12 +59538,12 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -55384,14 +59572,14 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca let requestContent = null; let requestModel = null; try { - if (siteEnvelope !== null && siteEnvelope !== undefined) { - let requestModelMapper = new client.models['Site']().mapper(); - requestModel = client.serialize(requestModelMapper, siteEnvelope, 'siteEnvelope'); + if (mSDeploy !== null && mSDeploy !== undefined) { + let requestModelMapper = new client.models['MSDeploy']().mapper(); + requestModel = client.serialize(requestModelMapper, mSDeploy, 'mSDeploy'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(siteEnvelope, null, 2)}.`); + `payload - ${JSON.stringify(mSDeploy, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -55401,7 +59589,7 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { + if (statusCode !== 201 && statusCode !== 409) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -55430,13 +59618,13 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 200) { + 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['Site']().mapper(); + let resultMapper = new client.models['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -55446,81 +59634,45 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca 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 = new client.models['Site']().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 specific backup to another app (or deployment slot, if - * specified). + * @summary Create function for web site, or a deployment slot. * - * Restores a specific backup to another app (or deployment slot, if - * specified). + * Create function for web site, 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} backupId ID of the backup. - * - * @param {object} request Information on restore request . + * @param {string} name Site name. * - * @param {string} request.storageAccountUrl SAS URL to the container. + * @param {string} functionName Function name. * - * @param {string} [request.blobName] Name of a blob which contains the backup. + * @param {object} functionEnvelope Function details. * - * @param {boolean} request.overwrite true if the restore - * operation can overwrite target app; otherwise, false. - * true is needed if trying to restore over an existing app. + * @param {string} [functionEnvelope.functionAppId] Function App ID. * - * @param {string} [request.siteName] Name of an app. + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * - * @param {array} [request.databases] Collection of databases which should be - * restored. This list has to match the list of databases included in the - * backup. + * @param {string} [functionEnvelope.scriptHref] Script URI. * - * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when - * restoring an app with custom domains. true to remove custom - * domains automatically. If false, custom domains are added to - * the app's object when it is being restored, but that might fail due to - * conflicts during the operation. + * @param {string} [functionEnvelope.configHref] Config URI. * - * @param {boolean} [request.ignoreDatabases] Ignore the databases and only - * restore the site content + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. * - * @param {string} [request.appServicePlan] Specify app service plan that will - * own restored site. + * @param {string} [functionEnvelope.href] Function URI. * - * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * @param {object} [functionEnvelope.config] Config information. * - * @param {boolean} [request.adjustConnectionStrings] true if - * SiteConfig.ConnectionStrings should be set in new app; otherwise, - * false. + * @param {object} [functionEnvelope.files] File list. * - * @param {string} [request.hostingEnvironment] App Service Environment name, - * if needed (only when restoring an app to an App Service Environment). + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. * - * @param {string} [request.kind] Kind of resource. + * @param {string} [functionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -55534,13 +59686,13 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, 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 RestoreResponse} for more information. + * See {@link FunctionEnvelope} 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 _beginRestore(resourceGroupName, name, backupId, request, options, callback) { +function _beginCreateFunction(resourceGroupName, name, functionName, functionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -55550,7 +59702,6 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -55573,15 +59724,18 @@ function _beginRestore(resourceGroupName, name, backupId, request, 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 (backupId === null || backupId === undefined || typeof backupId.valueOf() !== 'string') { - throw new Error('backupId cannot be null or undefined and it must be of type string.'); + if (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { + throw new Error('functionName 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 (functionEnvelope === null || functionEnvelope === undefined) { + throw new Error('functionEnvelope 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.'); } @@ -55591,20 +59745,20 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -55626,14 +59780,14 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call 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 (functionEnvelope !== null && functionEnvelope !== undefined) { + let requestModelMapper = new client.models['FunctionEnvelope']().mapper(); + requestModel = client.serialize(requestModelMapper, functionEnvelope, 'functionEnvelope'); 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(functionEnvelope, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -55643,7 +59797,7 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -55653,12 +59807,13 @@ function _beginRestore(resourceGroupName, name, backupId, request, 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) { @@ -55672,13 +59827,13 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 200) { + 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['RestoreResponse']().mapper(); + let resultMapper = new client.models['FunctionEnvelope']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -55694,14 +59849,44 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call } /** - * @summary Gets the Git/FTP publishing credentials of an app. + * @summary Invoke the MSDeploy web app extension. * - * Gets the Git/FTP publishing credentials of an app. + * Invoke the MSDeploy web app extension. * * @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} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -55715,13 +59900,13 @@ function _beginRestore(resourceGroupName, name, backupId, request, 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 User} for more information. + * See {@link MSDeployStatus} 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 _beginListPublishingCredentials(resourceGroupName, name, options, callback) { +function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -55731,7 +59916,6 @@ function _beginListPublishingCredentials(resourceGroupName, name, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -55754,9 +59938,18 @@ function _beginListPublishingCredentials(resourceGroupName, name, 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 (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (mSDeploy === null || mSDeploy === undefined) { + throw new Error('mSDeploy 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.'); } @@ -55766,19 +59959,20 @@ function _beginListPublishingCredentials(resourceGroupName, name, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -55796,14 +59990,28 @@ function _beginListPublishingCredentials(resourceGroupName, name, options, callb } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (mSDeploy !== null && mSDeploy !== undefined) { + let requestModelMapper = new client.models['MSDeploy']().mapper(); + requestModel = client.serialize(requestModelMapper, mSDeploy, 'mSDeploy'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(mSDeploy, 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 !== 201 && statusCode !== 409) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -55832,13 +60040,13 @@ function _beginListPublishingCredentials(resourceGroupName, name, options, callb let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 200) { + 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['User']().mapper(); + let resultMapper = new client.models['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -55854,42 +60062,33 @@ function _beginListPublishingCredentials(resourceGroupName, name, options, callb } /** - * @summary Invoke the MSDeploy web app extension. + * @summary Restores a web app. * - * Invoke the MSDeploy web app extension. + * Restores a web app. + * + * @param {string} subscriptionName Azure subscription. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of web app. * - * @param {object} mSDeploy Details of MSDeploy operation - * - * @param {string} [mSDeploy.packageUri] Package URI - * - * @param {string} [mSDeploy.connectionString] SQL Connection String - * - * @param {string} [mSDeploy.dbType] Database Type + * @param {object} migrationOptions Migration migrationOptions. * - * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy - * Parameters file. Must not be set if SetParameters is used. + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. * - * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be - * set if SetParametersXmlFileUri is used. + * @param {string} migrationOptions.azurefilesShare AzureFiles share. * - * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy - * operation skips the App_Data directory. - * If set to true, the existing App_Data directory on the - * destination - * will not be deleted, and any App_Data directory in the source will be - * ignored. - * Setting is false by default. + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. * - * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the - * MSDeploy operation executes. - * Setting is false by default. + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. * - * @param {string} [mSDeploy.kind] Kind of resource. + * @param {string} [migrationOptions.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -55903,13 +60102,14 @@ function _beginListPublishingCredentials(resourceGroupName, name, 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 MSDeployStatus} for more information. + * See {@link StorageMigrationResponse} 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 _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, options, callback) { +function _beginMigrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -55919,9 +60119,11 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { + if (subscriptionName === null || subscriptionName === undefined || typeof subscriptionName.valueOf() !== 'string') { + throw new Error('subscriptionName 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.'); } @@ -55942,12 +60144,15 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, 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 (mSDeploy === null || mSDeploy === undefined) { - throw new Error('mSDeploy cannot be null or undefined.'); + if (migrationOptions === null || migrationOptions === undefined) { + throw new Error('migrationOptions 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.'); } @@ -55957,12 +60162,13 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate'; 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(apiVersion)); + queryParameters.push('subscriptionName=' + encodeURIComponent(subscriptionName)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -55991,14 +60197,14 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option let requestContent = null; let requestModel = null; try { - if (mSDeploy !== null && mSDeploy !== undefined) { - let requestModelMapper = new client.models['MSDeploy']().mapper(); - requestModel = client.serialize(requestModelMapper, mSDeploy, 'mSDeploy'); + if (migrationOptions !== null && migrationOptions !== undefined) { + let requestModelMapper = new client.models['StorageMigrationOptions']().mapper(); + requestModel = client.serialize(requestModelMapper, migrationOptions, 'migrationOptions'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(mSDeploy, null, 2)}.`); + `payload - ${JSON.stringify(migrationOptions, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -56008,7 +60214,7 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 409) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -56018,12 +60224,13 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option 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) { @@ -56037,13 +60244,13 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option 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['MSDeployStatus']().mapper(); + let resultMapper = new client.models['StorageMigrationResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -56059,37 +60266,26 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option } /** - * @summary Create function for web site, or a deployment slot. + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. * - * Create function for web site, or a deployment slot. + * Migrates a local (in-app) MySql database to a remote MySql database. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. - * - * @param {string} functionName Function name. - * - * @param {object} functionEnvelope Function details. - * - * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. - * - * @param {string} [functionEnvelope.scriptHref] Script URI. - * - * @param {string} [functionEnvelope.configHref] Config URI. - * - * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. - * - * @param {string} [functionEnvelope.href] Function URI. + * @param {string} name Name of web app. * - * @param {object} [functionEnvelope.config] Config information. + * @param {object} migrationRequestEnvelope MySql migration options. * - * @param {object} [functionEnvelope.files] File list. + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. * - * @param {string} [functionEnvelope.testData] Test data used when testing via - * the Azure Portal. + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' * - * @param {string} [functionEnvelope.kind] Kind of resource. + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -56103,13 +60299,13 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, 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 FunctionEnvelope} for more information. + * See {@link Operation} 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 _beginCreateFunction(resourceGroupName, name, functionName, functionEnvelope, options, callback) { +function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -56119,7 +60315,6 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -56142,15 +60337,15 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv 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 (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { - throw new Error('functionName cannot be null or undefined and it must be of type string.'); - } - if (functionEnvelope === null || functionEnvelope === undefined) { - throw new Error('functionEnvelope cannot be null or undefined.'); + if (migrationRequestEnvelope === null || migrationRequestEnvelope === undefined) { + throw new Error('migrationRequestEnvelope 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.'); } @@ -56160,20 +60355,19 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -56195,14 +60389,14 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv let requestContent = null; let requestModel = null; try { - if (functionEnvelope !== null && functionEnvelope !== undefined) { - let requestModelMapper = new client.models['FunctionEnvelope']().mapper(); - requestModel = client.serialize(requestModelMapper, functionEnvelope, 'functionEnvelope'); + if (migrationRequestEnvelope !== null && migrationRequestEnvelope !== undefined) { + let requestModelMapper = new client.models['MigrateMySqlRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, migrationRequestEnvelope, 'migrationRequestEnvelope'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(functionEnvelope, null, 2)}.`); + `payload - ${JSON.stringify(migrationRequestEnvelope, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -56212,7 +60406,7 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -56222,12 +60416,13 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv 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) { @@ -56241,13 +60436,13 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv 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['FunctionEnvelope']().mapper(); + let resultMapper = new client.models['Operation']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -56263,44 +60458,54 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv } /** - * @summary Invoke the MSDeploy web app extension. + * @summary Restores an app from a backup blob in Azure Storage. * - * Invoke the MSDeploy web app extension. + * Restores an app from a backup blob in Azure Storage. * * @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} instanceId ID of web app instance. + * @param {object} request Information on restore request . * - * @param {object} mSDeploy Details of MSDeploy operation + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {string} [mSDeploy.packageUri] Package URI + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @param {string} [mSDeploy.connectionString] SQL Connection String + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. * - * @param {string} [mSDeploy.dbType] Database Type + * @param {string} [request.siteName] Name of an app. * - * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy - * Parameters file. Must not be set if SetParameters is used. + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be - * set if SetParametersXmlFileUri is used. + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. * - * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy - * operation skips the App_Data directory. - * If set to true, the existing App_Data directory on the - * destination - * will not be deleted, and any App_Data directory in the source will be - * ignored. - * Setting is false by default. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the - * MSDeploy operation executes. - * Setting is false by default. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * @param {string} [mSDeploy.kind] Kind of resource. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -56313,14 +60518,13 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv * * {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 MSDeployStatus} 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 _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, callback) { +function _beginRestoreFromBackupBlob(resourceGroupName, name, request, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -56330,7 +60534,6 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -56353,15 +60556,15 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance 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 (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { - throw new Error('instanceId cannot be null or undefined and it must be of type string.'); - } - if (mSDeploy === null || mSDeploy === undefined) { - throw new Error('mSDeploy cannot be null or undefined.'); + if (request === null || request === undefined) { + throw new Error('request 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.'); } @@ -56371,20 +60574,19 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -56406,14 +60608,14 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance let requestContent = null; let requestModel = null; try { - if (mSDeploy !== null && mSDeploy !== undefined) { - let requestModelMapper = new client.models['MSDeploy']().mapper(); - requestModel = client.serialize(requestModelMapper, mSDeploy, 'mSDeploy'); + 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(mSDeploy, null, 2)}.`); + `payload - ${JSON.stringify(request, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -56423,7 +60625,7 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 409) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -56451,56 +60653,35 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance // Create Result let result = null; if (responseBody === '') responseBody = null; - // 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['MSDeployStatus']().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 Restores a web app. - * - * Restores a web app. + * @summary Restores a deleted web app to this web app. * - * @param {string} subscriptionName Azure subscription. + * 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} migrationOptions Migration migrationOptions. - * - * @param {string} migrationOptions.azurefilesConnectionString AzureFiles - * connection string. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} * - * @param {boolean} [migrationOptions.switchSiteAfterMigration] - * trueif the app should be switched over; otherwise, - * false. + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. * - * @param {boolean} [migrationOptions.blockWriteAccessToSite] true - * if the app should be read only during copy operation; otherwise, - * false. + * @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} [migrationOptions.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -56513,15 +60694,13 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance * * {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 StorageMigrationResponse} 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 _beginMigrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, callback) { +function _beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -56531,12 +60710,8 @@ function _beginMigrateStorage(subscriptionName, resourceGroupName, name, migrati if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { - if (subscriptionName === null || subscriptionName === undefined || typeof subscriptionName.valueOf() !== 'string') { - throw new Error('subscriptionName 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.'); } @@ -56557,201 +60732,14 @@ function _beginMigrateStorage(subscriptionName, resourceGroupName, name, migrati 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 (migrationOptions === null || migrationOptions === undefined) { - throw new Error('migrationOptions cannot be null or undefined.'); + if (restoreRequest === null || restoreRequest === undefined) { + throw new Error('restoreRequest 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.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}/migrate'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('subscriptionName=' + encodeURIComponent(subscriptionName)); - queryParameters.push('api-version=' + encodeURIComponent(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 (migrationOptions !== null && migrationOptions !== undefined) { - let requestModelMapper = new client.models['StorageMigrationOptions']().mapper(); - requestModel = client.serialize(requestModelMapper, migrationOptions, 'migrationOptions'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(migrationOptions, 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) { - 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['StorageMigrationResponse']().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 Migrates a local (in-app) MySql database to a remote MySql - * database. - * - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} migrationRequestEnvelope MySql migration options. - * - * @param {string} migrationRequestEnvelope.connectionString Connection string - * to the remote MySQL database. - * - * @param {string} migrationRequestEnvelope.migrationType The type of migration - * operation to be done. Possible values include: 'LocalToRemote', - * 'RemoteToLocal' - * - * @param {string} [migrationRequestEnvelope.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 Operation} 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 _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, 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 apiVersion = '2016-08-01'; - // 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 (migrationRequestEnvelope === null || migrationRequestEnvelope === undefined) { - throw new Error('migrationRequestEnvelope 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.'); @@ -56762,12 +60750,12 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, o // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -56796,14 +60784,14 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, o let requestContent = null; let requestModel = null; try { - if (migrationRequestEnvelope !== null && migrationRequestEnvelope !== undefined) { - let requestModelMapper = new client.models['MigrateMySqlRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, migrationRequestEnvelope, 'migrationRequestEnvelope'); + 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(migrationRequestEnvelope, null, 2)}.`); + `payload - ${JSON.stringify(restoreRequest, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -56813,7 +60801,7 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, o 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); @@ -56841,69 +60829,53 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, 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['Operation']().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 Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -56922,7 +60894,7 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, o * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginRecover(resourceGroupName, name, recoveryEntity, options, callback) { +function _beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -56932,7 +60904,6 @@ function _beginRecover(resourceGroupName, name, recoveryEntity, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -56955,12 +60926,15 @@ function _beginRecover(resourceGroupName, name, recoveryEntity, 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 (recoveryEntity === null || recoveryEntity === undefined) { - throw new Error('recoveryEntity cannot be null or undefined.'); + if (restoreRequest === null || restoreRequest === undefined) { + throw new Error('restoreRequest 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.'); } @@ -56970,12 +60944,12 @@ function _beginRecover(resourceGroupName, name, recoveryEntity, options, callbac // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/recover'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -57004,14 +60978,14 @@ function _beginRecover(resourceGroupName, name, recoveryEntity, options, callbac let requestContent = null; let requestModel = null; try { - if (recoveryEntity !== null && recoveryEntity !== undefined) { - let requestModelMapper = new client.models['SnapshotRecoveryRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, recoveryEntity, 'recoveryEntity'); + 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(recoveryEntity, null, 2)}.`); + `payload - ${JSON.stringify(restoreRequest, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -57094,7 +61068,6 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -57123,6 +61096,9 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op 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.'); } @@ -57138,7 +61114,7 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op requestUrl = requestUrl.replace('{siteExtensionId}', encodeURIComponent(siteExtensionId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -57267,6 +61243,8 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -57285,6 +61263,9 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -57483,6 +61464,12 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -57493,6 +61480,13 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -57568,43 +61562,6 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -57612,7 +61569,10 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -57625,19 +61585,6 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -57664,11 +61611,6 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; - let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; - let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -57697,21 +61639,12 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, o 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { - throw new Error('skipCustomDomainVerification must be of type boolean.'); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { - throw new Error('forceDnsRegistration must be of type boolean.'); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { - throw new Error('ttlInSeconds 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.'); } @@ -57727,19 +61660,7 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, o requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { - queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { - queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined) { - queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -57795,12 +61716,13 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, 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) { @@ -57895,7 +61817,7 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, o * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -57920,8 +61842,7 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, 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 RestoreResponse} 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. * @@ -57937,7 +61858,6 @@ function _beginRestoreSlot(resourceGroupName, name, backupId, request, slot, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -57972,6 +61892,9 @@ function _beginRestoreSlot(resourceGroupName, name, backupId, request, slot, opt 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.'); } @@ -57988,7 +61911,7 @@ function _beginRestoreSlot(resourceGroupName, name, backupId, request, slot, opt requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -58034,7 +61957,7 @@ function _beginRestoreSlot(resourceGroupName, name, backupId, request, slot, opt 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); @@ -58062,23 +61985,6 @@ function _beginRestoreSlot(resourceGroupName, name, backupId, request, slot, 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['RestoreResponse']().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); }); @@ -58126,7 +62032,6 @@ function _beginListPublishingCredentialsSlot(resourceGroupName, name, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58155,6 +62060,9 @@ function _beginListPublishingCredentialsSlot(resourceGroupName, name, slot, opti 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.'); } @@ -58170,7 +62078,7 @@ function _beginListPublishingCredentialsSlot(resourceGroupName, name, slot, opti requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -58212,12 +62120,13 @@ function _beginListPublishingCredentialsSlot(resourceGroupName, name, 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) { @@ -58321,7 +62230,6 @@ function _beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDepl if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58353,6 +62261,9 @@ function _beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDepl 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.'); } @@ -58368,7 +62279,7 @@ function _beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDepl requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -58481,6 +62392,8 @@ function _beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDepl * * @param {object} functionEnvelope Function details. * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * * @param {string} [functionEnvelope.scriptHref] Script URI. @@ -58528,7 +62441,6 @@ function _beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58563,6 +62475,9 @@ function _beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, 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.'); } @@ -58579,7 +62494,7 @@ function _beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -58626,6 +62541,227 @@ function _beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, } let statusCode = response.statusCode; if (statusCode !== 201) { + 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) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FunctionEnvelope']().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 Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @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 {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.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 MSDeployStatus} 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 _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, 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 (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (mSDeploy === null || mSDeploy === undefined) { + throw new Error('mSDeploy 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}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + 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 (mSDeploy !== null && mSDeploy !== undefined) { + let requestModelMapper = new client.models['MSDeploy']().mapper(); + requestModel = client.serialize(requestModelMapper, mSDeploy, 'mSDeploy'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(mSDeploy, 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 !== 201 && statusCode !== 409) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -58660,7 +62796,7 @@ function _beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionEnvelope']().mapper(); + let resultMapper = new client.models['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -58676,47 +62812,57 @@ function _beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, } /** - * @summary Invoke the MSDeploy web app extension. + * @summary Restores an app from a backup blob in Azure Storage. * - * Invoke the MSDeploy web app extension. + * Restores an app from a backup blob in Azure Storage. * * @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 {object} request Information on restore request . * - * @param {string} instanceId ID of web app instance. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {object} mSDeploy Details of MSDeploy operation + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @param {string} [mSDeploy.packageUri] Package URI + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. * - * @param {string} [mSDeploy.connectionString] SQL Connection String + * @param {string} [request.siteName] Name of an app. * - * @param {string} [mSDeploy.dbType] Database Type + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy - * Parameters file. Must not be set if SetParameters is used. + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. * - * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be - * set if SetParametersXmlFileUri is used. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy - * operation skips the App_Data directory. - * If set to true, the existing App_Data directory on the - * destination - * will not be deleted, and any App_Data directory in the source will be - * ignored. - * Setting is false by default. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the - * MSDeploy operation executes. - * Setting is false by default. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} [mSDeploy.kind] Kind of resource. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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 {object} [options] Optional Parameters. * @@ -58729,14 +62875,13 @@ function _beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, * * {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 MSDeployStatus} 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 _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, callback) { +function _beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -58746,7 +62891,6 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58769,18 +62913,18 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, 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 (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 (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { - throw new Error('instanceId cannot be null or undefined and it must be of type string.'); - } - if (mSDeploy === null || mSDeploy === undefined) { - throw new Error('mSDeploy 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.'); } @@ -58790,21 +62934,20 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'; + 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('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -58826,14 +62969,14 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot let requestContent = null; let requestModel = null; try { - if (mSDeploy !== null && mSDeploy !== undefined) { - let requestModelMapper = new client.models['MSDeploy']().mapper(); - requestModel = client.serialize(requestModelMapper, mSDeploy, 'mSDeploy'); + 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(mSDeploy, null, 2)}.`); + `payload - ${JSON.stringify(request, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -58843,7 +62986,7 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 409) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -58871,69 +63014,236 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = 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 {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 { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MSDeployStatus']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); + 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 = null; + if (responseBody === '') responseBody = null; return callback(null, result, httpRequest, response); }); } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will * default to production slot. @@ -58955,7 +63265,7 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, callback) { +function _beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -58965,7 +63275,6 @@ function _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58988,8 +63297,8 @@ function _beginRecoverSlot(resourceGroupName, name, recoveryEntity, 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 (recoveryEntity === null || recoveryEntity === undefined) { - throw new Error('recoveryEntity cannot be null or undefined.'); + 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.'); @@ -58997,6 +63306,9 @@ function _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, option 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.'); } @@ -59006,13 +63318,13 @@ function _beginRecoverSlot(resourceGroupName, name, recoveryEntity, 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}/recover'; + 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)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -59041,14 +63353,14 @@ function _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, option let requestContent = null; let requestModel = null; try { - if (recoveryEntity !== null && recoveryEntity !== undefined) { - let requestModelMapper = new client.models['SnapshotRecoveryRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, recoveryEntity, 'recoveryEntity'); + 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(recoveryEntity, null, 2)}.`); + `payload - ${JSON.stringify(restoreRequest, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -59134,7 +63446,6 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59166,6 +63477,9 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId 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.'); } @@ -59182,7 +63496,7 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -59330,7 +63644,6 @@ function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59362,6 +63675,9 @@ function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, optio 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.'); } @@ -59377,7 +63693,7 @@ function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, optio requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -59520,7 +63836,6 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59552,6 +63867,9 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour 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.'); } @@ -59567,7 +63885,7 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -59623,12 +63941,13 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour 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) { @@ -59743,7 +64062,6 @@ function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59772,6 +64090,9 @@ function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, o 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.'); } @@ -59786,7 +64107,7 @@ function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, o requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -59925,7 +64246,6 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59954,6 +64274,9 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo 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.'); } @@ -59968,7 +64291,7 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -60024,12 +64347,13 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo 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) { @@ -60187,12 +64511,13 @@ function _listNext(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) { @@ -60316,12 +64641,13 @@ function _listByResourceGroupNext(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) { @@ -60445,12 +64771,13 @@ function _listBackupsNext(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) { @@ -60575,12 +64902,13 @@ function _listConfigurationsNext(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) { @@ -60707,12 +65035,13 @@ function _listConfigurationSnapshotInfoNext(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) { @@ -60837,12 +65166,13 @@ function _listContinuousWebJobsNext(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) { @@ -60966,12 +65296,13 @@ function _listDeploymentsNext(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) { @@ -61095,12 +65426,13 @@ function _listDomainOwnershipIdentifiersNext(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) { @@ -61355,12 +65687,13 @@ function _listHostNameBindingsNext(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) { @@ -61485,12 +65818,13 @@ function _listInstanceIdentifiersNext(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) { @@ -62011,12 +66345,13 @@ function _listMetricDefinitionsNext(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) { @@ -62142,12 +66477,13 @@ function _listMetricsNext(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) { @@ -62272,12 +66608,13 @@ function _listPerfMonCountersNext(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) { @@ -62797,12 +67134,13 @@ function _listPublicCertificatesNext(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) { @@ -63056,12 +67394,13 @@ function _listSlotsNext(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) { @@ -63185,12 +67524,13 @@ function _listBackupsSlotNext(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) { @@ -63315,12 +67655,13 @@ function _listConfigurationsSlotNext(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) { @@ -63447,12 +67788,13 @@ function _listConfigurationSnapshotInfoSlotNext(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) { @@ -63577,12 +67919,13 @@ function _listContinuousWebJobsSlotNext(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) { @@ -63706,12 +68049,13 @@ function _listDeploymentsSlotNext(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) { @@ -63835,12 +68179,13 @@ function _listDomainOwnershipIdentifiersSlotNext(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) { @@ -64095,12 +68440,13 @@ function _listHostNameBindingsSlotNext(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) { @@ -64225,12 +68571,13 @@ function _listInstanceIdentifiersSlotNext(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) { @@ -64751,12 +69098,13 @@ function _listMetricDefinitionsSlotNext(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) { @@ -64882,12 +69230,13 @@ function _listMetricsSlotNext(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) { @@ -65012,12 +69361,13 @@ function _listPerfMonCountersSlotNext(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) { @@ -65537,12 +69887,13 @@ function _listPublicCertificatesSlotNext(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) { @@ -65798,12 +70149,13 @@ function _listSlotDifferencesSlotNext(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) { @@ -65927,12 +70279,13 @@ function _listSnapshotsSlotNext(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) { @@ -66057,12 +70410,13 @@ function _listTriggeredWebJobsSlotNext(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) { @@ -66320,12 +70674,13 @@ function _listUsagesSlotNext(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) { @@ -66449,12 +70804,13 @@ function _listWebJobsSlotNext(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) { @@ -66580,12 +70936,13 @@ function _listSlotDifferencesFromProductionNext(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) { @@ -66709,12 +71066,13 @@ function _listSnapshotsNext(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) { @@ -66839,12 +71197,13 @@ function _listTriggeredWebJobsNext(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) { @@ -67102,12 +71461,13 @@ function _listUsagesNext(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) { @@ -67231,12 +71591,13 @@ function _listWebJobsNext(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) { @@ -67289,7 +71650,6 @@ class WebApps { this._applySlotConfigToProduction = _applySlotConfigToProduction; this._backup = _backup; this._listBackups = _listBackups; - this._discoverRestore = _discoverRestore; this._getBackupStatus = _getBackupStatus; this._deleteBackup = _deleteBackup; this._listBackupStatusSecrets = _listBackupStatusSecrets; @@ -67313,6 +71673,10 @@ class WebApps { this._listSitePushSettings = _listSitePushSettings; this._listSlotConfigurationNames = _listSlotConfigurationNames; this._updateSlotConfigurationNames = _updateSlotConfigurationNames; + this._getSwiftVirtualNetworkConnection = _getSwiftVirtualNetworkConnection; + this._createOrUpdateSwiftVirtualNetworkConnection = _createOrUpdateSwiftVirtualNetworkConnection; + this._deleteSwiftVirtualNetwork = _deleteSwiftVirtualNetwork; + this._updateSwiftVirtualNetworkConnection = _updateSwiftVirtualNetworkConnection; this._getConfiguration = _getConfiguration; this._createOrUpdateConfiguration = _createOrUpdateConfiguration; this._updateConfiguration = _updateConfiguration; @@ -67320,7 +71684,7 @@ class WebApps { this._getConfigurationSnapshot = _getConfigurationSnapshot; this._recoverSiteConfigurationSnapshot = _recoverSiteConfigurationSnapshot; this._getWebSiteContainerLogs = _getWebSiteContainerLogs; - this._getWebSiteContainerLogsZip = _getWebSiteContainerLogsZip; + this._getContainerLogsZip = _getContainerLogsZip; this._listContinuousWebJobs = _listContinuousWebJobs; this._getContinuousWebJob = _getContinuousWebJob; this._deleteContinuousWebJob = _deleteContinuousWebJob; @@ -67331,6 +71695,7 @@ class WebApps { this._createDeployment = _createDeployment; this._deleteDeployment = _deleteDeployment; this._listDeploymentLog = _listDeploymentLog; + this._discoverBackup = _discoverBackup; this._listDomainOwnershipIdentifiers = _listDomainOwnershipIdentifiers; this._getDomainOwnershipIdentifier = _getDomainOwnershipIdentifier; this._createOrUpdateDomainOwnershipIdentifier = _createOrUpdateDomainOwnershipIdentifier; @@ -67389,6 +71754,9 @@ class WebApps { this._getPremierAddOn = _getPremierAddOn; this._addPremierAddOn = _addPremierAddOn; this._deletePremierAddOn = _deletePremierAddOn; + this._updatePremierAddOn = _updatePremierAddOn; + this._getPrivateAccess = _getPrivateAccess; + this._putPrivateAccessVnet = _putPrivateAccessVnet; this._listProcesses = _listProcesses; this._getProcess = _getProcess; this._deleteProcess = _deleteProcess; @@ -67402,9 +71770,11 @@ class WebApps { this._createOrUpdatePublicCertificate = _createOrUpdatePublicCertificate; this._deletePublicCertificate = _deletePublicCertificate; this._listPublishingProfileXmlWithSecrets = _listPublishingProfileXmlWithSecrets; - this._recover = _recover; this._resetProductionSlotConfig = _resetProductionSlotConfig; this._restart = _restart; + this._restoreFromBackupBlob = _restoreFromBackupBlob; + this._restoreFromDeletedApp = _restoreFromDeletedApp; + this._restoreSnapshot = _restoreSnapshot; this._listSiteExtensions = _listSiteExtensions; this._getSiteExtension = _getSiteExtension; this._installSiteExtension = _installSiteExtension; @@ -67418,7 +71788,6 @@ class WebApps { this._applySlotConfigurationSlot = _applySlotConfigurationSlot; this._backupSlot = _backupSlot; this._listBackupsSlot = _listBackupsSlot; - this._discoverRestoreSlot = _discoverRestoreSlot; this._getBackupStatusSlot = _getBackupStatusSlot; this._deleteBackupSlot = _deleteBackupSlot; this._listBackupStatusSecretsSlot = _listBackupStatusSecretsSlot; @@ -67440,6 +71809,10 @@ class WebApps { this._listPublishingCredentialsSlot = _listPublishingCredentialsSlot; this._updateSitePushSettingsSlot = _updateSitePushSettingsSlot; this._listSitePushSettingsSlot = _listSitePushSettingsSlot; + this._getSwiftVirtualNetworkConnectionSlot = _getSwiftVirtualNetworkConnectionSlot; + this._createOrUpdateSwiftVirtualNetworkConnectionSlot = _createOrUpdateSwiftVirtualNetworkConnectionSlot; + this._deleteSwiftVirtualNetworkSlot = _deleteSwiftVirtualNetworkSlot; + this._updateSwiftVirtualNetworkConnectionSlot = _updateSwiftVirtualNetworkConnectionSlot; this._getConfigurationSlot = _getConfigurationSlot; this._createOrUpdateConfigurationSlot = _createOrUpdateConfigurationSlot; this._updateConfigurationSlot = _updateConfigurationSlot; @@ -67447,7 +71820,7 @@ class WebApps { this._getConfigurationSnapshotSlot = _getConfigurationSnapshotSlot; this._recoverSiteConfigurationSnapshotSlot = _recoverSiteConfigurationSnapshotSlot; this._getWebSiteContainerLogsSlot = _getWebSiteContainerLogsSlot; - this._getWebSiteContainerLogsZipSlot = _getWebSiteContainerLogsZipSlot; + this._getContainerLogsZipSlot = _getContainerLogsZipSlot; this._listContinuousWebJobsSlot = _listContinuousWebJobsSlot; this._getContinuousWebJobSlot = _getContinuousWebJobSlot; this._deleteContinuousWebJobSlot = _deleteContinuousWebJobSlot; @@ -67458,6 +71831,7 @@ class WebApps { this._createDeploymentSlot = _createDeploymentSlot; this._deleteDeploymentSlot = _deleteDeploymentSlot; this._listDeploymentLogSlot = _listDeploymentLogSlot; + this._discoverBackupSlot = _discoverBackupSlot; this._listDomainOwnershipIdentifiersSlot = _listDomainOwnershipIdentifiersSlot; this._getDomainOwnershipIdentifierSlot = _getDomainOwnershipIdentifierSlot; this._createOrUpdateDomainOwnershipIdentifierSlot = _createOrUpdateDomainOwnershipIdentifierSlot; @@ -67514,6 +71888,9 @@ class WebApps { this._getPremierAddOnSlot = _getPremierAddOnSlot; this._addPremierAddOnSlot = _addPremierAddOnSlot; this._deletePremierAddOnSlot = _deletePremierAddOnSlot; + this._updatePremierAddOnSlot = _updatePremierAddOnSlot; + this._getPrivateAccessSlot = _getPrivateAccessSlot; + this._putPrivateAccessVnetSlot = _putPrivateAccessVnetSlot; this._listProcessesSlot = _listProcessesSlot; this._getProcessSlot = _getProcessSlot; this._deleteProcessSlot = _deleteProcessSlot; @@ -67527,9 +71904,11 @@ class WebApps { this._createOrUpdatePublicCertificateSlot = _createOrUpdatePublicCertificateSlot; this._deletePublicCertificateSlot = _deletePublicCertificateSlot; this._listPublishingProfileXmlWithSecretsSlot = _listPublishingProfileXmlWithSecretsSlot; - this._recoverSlot = _recoverSlot; this._resetSlotConfigurationSlot = _resetSlotConfigurationSlot; this._restartSlot = _restartSlot; + this._restoreFromBackupBlobSlot = _restoreFromBackupBlobSlot; + this._restoreFromDeletedAppSlot = _restoreFromDeletedAppSlot; + this._restoreSnapshotSlot = _restoreSnapshotSlot; this._listSiteExtensionsSlot = _listSiteExtensionsSlot; this._getSiteExtensionSlot = _getSiteExtensionSlot; this._installSiteExtensionSlot = _installSiteExtensionSlot; @@ -67598,7 +71977,9 @@ class WebApps { this._beginCreateInstanceMSDeployOperation = _beginCreateInstanceMSDeployOperation; this._beginMigrateStorage = _beginMigrateStorage; this._beginMigrateMySql = _beginMigrateMySql; - this._beginRecover = _beginRecover; + this._beginRestoreFromBackupBlob = _beginRestoreFromBackupBlob; + this._beginRestoreFromDeletedApp = _beginRestoreFromDeletedApp; + this._beginRestoreSnapshot = _beginRestoreSnapshot; this._beginInstallSiteExtension = _beginInstallSiteExtension; this._beginCreateOrUpdateSlot = _beginCreateOrUpdateSlot; this._beginRestoreSlot = _beginRestoreSlot; @@ -67606,7 +71987,9 @@ class WebApps { this._beginCreateMSDeployOperationSlot = _beginCreateMSDeployOperationSlot; this._beginCreateInstanceFunctionSlot = _beginCreateInstanceFunctionSlot; this._beginCreateInstanceMSDeployOperationSlot = _beginCreateInstanceMSDeployOperationSlot; - this._beginRecoverSlot = _beginRecoverSlot; + this._beginRestoreFromBackupBlobSlot = _beginRestoreFromBackupBlobSlot; + this._beginRestoreFromDeletedAppSlot = _beginRestoreFromDeletedAppSlot; + this._beginRestoreSnapshotSlot = _beginRestoreSnapshotSlot; this._beginInstallSiteExtensionSlot = _beginInstallSiteExtensionSlot; this._beginSwapSlotSlot = _beginSwapSlotSlot; this._beginCreateOrUpdateSourceControlSlot = _beginCreateOrUpdateSourceControlSlot; @@ -67969,6 +72352,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -67987,6 +72372,9 @@ class WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -68185,6 +72573,12 @@ class WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -68195,6 +72589,13 @@ class WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -68270,43 +72671,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -68314,7 +72678,10 @@ class WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -68377,6 +72744,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -68395,6 +72764,9 @@ class WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -68593,6 +72965,12 @@ class WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -68603,6 +72981,13 @@ class WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -68678,43 +73063,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -68722,7 +73070,10 @@ class WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -68914,6 +73265,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -68932,6 +73285,9 @@ class WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -69130,6 +73486,12 @@ class WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -69140,6 +73502,13 @@ class WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -69215,43 +73584,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -69313,6 +73645,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -69331,6 +73665,9 @@ class WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -69529,6 +73866,12 @@ class WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -69539,6 +73882,13 @@ class WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -69614,43 +73964,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -69927,8 +74240,6 @@ class WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -69959,9 +74270,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -70002,8 +74310,6 @@ class WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -70034,9 +74340,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -70178,184 +74481,6 @@ class WebApps { } } - /** - * @summary Discovers an existing app backup that can be restored from a blob - * in Azure storage. - * - * Discovers an existing app backup that can be restored from a blob in Azure - * storage. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} request A RestoreRequest object that includes Azure storage - * URL and blog name for discovery of backup. - * - * @param {string} request.storageAccountUrl SAS URL to the container. - * - * @param {string} [request.blobName] Name of a blob which contains the backup. - * - * @param {boolean} request.overwrite true if the restore - * operation can overwrite target app; otherwise, false. - * true is needed if trying to restore over an existing app. - * - * @param {string} [request.siteName] Name of an app. - * - * @param {array} [request.databases] Collection of databases which should be - * restored. This list has to match the list of databases included in the - * backup. - * - * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when - * restoring an app with custom domains. true to remove custom - * domains automatically. If false, custom domains are added to - * the app's object when it is being restored, but that might fail due to - * conflicts during the operation. - * - * @param {boolean} [request.ignoreDatabases] Ignore the databases and only - * restore the site content - * - * @param {string} [request.appServicePlan] Specify app service plan that will - * own restored site. - * - * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @param {boolean} [request.adjustConnectionStrings] true if - * SiteConfig.ConnectionStrings should be set in new app; otherwise, - * false. - * - * @param {string} [request.hostingEnvironment] App Service Environment name, - * if needed (only when restoring an app to an App Service Environment). - * - * @param {string} [request.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} - The error object. - */ - discoverRestoreWithHttpOperationResponse(resourceGroupName, name, request, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._discoverRestore(resourceGroupName, name, request, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Discovers an existing app backup that can be restored from a blob - * in Azure storage. - * - * Discovers an existing app backup that can be restored from a blob in Azure - * storage. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} request A RestoreRequest object that includes Azure storage - * URL and blog name for discovery of backup. - * - * @param {string} request.storageAccountUrl SAS URL to the container. - * - * @param {string} [request.blobName] Name of a blob which contains the backup. - * - * @param {boolean} request.overwrite true if the restore - * operation can overwrite target app; otherwise, false. - * true is needed if trying to restore over an existing app. - * - * @param {string} [request.siteName] Name of an app. - * - * @param {array} [request.databases] Collection of databases which should be - * restored. This list has to match the list of databases included in the - * backup. - * - * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when - * restoring an app with custom domains. true to remove custom - * domains automatically. If false, custom domains are added to - * the app's object when it is being restored, but that might fail due to - * conflicts during the operation. - * - * @param {boolean} [request.ignoreDatabases] Ignore the databases and only - * restore the site content - * - * @param {string} [request.appServicePlan] Specify app service plan that will - * own restored site. - * - * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @param {boolean} [request.adjustConnectionStrings] true if - * SiteConfig.ConnectionStrings should be set in new app; otherwise, - * false. - * - * @param {string} [request.hostingEnvironment] App Service Environment name, - * if needed (only when restoring an app to an App Service Environment). - * - * @param {string} [request.kind] Kind of resource. - * - * @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 {RestoreRequest} - 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 RestoreRequest} 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. - */ - discoverRestore(resourceGroupName, name, request, 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._discoverRestore(resourceGroupName, name, request, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._discoverRestore(resourceGroupName, name, request, options, optionalCallback); - } - } - /** * @summary Gets a backup of an app by its ID. * @@ -70567,8 +74692,6 @@ class WebApps { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -70599,9 +74722,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -70649,8 +74769,6 @@ class WebApps { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -70681,9 +74799,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -70776,7 +74891,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -70794,7 +74909,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. */ @@ -70855,7 +74970,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -70878,7 +74993,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -70886,8 +75001,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. - * See {@link RestoreResponse} 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. * @@ -71277,6 +75391,9 @@ class WebApps { * More information on OpenID Connect Discovery: * http://openid.net/specs/openid-connect-discovery-1_0.html * + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. + * * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values * to consider when validating JWTs issued by * Azure Active Directory. Note that the ClientID value is always @@ -71455,6 +75572,9 @@ class WebApps { * More information on OpenID Connect Discovery: * http://openid.net/specs/openid-connect-discovery-1_0.html * + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. + * * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values * to consider when validating JWTs issued by * Azure Active Directory. Note that the ClientID value is always @@ -71684,8 +75804,6 @@ class WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -71716,9 +75834,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -71758,8 +75873,6 @@ class WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -71790,9 +75903,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -73172,7 +77282,126 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listSlotConfigurationNames(resourceGroupName, name, options, optionalCallback) { + listSlotConfigurationNames(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._listSlotConfigurationNames(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSlotConfigurationNames(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Updates the names of application settings and connection string + * that remain with the slot during swap operation. + * + * Updates the names of application settings and connection string that remain + * with the slot during swap operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotConfigNames Names of application settings and connection + * strings. See example. + * + * @param {array} [slotConfigNames.connectionStringNames] List of connection + * string names. + * + * @param {array} [slotConfigNames.appSettingNames] List of application + * settings names. + * + * @param {string} [slotConfigNames.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} - The error object. + */ + updateSlotConfigurationNamesWithHttpOperationResponse(resourceGroupName, name, slotConfigNames, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, 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 the names of application settings and connection string + * that remain with the slot during swap operation. + * + * Updates the names of application settings and connection string that remain + * with the slot during swap operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotConfigNames Names of application settings and connection + * strings. See example. + * + * @param {array} [slotConfigNames.connectionStringNames] List of connection + * string names. + * + * @param {array} [slotConfigNames.appSettingNames] List of application + * settings names. + * + * @param {string} [slotConfigNames.kind] Kind of resource. + * + * @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 {SlotConfigNamesResource} - 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 SlotConfigNamesResource} 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. + */ + updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -73181,39 +77410,136 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listSlotConfigurationNames(resourceGroupName, name, options, (err, result, request, response) => { + self._updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listSlotConfigurationNames(resourceGroupName, name, options, optionalCallback); + return self._updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, optionalCallback); } } /** - * @summary Updates the names of application settings and connection string - * that remain with the slot during swap operation. + * @summary Gets a Swift Virtual Network connection. * - * Updates the names of application settings and connection string that remain - * with the slot during swap operation. + * Gets a Swift Virtual Network connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {object} slotConfigNames Names of application settings and connection - * strings. See example. + * @param {object} [options] Optional Parameters. * - * @param {array} [slotConfigNames.connectionStringNames] List of connection - * string names. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [slotConfigNames.appSettingNames] List of application - * settings names. + * @returns {Promise} A promise is returned * - * @param {string} [slotConfigNames.kind] Kind of resource. + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getSwiftVirtualNetworkConnectionWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSwiftVirtualNetworkConnection(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 Gets a Swift Virtual Network connection. + * + * Gets a Swift Virtual Network connection. + * + * @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} [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 {SwiftVirtualNetwork} - 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 SwiftVirtualNetwork} 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. + */ + getSwiftVirtualNetworkConnection(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._getSwiftVirtualNetworkConnection(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSwiftVirtualNetworkConnection(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -73222,15 +77548,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. */ - updateSlotConfigurationNamesWithHttpOperationResponse(resourceGroupName, name, slotConfigNames, options) { + createOrUpdateSwiftVirtualNetworkConnectionWithHttpOperationResponse(resourceGroupName, name, connectionEnvelope, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, (err, result, request, response) => { + self._createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -73241,27 +77567,32 @@ class WebApps { } /** - * @summary Updates the names of application settings and connection string - * that remain with the slot during swap operation. + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. * - * Updates the names of application settings and connection string that remain - * with the slot during swap operation. + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {object} slotConfigNames Names of application settings and connection - * strings. See example. + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. * - * @param {array} [slotConfigNames.connectionStringNames] List of connection - * string names. + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. * - * @param {array} [slotConfigNames.appSettingNames] List of application - * settings names. + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. * - * @param {string} [slotConfigNames.kind] Kind of resource. + * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -73275,7 +77606,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {SlotConfigNamesResource} - The deserialized result object. + * @resolve {SwiftVirtualNetwork} - The deserialized result object. * * @reject {Error} - The error object. * @@ -73284,14 +77615,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 SlotConfigNamesResource} for more - * information. + * See {@link SwiftVirtualNetwork} 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. */ - updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, optionalCallback) { + createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -73300,14 +77630,235 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, (err, result, request, response) => { + self._createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, optionalCallback); + return self._createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). + * + * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * + * @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} - The error object. + */ + deleteSwiftVirtualNetworkWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteSwiftVirtualNetwork(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 Deletes a Swift Virtual Network connection from an app (or + * deployment slot). + * + * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * + * @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} [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. + */ + deleteSwiftVirtualNetwork(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._deleteSwiftVirtualNetwork(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteSwiftVirtualNetwork(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.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} - The error object. + */ + updateSwiftVirtualNetworkConnectionWithHttpOperationResponse(resourceGroupName, name, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {SwiftVirtualNetwork} - 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 SwiftVirtualNetwork} 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. + */ + updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, 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._updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, optionalCallback); } } @@ -73434,6 +77985,9 @@ class WebApps { * * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * * @param {boolean} [siteConfig.requestTracingEnabled] true if * request tracing is enabled; otherwise, false. * @@ -73611,6 +78165,12 @@ class WebApps { * @param {boolean} [siteConfig.localMySqlEnabled] true to enable * local MySQL; otherwise, false. * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web @@ -73620,6 +78180,13 @@ class WebApps { * minimum version of TLS required for SSL requests. Possible values include: * '1.0', '1.1', '1.2' * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * * @param {string} [siteConfig.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -73674,6 +78241,9 @@ class WebApps { * * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * * @param {boolean} [siteConfig.requestTracingEnabled] true if * request tracing is enabled; otherwise, false. * @@ -73851,6 +78421,12 @@ class WebApps { * @param {boolean} [siteConfig.localMySqlEnabled] true to enable * local MySQL; otherwise, false. * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web @@ -73860,6 +78436,13 @@ class WebApps { * minimum version of TLS required for SSL requests. Possible values include: * '1.0', '1.1', '1.2' * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * * @param {string} [siteConfig.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -73936,6 +78519,9 @@ class WebApps { * * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * * @param {boolean} [siteConfig.requestTracingEnabled] true if * request tracing is enabled; otherwise, false. * @@ -74113,6 +78699,12 @@ class WebApps { * @param {boolean} [siteConfig.localMySqlEnabled] true to enable * local MySQL; otherwise, false. * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web @@ -74122,6 +78714,13 @@ class WebApps { * minimum version of TLS required for SSL requests. Possible values include: * '1.0', '1.1', '1.2' * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * * @param {string} [siteConfig.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -74176,6 +78775,9 @@ class WebApps { * * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * * @param {boolean} [siteConfig.requestTracingEnabled] true if * request tracing is enabled; otherwise, false. * @@ -74353,6 +78955,12 @@ class WebApps { * @param {boolean} [siteConfig.localMySqlEnabled] true to enable * local MySQL; otherwise, false. * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web @@ -74362,6 +78970,13 @@ class WebApps { * minimum version of TLS required for SSL requests. Possible values include: * '1.0', '1.1', '1.2' * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * * @param {string} [siteConfig.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -74813,11 +79428,11 @@ class WebApps { * * @reject {Error} - The error object. */ - getWebSiteContainerLogsZipWithHttpOperationResponse(resourceGroupName, name, options) { + getContainerLogsZipWithHttpOperationResponse(resourceGroupName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getWebSiteContainerLogsZip(resourceGroupName, name, options, (err, result, request, response) => { + self._getContainerLogsZip(resourceGroupName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -74863,7 +79478,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getWebSiteContainerLogsZip(resourceGroupName, name, options, optionalCallback) { + getContainerLogsZip(resourceGroupName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -74872,14 +79487,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getWebSiteContainerLogsZip(resourceGroupName, name, options, (err, result, request, response) => { + self._getContainerLogsZip(resourceGroupName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getWebSiteContainerLogsZip(resourceGroupName, name, options, optionalCallback); + return self._getContainerLogsZip(resourceGroupName, name, options, optionalCallback); } } @@ -75529,7 +80144,348 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getDeployment(resourceGroupName, name, id, options, optionalCallback) { + getDeployment(resourceGroupName, name, id, 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._getDeployment(resourceGroupName, name, id, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeployment(resourceGroupName, name, id, options, optionalCallback); + } + } + + /** + * @summary Create a deployment for an app, or a deployment slot. + * + * Create a deployment 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} id ID of an existing deployment. + * + * @param {object} deployment Deployment details. + * + * @param {number} [deployment.status] Deployment status. + * + * @param {string} [deployment.message] Details about deployment status. + * + * @param {string} [deployment.author] Who authored the deployment. + * + * @param {string} [deployment.deployer] Who performed the deployment. + * + * @param {string} [deployment.authorEmail] Author email. + * + * @param {date} [deployment.startTime] Start time. + * + * @param {date} [deployment.endTime] End time. + * + * @param {boolean} [deployment.active] True if deployment is currently active, + * false if completed and null if not started. + * + * @param {string} [deployment.details] Details on deployment. + * + * @param {string} [deployment.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} - The error object. + */ + createDeploymentWithHttpOperationResponse(resourceGroupName, name, id, deployment, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createDeployment(resourceGroupName, name, id, deployment, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create a deployment for an app, or a deployment slot. + * + * Create a deployment 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} id ID of an existing deployment. + * + * @param {object} deployment Deployment details. + * + * @param {number} [deployment.status] Deployment status. + * + * @param {string} [deployment.message] Details about deployment status. + * + * @param {string} [deployment.author] Who authored the deployment. + * + * @param {string} [deployment.deployer] Who performed the deployment. + * + * @param {string} [deployment.authorEmail] Author email. + * + * @param {date} [deployment.startTime] Start time. + * + * @param {date} [deployment.endTime] End time. + * + * @param {boolean} [deployment.active] True if deployment is currently active, + * false if completed and null if not started. + * + * @param {string} [deployment.details] Details on deployment. + * + * @param {string} [deployment.kind] Kind of resource. + * + * @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 {Deployment} - 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 Deployment} 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. + */ + createDeployment(resourceGroupName, name, id, deployment, 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._createDeployment(resourceGroupName, name, id, deployment, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createDeployment(resourceGroupName, name, id, deployment, options, optionalCallback); + } + } + + /** + * @summary Delete a deployment by its ID for an app, or a deployment slot. + * + * Delete a deployment 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} id Deployment ID. + * + * @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. + */ + deleteDeploymentWithHttpOperationResponse(resourceGroupName, name, id, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteDeployment(resourceGroupName, name, id, 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 deployment by its ID for an app, or a deployment slot. + * + * Delete a deployment 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} id Deployment ID. + * + * @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. + */ + deleteDeployment(resourceGroupName, name, id, 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._deleteDeployment(resourceGroupName, name, id, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteDeployment(resourceGroupName, name, id, options, optionalCallback); + } + } + + /** + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. + * + * List deployment log for specific deployment 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} id The ID of a specific deployment. This is the value of the + * name property in the JSON response from "GET + * /api/sites/{siteName}/deployments". + * + * @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. + */ + listDeploymentLogWithHttpOperationResponse(resourceGroupName, name, id, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listDeploymentLog(resourceGroupName, name, id, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. + * + * List deployment log for specific deployment 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} id The ID of a specific deployment. This is the value of the + * name property in the JSON response from "GET + * /api/sites/{siteName}/deployments". + * + * @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 {Deployment} - 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 Deployment} 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. + */ + listDeploymentLog(resourceGroupName, name, id, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -75538,174 +80494,70 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployment(resourceGroupName, name, id, options, (err, result, request, response) => { + self._listDeploymentLog(resourceGroupName, name, id, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeployment(resourceGroupName, name, id, options, optionalCallback); + return self._listDeploymentLog(resourceGroupName, name, id, options, optionalCallback); } } /** - * @summary Create a deployment for an app, or a deployment slot. - * - * Create a deployment 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} id ID of an existing deployment. - * - * @param {object} deployment Deployment details. - * - * @param {string} [deployment.deploymentId] Identifier for deployment. - * - * @param {number} [deployment.status] Deployment status. - * - * @param {string} [deployment.message] Details about deployment status. - * - * @param {string} [deployment.author] Who authored the deployment. - * - * @param {string} [deployment.deployer] Who performed the deployment. - * - * @param {string} [deployment.authorEmail] Author email. - * - * @param {date} [deployment.startTime] Start time. - * - * @param {date} [deployment.endTime] End time. - * - * @param {boolean} [deployment.active] True if deployment is currently active, - * false if completed and null if not started. - * - * @param {string} [deployment.details] Details on deployment. - * - * @param {string} [deployment.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} - The error object. - */ - createDeploymentWithHttpOperationResponse(resourceGroupName, name, id, deployment, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createDeployment(resourceGroupName, name, id, deployment, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Create a deployment for an app, or a deployment slot. + * @summary Discovers an existing app backup that can be restored from a blob + * in Azure storage. Use this to get information about the databases stored in + * a backup. * - * Create a deployment for an app, or a deployment slot. + * Discovers an existing app backup that can be restored from a blob in Azure + * storage. Use this to get information about the databases stored in a backup. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} id ID of an existing deployment. - * - * @param {object} deployment Deployment details. - * - * @param {string} [deployment.deploymentId] Identifier for deployment. - * - * @param {number} [deployment.status] Deployment status. - * - * @param {string} [deployment.message] Details about deployment status. - * - * @param {string} [deployment.author] Who authored the deployment. - * - * @param {string} [deployment.deployer] Who performed the deployment. - * - * @param {string} [deployment.authorEmail] Author email. - * - * @param {date} [deployment.startTime] Start time. - * - * @param {date} [deployment.endTime] End time. - * - * @param {boolean} [deployment.active] True if deployment is currently active, - * false if completed and null if not started. - * - * @param {string} [deployment.details] Details on deployment. - * - * @param {string} [deployment.kind] Kind of resource. - * - * @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. + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * {Promise} A promise is returned + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @resolve {Deployment} - The deserialized result object. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @reject {Error} - The error object. + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. * - * {function} optionalCallback(err, result, request, response) + * @param {string} [request.siteName] Name of an app. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Deployment} for more information. + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createDeployment(resourceGroupName, name, id, deployment, 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._createDeployment(resourceGroupName, name, id, deployment, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createDeployment(resourceGroupName, name, id, deployment, options, optionalCallback); - } - } - - /** - * @summary Delete a deployment by its ID for an app, or a deployment slot. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * Delete a deployment by its ID for an app, or a deployment slot. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} name Name of the app. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @param {string} id Deployment ID. + * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -75714,15 +80566,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. */ - deleteDeploymentWithHttpOperationResponse(resourceGroupName, name, id, options) { + discoverBackupWithHttpOperationResponse(resourceGroupName, name, request, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteDeployment(resourceGroupName, name, id, options, (err, result, request, response) => { + self._discoverBackup(resourceGroupName, name, request, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -75733,119 +80585,58 @@ class WebApps { } /** - * @summary Delete a deployment by its ID for an app, or a deployment slot. + * @summary Discovers an existing app backup that can be restored from a blob + * in Azure storage. Use this to get information about the databases stored in + * a backup. * - * Delete a deployment by its ID for an app, or a deployment slot. + * Discovers an existing app backup that can be restored from a blob in Azure + * storage. Use this to get information about the databases stored in a backup. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} id Deployment ID. - * - * @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. - */ - deleteDeployment(resourceGroupName, name, id, 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._deleteDeployment(resourceGroupName, name, id, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteDeployment(resourceGroupName, name, id, options, optionalCallback); - } - } - - /** - * @summary List deployment log for specific deployment for an app, or a - * deployment slot. - * - * List deployment log for specific deployment for an app, or a deployment - * slot. + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {string} name Name of the app. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @param {string} id The ID of a specific deployment. This is the value of the - * name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. * - * @param {object} [options] Optional Parameters. + * @param {string} [request.siteName] Name of an app. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * @returns {Promise} A promise is returned + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * @reject {Error} - The error object. - */ - listDeploymentLogWithHttpOperationResponse(resourceGroupName, name, id, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listDeploymentLog(resourceGroupName, name, id, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary List deployment log for specific deployment for an app, or a - * deployment slot. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * List deployment log for specific deployment for an app, or a deployment - * slot. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} name Name of the app. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @param {string} id The ID of a specific deployment. This is the value of the - * name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". + * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -75859,7 +80650,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Deployment} - The deserialized result object. + * @resolve {RestoreRequest} - The deserialized result object. * * @reject {Error} - The error object. * @@ -75868,13 +80659,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 Deployment} for more information. + * See {@link RestoreRequest} 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. */ - listDeploymentLog(resourceGroupName, name, id, options, optionalCallback) { + discoverBackup(resourceGroupName, name, request, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -75883,14 +80674,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listDeploymentLog(resourceGroupName, name, id, options, (err, result, request, response) => { + self._discoverBackup(resourceGroupName, name, request, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listDeploymentLog(resourceGroupName, name, id, options, optionalCallback); + return self._discoverBackup(resourceGroupName, name, request, options, optionalCallback); } } @@ -77045,6 +81836,8 @@ class WebApps { * * @param {object} functionEnvelope Function details. * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * * @param {string} [functionEnvelope.scriptHref] Script URI. @@ -77103,6 +81896,8 @@ class WebApps { * * @param {object} functionEnvelope Function details. * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * * @param {string} [functionEnvelope.scriptHref] Script URI. @@ -81911,12 +86706,6 @@ class WebApps { * * @param {string} [premierAddOn.vendor] Premier add on Vendor. * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * * @param {string} [premierAddOn.marketplacePublisher] Premier add on * Marketplace publisher. * @@ -81975,12 +86764,6 @@ class WebApps { * * @param {string} [premierAddOn.vendor] Premier add on Vendor. * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * * @param {string} [premierAddOn.marketplacePublisher] Premier add on * Marketplace publisher. * @@ -82135,6 +86918,346 @@ class WebApps { } } + /** + * @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 {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. + */ + updatePremierAddOnWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, premierAddOn, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updatePremierAddOn(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 {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. + */ + updatePremierAddOn(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._updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, optionalCallback); + } + } + + /** + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the 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 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. + */ + getPrivateAccessWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getPrivateAccess(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 Gets data around private site access enablement and authorized + * Virtual Networks that can access the 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 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 {PrivateAccess} - 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 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. + */ + getPrivateAccess(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._getPrivateAccess(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getPrivateAccess(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the 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 The name of the web app. + * + * @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. + * + * @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. + */ + putPrivateAccessVnetWithHttpOperationResponse(resourceGroupName, name, access, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._putPrivateAccessVnet(resourceGroupName, name, access, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the 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 The name of the web app. + * + * @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. + * + * @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 {PrivateAccess} - 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 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. + */ + putPrivateAccessVnet(resourceGroupName, name, access, 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._putPrivateAccessVnet(resourceGroupName, name, access, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._putPrivateAccessVnet(resourceGroupName, name, access, options, optionalCallback); + } + } + /** * @summary Get list of processes for a web site, or a deployment slot, or for * a specific scaled-out instance in a web site. @@ -83449,46 +88572,402 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * Recovers a web app to a previous snapshot. + * 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 web app. + * @param {string} name Name of the app. * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} [options] Optional Parameters. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @returns {Promise} A promise is returned * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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. + * @reject {Error} - The error object. + */ + resetProductionSlotConfigWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._resetProductionSlotConfig(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 Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * @param {boolean} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. + * Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {boolean} [recoveryEntity.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} name Name of the 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. + */ + resetProductionSlotConfig(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._resetProductionSlotConfig(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._resetProductionSlotConfig(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Restarts an app (or deployment slot, if specified). + * + * Restarts 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 {boolean} [options.softRestart] Specify true to apply the + * configuration settings and restarts the app only if necessary. By default, + * the API always restarts and reprovisions the app. + * + * @param {boolean} [options.synchronous] Specify true to block until the app + * is restarted. By default, it is set to false, and the API responds + * immediately (asynchronous). + * + * @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. + */ + restartWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._restart(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 Restarts an app (or deployment slot, if specified). + * + * Restarts 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 {boolean} [options.softRestart] Specify true to apply the + * configuration settings and restarts the app only if necessary. By default, + * the API always restarts and reprovisions the app. + * + * @param {boolean} [options.synchronous] Specify true to block until the app + * is restarted. By default, it is set to false, and the API responds + * immediately (asynchronous). + * + * @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. + */ + restart(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._restart(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restart(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.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} - The error object. + */ + restoreFromBackupBlobWithHttpOperationResponse(resourceGroupName, name, request, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._restoreFromBackupBlob(resourceGroupName, name, request, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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. + */ + restoreFromBackupBlob(resourceGroupName, name, request, 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._restoreFromBackupBlob(resourceGroupName, name, request, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restoreFromBackupBlob(resourceGroupName, name, request, options, optionalCallback); + } + } + + /** + * @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 {string} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -83501,11 +88980,11 @@ class WebApps { * * @reject {Error} - The error object. */ - recoverWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, options) { + restoreFromDeletedAppWithHttpOperationResponse(resourceGroupName, name, restoreRequest, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._recover(resourceGroupName, name, recoveryEntity, options, (err, result, request, response) => { + self._restoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -83516,46 +88995,29 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a deleted web app to this web app. * - * Recovers a web app to a previous snapshot. + * 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @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} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -83583,7 +89045,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - recover(resourceGroupName, name, recoveryEntity, options, optionalCallback) { + restoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -83592,132 +89054,62 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._recover(resourceGroupName, name, recoveryEntity, options, (err, result, request, response) => { + self._restoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._recover(resourceGroupName, name, recoveryEntity, options, optionalCallback); + return self._restoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, optionalCallback); } } /** - * @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 {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. - */ - resetProductionSlotConfigWithHttpOperationResponse(resourceGroupName, name, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._resetProductionSlotConfig(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 Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * @summary Restores a web app from a snapshot. * - * Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * 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 the 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 + * @param {string} name Name of web app. * - * @resolve {null} - The deserialized result object. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @reject {Error} - The error object. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * {function} optionalCallback(err, result, request, response) + * @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. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. + * @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. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - resetProductionSlotConfig(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._resetProductionSlotConfig(resourceGroupName, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._resetProductionSlotConfig(resourceGroupName, name, options, optionalCallback); - } - } - - /** - * @summary Restarts an app (or deployment slot, if specified). + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. * - * Restarts an app (or deployment slot, if specified). + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @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} name Name of the app. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.softRestart] Specify true to apply the - * configuration settings and restarts the app only if necessary. By default, - * the API always restarts and reprovisions the app. - * - * @param {boolean} [options.synchronous] Specify true to block until the app - * is restarted. By default, it is set to false, and the API responds - * immediately (asynchronous). - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -83727,11 +89119,11 @@ class WebApps { * * @reject {Error} - The error object. */ - restartWithHttpOperationResponse(resourceGroupName, name, options) { + restoreSnapshotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._restart(resourceGroupName, name, options, (err, result, request, response) => { + self._restoreSnapshot(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -83742,24 +89134,49 @@ class WebApps { } /** - * @summary Restarts an app (or deployment slot, if specified). + * @summary Restores a web app from a snapshot. * - * Restarts an app (or deployment slot, if specified). + * 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 the app. + * @param {string} name Name of web app. * - * @param {object} [options] Optional Parameters. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {boolean} [options.softRestart] Specify true to apply the - * configuration settings and restarts the app only if necessary. By default, - * the API always restarts and reprovisions the app. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {boolean} [options.synchronous] Specify true to block until the app - * is restarted. By default, it is set to false, and the API responds - * immediately (asynchronous). + * @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 {string} [restoreRequest.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -83785,7 +89202,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - restart(resourceGroupName, name, options, optionalCallback) { + restoreSnapshot(resourceGroupName, name, restoreRequest, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -83794,14 +89211,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._restart(resourceGroupName, name, options, (err, result, request, response) => { + self._restoreSnapshot(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._restart(resourceGroupName, name, options, optionalCallback); + return self._restoreSnapshot(resourceGroupName, name, restoreRequest, options, optionalCallback); } } @@ -84409,6 +89826,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -84427,6 +89846,9 @@ class WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -84625,6 +90047,12 @@ class WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -84635,6 +90063,13 @@ class WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -84710,43 +90145,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -84754,7 +90152,10 @@ class WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -84767,19 +90168,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -84833,6 +90221,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -84851,6 +90241,9 @@ class WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -85049,6 +90442,12 @@ class WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -85059,6 +90458,13 @@ class WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -85134,43 +90540,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -85178,7 +90547,10 @@ class WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -85191,19 +90563,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -85272,9 +90631,6 @@ class WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -85321,9 +90677,6 @@ class WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -85398,6 +90751,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -85416,6 +90771,9 @@ class WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -85614,6 +90972,12 @@ class WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -85624,6 +90988,13 @@ class WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -85699,43 +91070,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -85747,19 +91081,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -85813,6 +91134,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -85831,6 +91154,9 @@ class WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -86029,6 +91355,12 @@ class WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -86039,6 +91371,13 @@ class WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -86114,43 +91453,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -86162,19 +91464,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -86455,8 +91744,6 @@ class WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -86487,9 +91774,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -86533,8 +91817,6 @@ class WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -86565,9 +91847,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -86718,190 +91997,6 @@ class WebApps { } } - /** - * @summary Discovers an existing app backup that can be restored from a blob - * in Azure storage. - * - * Discovers an existing app backup that can be restored from a blob in Azure - * storage. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} request A RestoreRequest object that includes Azure storage - * URL and blog name for discovery of backup. - * - * @param {string} request.storageAccountUrl SAS URL to the container. - * - * @param {string} [request.blobName] Name of a blob which contains the backup. - * - * @param {boolean} request.overwrite true if the restore - * operation can overwrite target app; otherwise, false. - * true is needed if trying to restore over an existing app. - * - * @param {string} [request.siteName] Name of an app. - * - * @param {array} [request.databases] Collection of databases which should be - * restored. This list has to match the list of databases included in the - * backup. - * - * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when - * restoring an app with custom domains. true to remove custom - * domains automatically. If false, custom domains are added to - * the app's object when it is being restored, but that might fail due to - * conflicts during the operation. - * - * @param {boolean} [request.ignoreDatabases] Ignore the databases and only - * restore the site content - * - * @param {string} [request.appServicePlan] Specify app service plan that will - * own restored site. - * - * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @param {boolean} [request.adjustConnectionStrings] true if - * SiteConfig.ConnectionStrings should be set in new app; otherwise, - * false. - * - * @param {string} [request.hostingEnvironment] App Service Environment name, - * if needed (only when restoring an app to an App Service Environment). - * - * @param {string} [request.kind] Kind of resource. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will perform discovery 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. - */ - discoverRestoreSlotWithHttpOperationResponse(resourceGroupName, name, request, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._discoverRestoreSlot(resourceGroupName, name, request, 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 Discovers an existing app backup that can be restored from a blob - * in Azure storage. - * - * Discovers an existing app backup that can be restored from a blob in Azure - * storage. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} request A RestoreRequest object that includes Azure storage - * URL and blog name for discovery of backup. - * - * @param {string} request.storageAccountUrl SAS URL to the container. - * - * @param {string} [request.blobName] Name of a blob which contains the backup. - * - * @param {boolean} request.overwrite true if the restore - * operation can overwrite target app; otherwise, false. - * true is needed if trying to restore over an existing app. - * - * @param {string} [request.siteName] Name of an app. - * - * @param {array} [request.databases] Collection of databases which should be - * restored. This list has to match the list of databases included in the - * backup. - * - * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when - * restoring an app with custom domains. true to remove custom - * domains automatically. If false, custom domains are added to - * the app's object when it is being restored, but that might fail due to - * conflicts during the operation. - * - * @param {boolean} [request.ignoreDatabases] Ignore the databases and only - * restore the site content - * - * @param {string} [request.appServicePlan] Specify app service plan that will - * own restored site. - * - * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @param {boolean} [request.adjustConnectionStrings] true if - * SiteConfig.ConnectionStrings should be set in new app; otherwise, - * false. - * - * @param {string} [request.hostingEnvironment] App Service Environment name, - * if needed (only when restoring an app to an App Service Environment). - * - * @param {string} [request.kind] Kind of resource. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will perform discovery 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 {RestoreRequest} - 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 RestoreRequest} 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. - */ - discoverRestoreSlot(resourceGroupName, name, request, 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._discoverRestoreSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._discoverRestoreSlot(resourceGroupName, name, request, slot, options, optionalCallback); - } - } - /** * @summary Gets a backup of an app by its ID. * @@ -87125,93 +92220,6 @@ class WebApps { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName Name of the backup. - * - * @param {boolean} [request.enabled] True if the backup schedule is enabled - * (must be included in that case), false if the backup schedule should be - * disabled. - * - * @param {string} request.storageAccountUrl SAS URL to the container. - * - * @param {object} [request.backupSchedule] Schedule for the backup if it is - * executed periodically. - * - * @param {number} request.backupSchedule.frequencyInterval How often the - * backup should be executed (e.g. for weekly backup, this should be set to 7 - * and FrequencyUnit should be set to Day) - * - * @param {string} request.backupSchedule.frequencyUnit The unit of time for - * how often the backup should be executed (e.g. for weekly backup, this should - * be set to Day and FrequencyInterval should be set to 7). Possible values - * include: 'Day', 'Hour' - * - * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the - * retention policy should always keep at least one backup in the storage - * account, regardless how old it is; false otherwise. - * - * @param {number} request.backupSchedule.retentionPeriodInDays After how many - * days backups should be deleted. - * - * @param {date} [request.backupSchedule.startTime] When the schedule should - * start working. - * - * @param {array} [request.databases] Databases included in the backup. - * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @param {string} [request.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 - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listBackupStatusSecretsSlotWithHttpOperationResponse(resourceGroupName, name, backupId, request, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request, 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 status of a web app backup that may be in progress, including - * secrets associated with the backup, such as the Azure Storage SAS URL. Also - * can be used to update the SAS URL for the backup if a new URL is passed in - * the request body. - * - * Gets status of a web app backup that may be in progress, including secrets - * associated with the backup, such as the Azure Storage SAS URL. Also can be - * used to update the SAS URL for the backup if a new URL is passed in the - * request body. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} backupId ID of backup. - * - * @param {object} request Information on backup request. - * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -87242,8 +92250,85 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * @param {string} [request.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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listBackupStatusSecretsSlotWithHttpOperationResponse(resourceGroupName, name, backupId, request, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request, 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 status of a web app backup that may be in progress, including + * secrets associated with the backup, such as the Azure Storage SAS URL. Also + * can be used to update the SAS URL for the backup if a new URL is passed in + * the request body. + * + * Gets status of a web app backup that may be in progress, including secrets + * associated with the backup, such as the Azure Storage SAS URL. Also can be + * used to update the SAS URL for the backup if a new URL is passed in the + * request body. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} backupId ID of backup. + * + * @param {object} request Information on backup request. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. * * @param {string} [request.kind] Kind of resource. * @@ -87340,7 +92425,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -87361,7 +92446,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. */ @@ -87422,7 +92507,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -87448,7 +92533,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -87456,8 +92541,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. - * See {@link RestoreResponse} 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. * @@ -87869,186 +92953,192 @@ class WebApps { * More information on OpenID Connect Discovery: * http://openid.net/specs/openid-connect-discovery-1_0.html * - * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values - * to consider when validating JWTs issued by - * Azure Active Directory. Note that the ClientID value is always - * considered an - * allowed audience, regardless of this setting. - * - * @param {array} [siteAuthSettings.additionalLoginParams] Login parameters to - * send to the OpenID Connect authorization endpoint when - * a user logs in. Each parameter must be in the form "key=value". - * - * @param {string} [siteAuthSettings.googleClientId] The OpenID Connect Client - * ID for the Google web application. - * This setting is required for enabling Google Sign-In. - * Google Sign-In documentation: - * https://developers.google.com/identity/sign-in/web/ - * - * @param {string} [siteAuthSettings.googleClientSecret] The client secret - * associated with the Google web application. - * This setting is required for enabling Google Sign-In. - * Google Sign-In documentation: - * https://developers.google.com/identity/sign-in/web/ - * - * @param {array} [siteAuthSettings.googleOAuthScopes] The OAuth 2.0 scopes - * that will be requested as part of Google Sign-In authentication. - * This setting is optional. If not specified, "openid", "profile", and "email" - * are used as default scopes. - * Google Sign-In documentation: - * https://developers.google.com/identity/sign-in/web/ - * - * @param {string} [siteAuthSettings.facebookAppId] The App ID of the Facebook - * app used for login. - * This setting is required for enabling Facebook Login. - * Facebook Login documentation: - * https://developers.facebook.com/docs/facebook-login - * - * @param {string} [siteAuthSettings.facebookAppSecret] The App Secret of the - * Facebook app used for Facebook Login. - * This setting is required for enabling Facebook Login. - * Facebook Login documentation: - * https://developers.facebook.com/docs/facebook-login - * - * @param {array} [siteAuthSettings.facebookOAuthScopes] The OAuth 2.0 scopes - * that will be requested as part of Facebook Login authentication. - * This setting is optional. - * Facebook Login documentation: - * https://developers.facebook.com/docs/facebook-login - * - * @param {string} [siteAuthSettings.twitterConsumerKey] The OAuth 1.0a - * consumer key of the Twitter application used for sign-in. - * This setting is required for enabling Twitter Sign-In. - * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in - * - * @param {string} [siteAuthSettings.twitterConsumerSecret] The OAuth 1.0a - * consumer secret of the Twitter application used for sign-in. - * This setting is required for enabling Twitter Sign-In. - * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in - * - * @param {string} [siteAuthSettings.microsoftAccountClientId] The OAuth 2.0 - * client ID that was created for the app used for authentication. - * This setting is required for enabling Microsoft Account authentication. - * Microsoft Account OAuth documentation: - * https://dev.onedrive.com/auth/msa_oauth.htm - * - * @param {string} [siteAuthSettings.microsoftAccountClientSecret] The OAuth - * 2.0 client secret that was created for the app used for authentication. - * This setting is required for enabling Microsoft Account authentication. - * Microsoft Account OAuth documentation: - * https://dev.onedrive.com/auth/msa_oauth.htm - * - * @param {array} [siteAuthSettings.microsoftAccountOAuthScopes] The OAuth 2.0 - * scopes that will be requested as part of Microsoft Account authentication. - * This setting is optional. If not specified, "wl.basic" is used as the - * default scope. - * Microsoft Account Scopes and permissions documentation: - * https://msdn.microsoft.com/en-us/library/dn631845.aspx - * - * @param {string} [siteAuthSettings.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 - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - updateAuthSettingsSlotWithHttpOperationResponse(resourceGroupName, name, siteAuthSettings, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, 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 Updates the Authentication / Authorization settings associated with - * web app. - * - * Updates the Authentication / Authorization settings associated with web app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} siteAuthSettings Auth settings associated with web app. - * - * @param {boolean} [siteAuthSettings.enabled] true if the - * Authentication / Authorization feature is enabled for the current app; - * otherwise, false. - * - * @param {string} [siteAuthSettings.runtimeVersion] The RuntimeVersion of the - * Authentication / Authorization feature in use for the current app. - * The setting in this value can control the behavior of certain features in - * the Authentication / Authorization module. - * - * @param {string} [siteAuthSettings.unauthenticatedClientAction] The action to - * take when an unauthenticated client attempts to access the app. Possible - * values include: 'RedirectToLoginPage', 'AllowAnonymous' - * - * @param {boolean} [siteAuthSettings.tokenStoreEnabled] true to - * durably store platform-specific security tokens that are obtained during - * login flows; otherwise, false. - * The default is false. - * - * @param {array} [siteAuthSettings.allowedExternalRedirectUrls] External URLs - * that can be redirected to as part of logging in or logging out of the app. - * Note that the query string part of the URL is ignored. - * This is an advanced setting typically only needed by Windows Store - * application backends. - * Note that URLs within the current domain are always implicitly allowed. - * - * @param {string} [siteAuthSettings.defaultProvider] The default - * authentication provider to use when multiple providers are configured. - * This setting is only needed if multiple providers are configured and the - * unauthenticated client - * action is set to "RedirectToLoginPage". Possible values include: - * 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', 'Twitter' - * - * @param {number} [siteAuthSettings.tokenRefreshExtensionHours] The number of - * hours after session token expiration that a session token can be used to - * call the token refresh API. The default is 72 hours. - * - * @param {string} [siteAuthSettings.clientId] The Client ID of this relying - * party application, known as the client_id. - * This setting is required for enabling OpenID Connection authentication with - * Azure Active Directory or - * other 3rd party OpenID Connect providers. - * More information on OpenID Connect: - * http://openid.net/specs/openid-connect-core-1_0.html - * - * @param {string} [siteAuthSettings.clientSecret] The Client Secret of this - * relying party application (in Azure Active Directory, this is also referred - * to as the Key). - * This setting is optional. If no client secret is configured, the OpenID - * Connect implicit auth flow is used to authenticate end users. - * Otherwise, the OpenID Connect Authorization Code Flow is used to - * authenticate end users. - * More information on OpenID Connect: - * http://openid.net/specs/openid-connect-core-1_0.html - * - * @param {string} [siteAuthSettings.issuer] The OpenID Connect Issuer URI that - * represents the entity which issues access tokens for this application. - * When using Azure Active Directory, this value is the URI of the directory - * tenant, e.g. https://sts.windows.net/{tenant-guid}/. - * This URI is a case-sensitive identifier for the token issuer. - * More information on OpenID Connect Discovery: - * http://openid.net/specs/openid-connect-discovery-1_0.html + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. + * + * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values + * to consider when validating JWTs issued by + * Azure Active Directory. Note that the ClientID value is always + * considered an + * allowed audience, regardless of this setting. + * + * @param {array} [siteAuthSettings.additionalLoginParams] Login parameters to + * send to the OpenID Connect authorization endpoint when + * a user logs in. Each parameter must be in the form "key=value". + * + * @param {string} [siteAuthSettings.googleClientId] The OpenID Connect Client + * ID for the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.googleClientSecret] The client secret + * associated with the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {array} [siteAuthSettings.googleOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Google Sign-In authentication. + * This setting is optional. If not specified, "openid", "profile", and "email" + * are used as default scopes. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.facebookAppId] The App ID of the Facebook + * app used for login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.facebookAppSecret] The App Secret of the + * Facebook app used for Facebook Login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {array} [siteAuthSettings.facebookOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Facebook Login authentication. + * This setting is optional. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.twitterConsumerKey] The OAuth 1.0a + * consumer key of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.twitterConsumerSecret] The OAuth 1.0a + * consumer secret of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.microsoftAccountClientId] The OAuth 2.0 + * client ID that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {string} [siteAuthSettings.microsoftAccountClientSecret] The OAuth + * 2.0 client secret that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {array} [siteAuthSettings.microsoftAccountOAuthScopes] The OAuth 2.0 + * scopes that will be requested as part of Microsoft Account authentication. + * This setting is optional. If not specified, "wl.basic" is used as the + * default scope. + * Microsoft Account Scopes and permissions documentation: + * https://msdn.microsoft.com/en-us/library/dn631845.aspx + * + * @param {string} [siteAuthSettings.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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateAuthSettingsSlotWithHttpOperationResponse(resourceGroupName, name, siteAuthSettings, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, 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 Updates the Authentication / Authorization settings associated with + * web app. + * + * Updates the Authentication / Authorization settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} siteAuthSettings Auth settings associated with web app. + * + * @param {boolean} [siteAuthSettings.enabled] true if the + * Authentication / Authorization feature is enabled for the current app; + * otherwise, false. + * + * @param {string} [siteAuthSettings.runtimeVersion] The RuntimeVersion of the + * Authentication / Authorization feature in use for the current app. + * The setting in this value can control the behavior of certain features in + * the Authentication / Authorization module. + * + * @param {string} [siteAuthSettings.unauthenticatedClientAction] The action to + * take when an unauthenticated client attempts to access the app. Possible + * values include: 'RedirectToLoginPage', 'AllowAnonymous' + * + * @param {boolean} [siteAuthSettings.tokenStoreEnabled] true to + * durably store platform-specific security tokens that are obtained during + * login flows; otherwise, false. + * The default is false. + * + * @param {array} [siteAuthSettings.allowedExternalRedirectUrls] External URLs + * that can be redirected to as part of logging in or logging out of the app. + * Note that the query string part of the URL is ignored. + * This is an advanced setting typically only needed by Windows Store + * application backends. + * Note that URLs within the current domain are always implicitly allowed. + * + * @param {string} [siteAuthSettings.defaultProvider] The default + * authentication provider to use when multiple providers are configured. + * This setting is only needed if multiple providers are configured and the + * unauthenticated client + * action is set to "RedirectToLoginPage". Possible values include: + * 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', 'Twitter' + * + * @param {number} [siteAuthSettings.tokenRefreshExtensionHours] The number of + * hours after session token expiration that a session token can be used to + * call the token refresh API. The default is 72 hours. + * + * @param {string} [siteAuthSettings.clientId] The Client ID of this relying + * party application, known as the client_id. + * This setting is required for enabling OpenID Connection authentication with + * Azure Active Directory or + * other 3rd party OpenID Connect providers. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.clientSecret] The Client Secret of this + * relying party application (in Azure Active Directory, this is also referred + * to as the Key). + * This setting is optional. If no client secret is configured, the OpenID + * Connect implicit auth flow is used to authenticate end users. + * Otherwise, the OpenID Connect Authorization Code Flow is used to + * authenticate end users. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.issuer] The OpenID Connect Issuer URI that + * represents the entity which issues access tokens for this application. + * When using Azure Active Directory, this value is the URI of the directory + * tenant, e.g. https://sts.windows.net/{tenant-guid}/. + * This URI is a case-sensitive identifier for the token issuer. + * More information on OpenID Connect Discovery: + * http://openid.net/specs/openid-connect-discovery-1_0.html + * + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. * * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values * to consider when validating JWTs issued by @@ -88288,8 +93378,6 @@ class WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -88320,9 +93408,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -88366,8 +93451,6 @@ class WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName Name of the backup. - * * @param {boolean} [request.enabled] True if the backup schedule is enabled * (must be included in that case), false if the backup schedule should be * disabled. @@ -88398,9 +93481,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -89667,7 +94747,105 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, optionalCallback) { + updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, 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._updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the Push settings associated with web app. + * + * Gets the Push settings associated with 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 {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. + */ + listSitePushSettingsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSitePushSettingsSlot(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 Gets the Push settings associated with web app. + * + * Gets the Push settings associated with 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 {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 {PushSettings} - 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 PushSettings} 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. + */ + listSitePushSettingsSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -89676,29 +94854,30 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, (err, result, request, response) => { + self._listSitePushSettingsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, optionalCallback); + return self._listSitePushSettingsSlot(resourceGroupName, name, slot, options, optionalCallback); } } /** - * @summary Gets the Push settings associated with web app. + * @summary Gets a Swift Virtual Network connection. * - * Gets the Push settings associated with web app. + * Gets a Swift Virtual Network connection. * * @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 get a gateway for the production slot's Virtual + * Network. * * @param {object} [options] Optional Parameters. * @@ -89707,15 +94886,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. */ - listSitePushSettingsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + getSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listSitePushSettingsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -89726,17 +94905,18 @@ class WebApps { } /** - * @summary Gets the Push settings associated with web app. + * @summary Gets a Swift Virtual Network connection. * - * Gets the Push settings associated with web app. + * Gets a Swift Virtual Network connection. * * @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 get a gateway for the production slot's Virtual + * Network. * * @param {object} [options] Optional Parameters. * @@ -89750,7 +94930,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {PushSettings} - The deserialized result object. + * @resolve {SwiftVirtualNetwork} - The deserialized result object. * * @reject {Error} - The error object. * @@ -89759,13 +94939,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 PushSettings} for more information. + * See {@link SwiftVirtualNetwork} 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. */ - listSitePushSettingsSlot(resourceGroupName, name, slot, options, optionalCallback) { + getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -89774,14 +94954,381 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listSitePushSettingsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listSitePushSettingsSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @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 connections 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. + */ + createOrUpdateSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName, name, connectionEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, 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 Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @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 connections 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 {SwiftVirtualNetwork} - 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 SwiftVirtualNetwork} 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. + */ + createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, 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._createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). + * + * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * + * @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 connection 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. + */ + deleteSwiftVirtualNetworkSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteSwiftVirtualNetworkSlot(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 Deletes a Swift Virtual Network connection from an app (or + * deployment slot). + * + * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * + * @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 connection 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 {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. + */ + deleteSwiftVirtualNetworkSlot(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._deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @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 connections 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. + */ + updateSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName, name, connectionEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, 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 Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @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 connections 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 {SwiftVirtualNetwork} - 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 SwiftVirtualNetwork} 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. + */ + updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, 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._updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, optionalCallback); } } @@ -89914,6 +95461,9 @@ class WebApps { * * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * * @param {boolean} [siteConfig.requestTracingEnabled] true if * request tracing is enabled; otherwise, false. * @@ -90091,6 +95641,12 @@ class WebApps { * @param {boolean} [siteConfig.localMySqlEnabled] true to enable * local MySQL; otherwise, false. * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web @@ -90100,6 +95656,13 @@ class WebApps { * minimum version of TLS required for SSL requests. Possible values include: * '1.0', '1.1', '1.2' * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * * @param {string} [siteConfig.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -90157,6 +95720,9 @@ class WebApps { * * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * * @param {boolean} [siteConfig.requestTracingEnabled] true if * request tracing is enabled; otherwise, false. * @@ -90334,6 +95900,12 @@ class WebApps { * @param {boolean} [siteConfig.localMySqlEnabled] true to enable * local MySQL; otherwise, false. * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web @@ -90343,6 +95915,13 @@ class WebApps { * minimum version of TLS required for SSL requests. Possible values include: * '1.0', '1.1', '1.2' * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * * @param {string} [siteConfig.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -90422,6 +96001,9 @@ class WebApps { * * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * * @param {boolean} [siteConfig.requestTracingEnabled] true if * request tracing is enabled; otherwise, false. * @@ -90599,6 +96181,12 @@ class WebApps { * @param {boolean} [siteConfig.localMySqlEnabled] true to enable * local MySQL; otherwise, false. * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web @@ -90608,6 +96196,13 @@ class WebApps { * minimum version of TLS required for SSL requests. Possible values include: * '1.0', '1.1', '1.2' * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * * @param {string} [siteConfig.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -90665,6 +96260,9 @@ class WebApps { * * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * * @param {boolean} [siteConfig.requestTracingEnabled] true if * request tracing is enabled; otherwise, false. * @@ -90842,6 +96440,12 @@ class WebApps { * @param {boolean} [siteConfig.localMySqlEnabled] true to enable * local MySQL; otherwise, false. * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web @@ -90851,6 +96455,13 @@ class WebApps { * minimum version of TLS required for SSL requests. Possible values include: * '1.0', '1.1', '1.2' * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * * @param {string} [siteConfig.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -91332,11 +96943,11 @@ class WebApps { * * @reject {Error} - The error object. */ - getWebSiteContainerLogsZipSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + getContainerLogsZipSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._getContainerLogsZipSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -91385,7 +96996,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, optionalCallback) { + getContainerLogsZipSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -91394,14 +97005,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._getContainerLogsZipSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._getContainerLogsZipSlot(resourceGroupName, name, slot, options, optionalCallback); } } @@ -92093,7 +97704,366 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getDeploymentSlot(resourceGroupName, name, id, slot, options, optionalCallback) { + getDeploymentSlot(resourceGroupName, name, id, 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._getDeploymentSlot(resourceGroupName, name, id, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeploymentSlot(resourceGroupName, name, id, slot, options, optionalCallback); + } + } + + /** + * @summary Create a deployment for an app, or a deployment slot. + * + * Create a deployment 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} id ID of an existing deployment. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API creates a deployment for the production slot. + * + * @param {object} deployment Deployment details. + * + * @param {number} [deployment.status] Deployment status. + * + * @param {string} [deployment.message] Details about deployment status. + * + * @param {string} [deployment.author] Who authored the deployment. + * + * @param {string} [deployment.deployer] Who performed the deployment. + * + * @param {string} [deployment.authorEmail] Author email. + * + * @param {date} [deployment.startTime] Start time. + * + * @param {date} [deployment.endTime] End time. + * + * @param {boolean} [deployment.active] True if deployment is currently active, + * false if completed and null if not started. + * + * @param {string} [deployment.details] Details on deployment. + * + * @param {string} [deployment.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} - The error object. + */ + createDeploymentSlotWithHttpOperationResponse(resourceGroupName, name, id, slot, deployment, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createDeploymentSlot(resourceGroupName, name, id, slot, deployment, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create a deployment for an app, or a deployment slot. + * + * Create a deployment 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} id ID of an existing deployment. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API creates a deployment for the production slot. + * + * @param {object} deployment Deployment details. + * + * @param {number} [deployment.status] Deployment status. + * + * @param {string} [deployment.message] Details about deployment status. + * + * @param {string} [deployment.author] Who authored the deployment. + * + * @param {string} [deployment.deployer] Who performed the deployment. + * + * @param {string} [deployment.authorEmail] Author email. + * + * @param {date} [deployment.startTime] Start time. + * + * @param {date} [deployment.endTime] End time. + * + * @param {boolean} [deployment.active] True if deployment is currently active, + * false if completed and null if not started. + * + * @param {string} [deployment.details] Details on deployment. + * + * @param {string} [deployment.kind] Kind of resource. + * + * @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 {Deployment} - 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 Deployment} 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. + */ + createDeploymentSlot(resourceGroupName, name, id, slot, deployment, 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._createDeploymentSlot(resourceGroupName, name, id, slot, deployment, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createDeploymentSlot(resourceGroupName, name, id, slot, deployment, options, optionalCallback); + } + } + + /** + * @summary Delete a deployment by its ID for an app, or a deployment slot. + * + * Delete a deployment 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} id Deployment ID. + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteDeploymentSlotWithHttpOperationResponse(resourceGroupName, name, id, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteDeploymentSlot(resourceGroupName, name, id, 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 Delete a deployment by its ID for an app, or a deployment slot. + * + * Delete a deployment 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} id Deployment ID. + * + * @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} [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. + */ + deleteDeploymentSlot(resourceGroupName, name, id, 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._deleteDeploymentSlot(resourceGroupName, name, id, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteDeploymentSlot(resourceGroupName, name, id, slot, options, optionalCallback); + } + } + + /** + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. + * + * List deployment log for specific deployment 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} id The ID of a specific deployment. This is the value of the + * name property in the JSON response from "GET + * /api/sites/{siteName}/deployments". + * + * @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. + * + * @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. + */ + listDeploymentLogSlotWithHttpOperationResponse(resourceGroupName, name, id, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listDeploymentLogSlot(resourceGroupName, name, id, 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 List deployment log for specific deployment for an app, or a + * deployment slot. + * + * List deployment log for specific deployment 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} id The ID of a specific deployment. This is the value of the + * name property in the JSON response from "GET + * /api/sites/{siteName}/deployments". + * + * @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. + * + * @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 {Deployment} - 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 Deployment} 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. + */ + listDeploymentLogSlot(resourceGroupName, name, id, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -92102,183 +98072,73 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeploymentSlot(resourceGroupName, name, id, slot, options, (err, result, request, response) => { + self._listDeploymentLogSlot(resourceGroupName, name, id, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getDeploymentSlot(resourceGroupName, name, id, slot, options, optionalCallback); + return self._listDeploymentLogSlot(resourceGroupName, name, id, slot, options, optionalCallback); } } /** - * @summary Create a deployment for an app, or a deployment slot. - * - * Create a deployment 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} id ID of an existing deployment. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API creates a deployment for the production slot. - * - * @param {object} deployment Deployment details. - * - * @param {string} [deployment.deploymentId] Identifier for deployment. - * - * @param {number} [deployment.status] Deployment status. - * - * @param {string} [deployment.message] Details about deployment status. - * - * @param {string} [deployment.author] Who authored the deployment. - * - * @param {string} [deployment.deployer] Who performed the deployment. - * - * @param {string} [deployment.authorEmail] Author email. - * - * @param {date} [deployment.startTime] Start time. - * - * @param {date} [deployment.endTime] End time. - * - * @param {boolean} [deployment.active] True if deployment is currently active, - * false if completed and null if not started. - * - * @param {string} [deployment.details] Details on deployment. - * - * @param {string} [deployment.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} - The error object. - */ - createDeploymentSlotWithHttpOperationResponse(resourceGroupName, name, id, slot, deployment, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createDeploymentSlot(resourceGroupName, name, id, slot, deployment, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Create a deployment for an app, or a deployment slot. + * @summary Discovers an existing app backup that can be restored from a blob + * in Azure storage. Use this to get information about the databases stored in + * a backup. * - * Create a deployment for an app, or a deployment slot. + * Discovers an existing app backup that can be restored from a blob in Azure + * storage. Use this to get information about the databases stored in a backup. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} id ID of an existing deployment. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API creates a deployment for the production slot. - * - * @param {object} deployment Deployment details. - * - * @param {string} [deployment.deploymentId] Identifier for deployment. - * - * @param {number} [deployment.status] Deployment status. - * - * @param {string} [deployment.message] Details about deployment status. - * - * @param {string} [deployment.author] Who authored the deployment. - * - * @param {string} [deployment.deployer] Who performed the deployment. - * - * @param {string} [deployment.authorEmail] Author email. - * - * @param {date} [deployment.startTime] Start time. - * - * @param {date} [deployment.endTime] End time. - * - * @param {boolean} [deployment.active] True if deployment is currently active, - * false if completed and null if not started. - * - * @param {string} [deployment.details] Details on deployment. - * - * @param {string} [deployment.kind] Kind of resource. - * - * @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. + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * {Promise} A promise is returned + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @resolve {Deployment} - The deserialized result object. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @reject {Error} - The error object. + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. * - * {function} optionalCallback(err, result, request, response) + * @param {string} [request.siteName] Name of an app. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Deployment} for more information. + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createDeploymentSlot(resourceGroupName, name, id, slot, deployment, 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._createDeploymentSlot(resourceGroupName, name, id, slot, deployment, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createDeploymentSlot(resourceGroupName, name, id, slot, deployment, options, optionalCallback); - } - } - - /** - * @summary Delete a deployment by its ID for an app, or a deployment slot. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * Delete a deployment by its ID for an app, or a deployment slot. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} name Name of the app. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @param {string} id Deployment ID. + * @param {string} [request.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 perform discovery for the production slot. * * @param {object} [options] Optional Parameters. * @@ -92287,15 +98147,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. */ - deleteDeploymentSlotWithHttpOperationResponse(resourceGroupName, name, id, slot, options) { + discoverBackupSlotWithHttpOperationResponse(resourceGroupName, name, request, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteDeploymentSlot(resourceGroupName, name, id, slot, options, (err, result, request, response) => { + self._discoverBackupSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -92306,128 +98166,61 @@ class WebApps { } /** - * @summary Delete a deployment by its ID for an app, or a deployment slot. + * @summary Discovers an existing app backup that can be restored from a blob + * in Azure storage. Use this to get information about the databases stored in + * a backup. * - * Delete a deployment by its ID for an app, or a deployment slot. + * Discovers an existing app backup that can be restored from a blob in Azure + * storage. Use this to get information about the databases stored in a backup. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} id Deployment ID. - * - * @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} [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. - */ - deleteDeploymentSlot(resourceGroupName, name, id, 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._deleteDeploymentSlot(resourceGroupName, name, id, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteDeploymentSlot(resourceGroupName, name, id, slot, options, optionalCallback); - } - } - - /** - * @summary List deployment log for specific deployment for an app, or a - * deployment slot. - * - * List deployment log for specific deployment for an app, or a deployment - * slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * @param {string} name Name of the app. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {string} id The ID of a specific deployment. This is the value of the - * name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. * - * @param {object} [options] Optional Parameters. + * @param {string} [request.siteName] Name of an app. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * @returns {Promise} A promise is returned + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * @reject {Error} - The error object. - */ - listDeploymentLogSlotWithHttpOperationResponse(resourceGroupName, name, id, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listDeploymentLogSlot(resourceGroupName, name, id, 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 List deployment log for specific deployment for an app, or a - * deployment slot. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * List deployment log for specific deployment for an app, or a deployment - * slot. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} name Name of the app. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @param {string} id The ID of a specific deployment. This is the value of the - * name property in the JSON response from "GET - * /api/sites/{siteName}/deployments". + * @param {string} [request.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 perform discovery for the production slot. * * @param {object} [options] Optional Parameters. * @@ -92441,7 +98234,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Deployment} - The deserialized result object. + * @resolve {RestoreRequest} - The deserialized result object. * * @reject {Error} - The error object. * @@ -92450,13 +98243,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 Deployment} for more information. + * See {@link RestoreRequest} 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. */ - listDeploymentLogSlot(resourceGroupName, name, id, slot, options, optionalCallback) { + discoverBackupSlot(resourceGroupName, name, request, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -92465,14 +98258,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listDeploymentLogSlot(resourceGroupName, name, id, slot, options, (err, result, request, response) => { + self._discoverBackupSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listDeploymentLogSlot(resourceGroupName, name, id, slot, options, optionalCallback); + return self._discoverBackupSlot(resourceGroupName, name, request, slot, options, optionalCallback); } } @@ -93696,6 +99489,8 @@ class WebApps { * * @param {object} functionEnvelope Function details. * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * * @param {string} [functionEnvelope.scriptHref] Script URI. @@ -93757,6 +99552,8 @@ class WebApps { * * @param {object} functionEnvelope Function details. * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * * @param {string} [functionEnvelope.scriptHref] Script URI. @@ -98558,12 +104355,6 @@ class WebApps { * * @param {string} [premierAddOn.vendor] Premier add on Vendor. * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * * @param {string} [premierAddOn.marketplacePublisher] Premier add on * Marketplace publisher. * @@ -98625,12 +104416,6 @@ class WebApps { * * @param {string} [premierAddOn.vendor] Premier add on Vendor. * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * * @param {string} [premierAddOn.marketplacePublisher] Premier add on * Marketplace publisher. * @@ -98794,6 +104579,360 @@ class WebApps { } } + /** + * @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} 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. + * + * @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. + */ + updatePremierAddOnSlotWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, 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 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} 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. + * + * @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. + */ + updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, 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._updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, optionalCallback); + } + } + + /** + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the 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 The name of the web app. + * + * @param {string} slot The name of the slot for 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. + */ + getPrivateAccessSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getPrivateAccessSlot(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 Gets data around private site access enablement and authorized + * Virtual Networks that can access the 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 The name of the web app. + * + * @param {string} slot The name of the slot for 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 {PrivateAccess} - 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 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. + */ + getPrivateAccessSlot(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._getPrivateAccessSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getPrivateAccessSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the 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 The name of the web app. + * + * @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 {string} slot The name of the slot for 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. + */ + putPrivateAccessVnetSlotWithHttpOperationResponse(resourceGroupName, name, access, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._putPrivateAccessVnetSlot(resourceGroupName, name, access, 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 Sets data around private site access enablement and authorized + * Virtual Networks that can access the 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 The name of the web app. + * + * @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 {string} slot The name of the slot for 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 {PrivateAccess} - 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 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. + */ + putPrivateAccessVnetSlot(resourceGroupName, name, access, 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._putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, options, optionalCallback); + } + } + /** * @summary Get list of processes for a web site, or a deployment slot, or for * a specific scaled-out instance in a web site. @@ -100186,46 +106325,420 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * Recovers a web app to a previous snapshot. + * 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 web app. + * @param {string} name Name of the app. * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API resets configuration settings for the production slot. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {object} [options] Optional Parameters. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @returns {Promise} A promise is returned * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {boolean} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. + * @reject {Error} - The error object. + */ + resetSlotConfigurationSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._resetSlotConfigurationSlot(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 Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. + * Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * @param {boolean} [recoveryEntity.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} 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} [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. + */ + resetSlotConfigurationSlot(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._resetSlotConfigurationSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._resetSlotConfigurationSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Restarts an app (or deployment slot, if specified). + * + * Restarts 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 will restart the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.softRestart] Specify true to apply the + * configuration settings and restarts the app only if necessary. By default, + * the API always restarts and reprovisions the app. + * + * @param {boolean} [options.synchronous] Specify true to block until the app + * is restarted. By default, it is set to false, and the API responds + * immediately (asynchronous). + * + * @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. + */ + restartSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._restartSlot(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 Restarts an app (or deployment slot, if specified). + * + * Restarts 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 will restart the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.softRestart] Specify true to apply the + * configuration settings and restarts the app only if necessary. By default, + * the API always restarts and reprovisions the app. + * + * @param {boolean} [options.synchronous] Specify true to block until the app + * is restarted. By default, it is set to false, and the API responds + * immediately (asynchronous). + * + * @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. + */ + restartSlot(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._restartSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restartSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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 {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. + */ + restoreFromBackupBlobSlotWithHttpOperationResponse(resourceGroupName, name, request, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._restoreFromBackupBlobSlot(resourceGroupName, name, request, 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 Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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 {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. + */ + restoreFromBackupBlobSlot(resourceGroupName, name, request, 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._restoreFromBackupBlobSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restoreFromBackupBlobSlot(resourceGroupName, name, request, slot, options, optionalCallback); + } + } + + /** + * @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 {string} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will * default to production slot. @@ -100241,11 +106754,11 @@ class WebApps { * * @reject {Error} - The error object. */ - recoverSlotWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, slot, options) { + restoreFromDeletedAppSlotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, result, request, response) => { + self._restoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -100256,46 +106769,29 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a deleted web app to this web app. * - * Recovers a web app to a previous snapshot. + * 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @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} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will * default to production slot. @@ -100326,7 +106822,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, optionalCallback) { + restoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -100335,141 +106831,65 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, result, request, response) => { + self._restoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, optionalCallback); + return self._restoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback); } } /** - * @summary Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * @summary Restores a web app from a snapshot. * - * Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * 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 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 - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - resetSlotConfigurationSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._resetSlotConfigurationSlot(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 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} [optionalCallback] - The optional callback. + * @param {string} name Name of web app. * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * {Promise} A promise is returned + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @resolve {null} - The deserialized result object. + * @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. * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * {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. + * @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. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - resetSlotConfigurationSlot(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._resetSlotConfigurationSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._resetSlotConfigurationSlot(resourceGroupName, name, slot, options, optionalCallback); - } - } - - /** - * @summary Restarts an app (or deployment slot, if specified). + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. * - * Restarts an app (or deployment slot, if specified). + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @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} name Name of the app. + * @param {string} [restoreRequest.kind] Kind of resource. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will restart 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 {boolean} [options.softRestart] Specify true to apply the - * configuration settings and restarts the app only if necessary. By default, - * the API always restarts and reprovisions the app. - * - * @param {boolean} [options.synchronous] Specify true to block until the app - * is restarted. By default, it is set to false, and the API responds - * immediately (asynchronous). - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -100479,11 +106899,11 @@ class WebApps { * * @reject {Error} - The error object. */ - restartSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + restoreSnapshotSlotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._restartSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._restoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -100494,27 +106914,52 @@ class WebApps { } /** - * @summary Restarts an app (or deployment slot, if specified). + * @summary Restores a web app from a snapshot. * - * Restarts an app (or deployment slot, if specified). + * 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 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 restart the production slot. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {object} [options] Optional Parameters. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {boolean} [options.softRestart] Specify true to apply the - * configuration settings and restarts the app only if necessary. By default, - * the API always restarts and reprovisions the app. + * @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 {boolean} [options.synchronous] Specify true to block until the app - * is restarted. By default, it is set to false, and the API responds - * immediately (asynchronous). + * @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 {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 @@ -100540,7 +106985,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - restartSlot(resourceGroupName, name, slot, options, optionalCallback) { + restoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -100549,14 +106994,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._restartSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._restoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._restartSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._restoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback); } } @@ -107014,6 +113459,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -107032,6 +113479,9 @@ class WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -107230,6 +113680,12 @@ class WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -107240,6 +113696,13 @@ class WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -107315,43 +113778,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -107359,7 +113785,10 @@ class WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -107422,6 +113851,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -107440,6 +113871,9 @@ class WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -107638,6 +114072,12 @@ class WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -107648,6 +114088,13 @@ class WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -107723,43 +114170,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -107767,7 +114177,10 @@ class WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -107865,7 +114278,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -107883,7 +114296,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. */ @@ -107944,7 +114357,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -107967,7 +114380,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -107975,8 +114388,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. - * See {@link RestoreResponse} 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. * @@ -108256,6 +114668,8 @@ class WebApps { * * @param {object} functionEnvelope Function details. * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * * @param {string} [functionEnvelope.scriptHref] Script URI. @@ -108314,6 +114728,8 @@ class WebApps { * * @param {object} functionEnvelope Function details. * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * * @param {string} [functionEnvelope.scriptHref] Script URI. @@ -108692,15 +115108,159 @@ 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. + */ + beginMigrateMySqlWithHttpOperationResponse(resourceGroupName, name, migrationRequestEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @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 {Operation} - 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 Operation} 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. + */ + beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, 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._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, optionalCallback); + } + } + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.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} - The error object. */ - beginMigrateMySqlWithHttpOperationResponse(resourceGroupName, name, migrationRequestEnvelope, options) { + beginRestoreFromBackupBlobWithHttpOperationResponse(resourceGroupName, name, request, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { + self._beginRestoreFromBackupBlob(resourceGroupName, name, request, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -108711,26 +115271,175 @@ class WebApps { } /** - * @summary Migrates a local (in-app) MySql database to a remote MySql - * database. + * @summary Restores an app from a backup blob in Azure Storage. * - * Migrates a local (in-app) MySql database to a remote MySql database. + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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. + */ + beginRestoreFromBackupBlob(resourceGroupName, name, request, 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._beginRestoreFromBackupBlob(resourceGroupName, name, request, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRestoreFromBackupBlob(resourceGroupName, name, request, options, optionalCallback); + } + } + + /** + * @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} migrationRequestEnvelope MySql migration options. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {string} migrationRequestEnvelope.connectionString Connection string - * to the remote MySQL database. + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} * - * @param {string} migrationRequestEnvelope.migrationType The type of migration - * operation to be done. Possible values include: 'LocalToRemote', - * 'RemoteToLocal' + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. * - * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * @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} [restoreRequest.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} - The error object. + */ + beginRestoreFromDeletedAppWithHttpOperationResponse(resourceGroupName, name, restoreRequest, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @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 {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -108744,7 +115453,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Operation} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -108752,14 +115461,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 Operation} 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. */ - beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, optionalCallback) { + beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -108768,58 +115476,59 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { + self._beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, optionalCallback); + return self._beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, optionalCallback); } } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -108832,11 +115541,11 @@ class WebApps { * * @reject {Error} - The error object. */ - beginRecoverWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, options) { + beginRestoreSnapshotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginRecover(resourceGroupName, name, recoveryEntity, options, (err, result, request, response) => { + self._beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -108847,46 +115556,47 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -108914,7 +115624,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginRecover(resourceGroupName, name, recoveryEntity, options, optionalCallback) { + beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -108923,14 +115633,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginRecover(resourceGroupName, name, recoveryEntity, options, (err, result, request, response) => { + self._beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginRecover(resourceGroupName, name, recoveryEntity, options, optionalCallback); + return self._beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, optionalCallback); } } @@ -109060,6 +115770,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -109078,6 +115790,9 @@ class WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -109276,6 +115991,12 @@ class WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -109286,6 +116007,13 @@ class WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -109361,43 +116089,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -109405,7 +116096,10 @@ class WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -109418,19 +116112,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -109484,6 +116165,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -109502,6 +116185,9 @@ class WebApps { * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework * and version * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] * true if request tracing is enabled; otherwise, * false. @@ -109700,6 +116386,12 @@ class WebApps { * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] * true to enable local MySQL; otherwise, false. * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security * restrictions. * @@ -109710,6 +116402,13 @@ class WebApps { * configures the minimum version of TLS required for SSL requests. Possible * values include: '1.0', '1.1', '1.2' * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop * SCM (KUDU) site when the app is stopped; otherwise, false. The * default is false. @@ -109785,43 +116484,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -109829,7 +116491,10 @@ class WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -109842,19 +116507,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -109943,7 +116595,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -109964,7 +116616,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. */ @@ -110025,7 +116677,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -110051,7 +116703,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -110059,8 +116711,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. - * See {@link RestoreResponse} 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. * @@ -110357,6 +117008,8 @@ class WebApps { * * @param {object} functionEnvelope Function details. * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * * @param {string} [functionEnvelope.scriptHref] Script URI. @@ -110418,6 +117071,8 @@ class WebApps { * * @param {object} functionEnvelope Function details. * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * * @param {string} [functionEnvelope.scriptHref] Script URI. @@ -110643,46 +117298,351 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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 {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. + */ + beginRestoreFromBackupBlobSlotWithHttpOperationResponse(resourceGroupName, name, request, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, 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 Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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 {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. + */ + beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, 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._beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, slot, options, optionalCallback); + } + } + + /** + * @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 {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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginRestoreFromDeletedAppSlotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, 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 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 {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} [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. + */ + beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, 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._beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback); + } + } + + /** + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will * default to production slot. @@ -110698,11 +117658,11 @@ class WebApps { * * @reject {Error} - The error object. */ - beginRecoverSlotWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, slot, options) { + beginRestoreSnapshotSlotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, result, request, response) => { + self._beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -110713,46 +117673,47 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will * default to production slot. @@ -110783,7 +117744,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, optionalCallback) { + beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -110792,14 +117753,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, result, request, response) => { + self._beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, optionalCallback); + return self._beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback); } } diff --git a/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts b/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts index 0016cb7d6d..981bca0184 100644 --- a/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts +++ b/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts @@ -47,6 +47,8 @@ export default class WebSiteManagementClient extends AzureServiceClient { subscriptionId: string; + apiVersion: string; + acceptLanguage: string; longRunningOperationRetryTimeout: number; @@ -64,8 +66,6 @@ export default class WebSiteManagementClient extends AzureServiceClient { diagnostics: operations.Diagnostics; provider: operations.Provider; recommendations: operations.Recommendations; - resourceHealthMetadataOperations: operations.ResourceHealthMetadataOperations; - billingMeters: operations.BillingMeters; webApps: operations.WebApps; appServiceEnvironments: operations.AppServiceEnvironments; appServicePlans: operations.AppServicePlans; @@ -133,8 +133,6 @@ export default class WebSiteManagementClient extends AzureServiceClient { * * @param {object} userDetails Details of publishing user * - * @param {string} [userDetails.userName] Username - * * @param {string} userDetails.publishingUserName Username used for publishing. * * @param {string} [userDetails.publishingPassword] Password used for @@ -146,6 +144,8 @@ export default class WebSiteManagementClient extends AzureServiceClient { * @param {string} [userDetails.publishingPasswordHashSalt] Password hash salt * used for publishing. * + * @param {string} [userDetails.scmUri] Url of SCM site. + * * @param {string} [userDetails.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -168,8 +168,6 @@ export default class WebSiteManagementClient extends AzureServiceClient { * * @param {object} userDetails Details of publishing user * - * @param {string} [userDetails.userName] Username - * * @param {string} userDetails.publishingUserName Username used for publishing. * * @param {string} [userDetails.publishingPassword] Password used for @@ -181,6 +179,8 @@ export default class WebSiteManagementClient extends AzureServiceClient { * @param {string} [userDetails.publishingPasswordHashSalt] Password hash salt * used for publishing. * + * @param {string} [userDetails.scmUri] Url of SCM site. + * * @param {string} [userDetails.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -339,9 +339,6 @@ export default class WebSiteManagementClient extends AzureServiceClient { * * @param {object} requestMessage Source control token information * - * @param {string} [requestMessage.sourceControlName] Name or source control - * type. - * * @param {string} [requestMessage.token] OAuth access token. * * @param {string} [requestMessage.tokenSecret] OAuth access token secret. @@ -374,9 +371,6 @@ export default class WebSiteManagementClient extends AzureServiceClient { * * @param {object} requestMessage Source control token information * - * @param {string} [requestMessage.sourceControlName] Name or source control - * type. - * * @param {string} [requestMessage.token] OAuth access token. * * @param {string} [requestMessage.tokenSecret] OAuth access token secret. @@ -419,6 +413,72 @@ export default class WebSiteManagementClient extends AzureServiceClient { updateSourceControl(sourceControlType: string, requestMessage: models.SourceControl, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @param {string} [options.osType] App Service OS type meters used for + * + * @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. + */ + listBillingMetersWithHttpOperationResponse(options?: { billingLocation? : string, osType? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @param {string} [options.osType] App Service OS type meters used for + * + * @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 {BillingMeterCollection} - 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. + * + * {BillingMeterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link BillingMeterCollection} 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. + */ + listBillingMeters(options?: { billingLocation? : string, osType? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listBillingMeters(callback: ServiceCallback): void; + listBillingMeters(options: { billingLocation? : string, osType? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Check if a resource name is available. * @@ -557,11 +617,14 @@ export default class WebSiteManagementClient extends AzureServiceClient { * * @param {string} [options.sku] Name of SKU used to filter the regions. * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', - * 'PremiumV2', 'Dynamic', 'Isolated' + * 'Dynamic', 'Isolated', 'PremiumV2' * * @param {boolean} [options.linuxWorkersEnabled] Specify true if * you want to filter to only regions that support Linux workers. * + * @param {boolean} [options.xenonWorkersEnabled] Specify true if + * you want to filter to only regions that support Xenon workers. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -571,7 +634,7 @@ export default class WebSiteManagementClient extends AzureServiceClient { * * @reject {Error|ServiceError} - The error object. */ - listGeoRegionsWithHttpOperationResponse(options?: { sku? : string, linuxWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + listGeoRegionsWithHttpOperationResponse(options?: { sku? : string, linuxWorkersEnabled? : boolean, xenonWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Get a list of available geographical regions. @@ -582,11 +645,14 @@ export default class WebSiteManagementClient extends AzureServiceClient { * * @param {string} [options.sku] Name of SKU used to filter the regions. * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', - * 'PremiumV2', 'Dynamic', 'Isolated' + * 'Dynamic', 'Isolated', 'PremiumV2' * * @param {boolean} [options.linuxWorkersEnabled] Specify true if * you want to filter to only regions that support Linux workers. * + * @param {boolean} [options.xenonWorkersEnabled] Specify true if + * you want to filter to only regions that support Xenon workers. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -612,9 +678,9 @@ export default class WebSiteManagementClient extends AzureServiceClient { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listGeoRegions(options?: { sku? : string, linuxWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + listGeoRegions(options?: { sku? : string, linuxWorkersEnabled? : boolean, xenonWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; listGeoRegions(callback: ServiceCallback): void; - listGeoRegions(options: { sku? : string, linuxWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listGeoRegions(options: { sku? : string, linuxWorkersEnabled? : boolean, xenonWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -978,6 +1044,9 @@ export default class WebSiteManagementClient extends AzureServiceClient { * @param {string} [validateRequest.hostingEnvironment] Name of App Service * Environment where app or App Service plan should be created. * + * @param {boolean} [validateRequest.isXenon] true if App Service + * plan is running as a windows container + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1026,6 +1095,9 @@ export default class WebSiteManagementClient extends AzureServiceClient { * @param {string} [validateRequest.hostingEnvironment] Name of App Service * Environment where app or App Service plan should be created. * + * @param {boolean} [validateRequest.isXenon] true if App Service + * plan is running as a windows container + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1194,6 +1266,68 @@ export default class WebSiteManagementClient extends AzureServiceClient { listSourceControlsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @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. + */ + listBillingMetersNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @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 {BillingMeterCollection} - 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. + * + * {BillingMeterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link BillingMeterCollection} 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. + */ + listBillingMetersNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBillingMetersNext(nextPageLink: string, callback: ServiceCallback): void; + listBillingMetersNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Get a list of available geographical regions. * diff --git a/lib/services/websiteManagement2/lib/webSiteManagementClient.js b/lib/services/websiteManagement2/lib/webSiteManagementClient.js index beb4798477..50a4849d43 100644 --- a/lib/services/websiteManagement2/lib/webSiteManagementClient.js +++ b/lib/services/websiteManagement2/lib/webSiteManagementClient.js @@ -56,9 +56,11 @@ function _getPublishingUser(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } @@ -70,7 +72,7 @@ function _getPublishingUser(options, callback) { let baseUrl = this.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/publishingUsers/web'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -112,12 +114,13 @@ function _getPublishingUser(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) { @@ -159,8 +162,6 @@ function _getPublishingUser(options, callback) { * * @param {object} userDetails Details of publishing user * - * @param {string} [userDetails.userName] Username - * * @param {string} userDetails.publishingUserName Username used for publishing. * * @param {string} [userDetails.publishingPassword] Password used for @@ -172,6 +173,8 @@ function _getPublishingUser(options, callback) { * @param {string} [userDetails.publishingPasswordHashSalt] Password hash salt * used for publishing. * + * @param {string} [userDetails.scmUri] Url of SCM site. + * * @param {string} [userDetails.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -202,12 +205,14 @@ function _updatePublishingUser(userDetails, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (userDetails === null || userDetails === undefined) { throw new Error('userDetails cannot be null or undefined.'); } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } @@ -219,7 +224,7 @@ function _updatePublishingUser(userDetails, options, callback) { let baseUrl = this.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/publishingUsers/web'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -275,12 +280,13 @@ function _updatePublishingUser(userDetails, 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) { @@ -349,9 +355,11 @@ function _listSourceControls(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } @@ -363,7 +371,7 @@ function _listSourceControls(options, callback) { let baseUrl = this.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/sourcecontrols'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -405,12 +413,13 @@ function _listSourceControls(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) { @@ -480,12 +489,14 @@ function _getSourceControl(sourceControlType, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (sourceControlType === null || sourceControlType === undefined || typeof sourceControlType.valueOf() !== 'string') { throw new Error('sourceControlType cannot be null or undefined and it must be of type string.'); } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } @@ -498,7 +509,7 @@ function _getSourceControl(sourceControlType, options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/sourcecontrols/{sourceControlType}'; requestUrl = requestUrl.replace('{sourceControlType}', encodeURIComponent(sourceControlType)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -540,12 +551,13 @@ function _getSourceControl(sourceControlType, 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) { @@ -589,9 +601,6 @@ function _getSourceControl(sourceControlType, options, callback) { * * @param {object} requestMessage Source control token information * - * @param {string} [requestMessage.sourceControlName] Name or source control - * type. - * * @param {string} [requestMessage.token] OAuth access token. * * @param {string} [requestMessage.tokenSecret] OAuth access token secret. @@ -630,7 +639,6 @@ function _updateSourceControl(sourceControlType, requestMessage, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (sourceControlType === null || sourceControlType === undefined || typeof sourceControlType.valueOf() !== 'string') { @@ -639,6 +647,9 @@ function _updateSourceControl(sourceControlType, requestMessage, options, callba if (requestMessage === null || requestMessage === undefined) { throw new Error('requestMessage cannot be null or undefined.'); } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } @@ -651,7 +662,7 @@ function _updateSourceControl(sourceControlType, requestMessage, options, callba let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/sourcecontrols/{sourceControlType}'; requestUrl = requestUrl.replace('{sourceControlType}', encodeURIComponent(sourceControlType)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -707,12 +718,13 @@ function _updateSourceControl(sourceControlType, requestMessage, 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) { @@ -747,6 +759,162 @@ function _updateSourceControl(sourceControlType, requestMessage, options, callba }); } +/** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @param {string} [options.osType] App Service OS type meters used for + * + * @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 BillingMeterCollection} 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 _listBillingMeters(options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let billingLocation = (options && options.billingLocation !== undefined) ? options.billingLocation : undefined; + let osType = (options && options.osType !== undefined) ? options.osType : undefined; + // Validate + try { + if (billingLocation !== null && billingLocation !== undefined && typeof billingLocation.valueOf() !== 'string') { + throw new Error('billingLocation must be of type string.'); + } + if (osType !== null && osType !== undefined && typeof osType.valueOf() !== 'string') { + throw new Error('osType must be of type string.'); + } + if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { + throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); + let queryParameters = []; + if (billingLocation !== null && billingLocation !== undefined) { + queryParameters.push('billingLocation=' + encodeURIComponent(billingLocation)); + } + if (osType !== null && osType !== undefined) { + queryParameters.push('osType=' + encodeURIComponent(osType)); + } + queryParameters.push('api-version=' + encodeURIComponent(this.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.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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['BillingMeterCollection']().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 Check if a resource name is available. * @@ -791,12 +959,14 @@ function _checkNameAvailability(name, type, options, callback) { throw new Error('callback cannot be null.'); } let isFqdn = (options && options.isFqdn !== undefined) ? options.isFqdn : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } 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.'); } @@ -825,7 +995,7 @@ function _checkNameAvailability(name, type, options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -881,12 +1051,13 @@ function _checkNameAvailability(name, type, 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) { @@ -954,12 +1125,14 @@ function _getSubscriptionDeploymentLocations(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } @@ -972,7 +1145,7 @@ function _getSubscriptionDeploymentLocations(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/deploymentLocations'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1014,12 +1187,13 @@ function _getSubscriptionDeploymentLocations(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) { @@ -1063,11 +1237,14 @@ function _getSubscriptionDeploymentLocations(options, callback) { * * @param {string} [options.sku] Name of SKU used to filter the regions. * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', - * 'PremiumV2', 'Dynamic', 'Isolated' + * 'Dynamic', 'Isolated', 'PremiumV2' * * @param {boolean} [options.linuxWorkersEnabled] Specify true if * you want to filter to only regions that support Linux workers. * + * @param {boolean} [options.xenonWorkersEnabled] Specify true if + * you want to filter to only regions that support Xenon workers. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1096,7 +1273,7 @@ function _listGeoRegions(options, callback) { } let sku = (options && options.sku !== undefined) ? options.sku : undefined; let linuxWorkersEnabled = (options && options.linuxWorkersEnabled !== undefined) ? options.linuxWorkersEnabled : undefined; - let apiVersion = '2016-03-01'; + let xenonWorkersEnabled = (options && options.xenonWorkersEnabled !== undefined) ? options.xenonWorkersEnabled : undefined; // Validate try { if (sku !== null && sku !== undefined && typeof sku.valueOf() !== 'string') { @@ -1105,9 +1282,15 @@ function _listGeoRegions(options, callback) { if (linuxWorkersEnabled !== null && linuxWorkersEnabled !== undefined && typeof linuxWorkersEnabled !== 'boolean') { throw new Error('linuxWorkersEnabled must be of type boolean.'); } + if (xenonWorkersEnabled !== null && xenonWorkersEnabled !== undefined && typeof xenonWorkersEnabled !== 'boolean') { + throw new Error('xenonWorkersEnabled must be of type boolean.'); + } if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } @@ -1126,7 +1309,10 @@ function _listGeoRegions(options, callback) { if (linuxWorkersEnabled !== null && linuxWorkersEnabled !== undefined) { queryParameters.push('linuxWorkersEnabled=' + encodeURIComponent(linuxWorkersEnabled.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (xenonWorkersEnabled !== null && xenonWorkersEnabled !== undefined) { + queryParameters.push('xenonWorkersEnabled=' + encodeURIComponent(xenonWorkersEnabled.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1168,12 +1354,13 @@ function _listGeoRegions(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) { @@ -1244,12 +1431,14 @@ function _listSiteIdentifiersAssignedToHostName(options, callback) { throw new Error('callback cannot be null.'); } let name = (options && options.name !== undefined) ? options.name : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } if (name !== null && name !== undefined && typeof name.valueOf() !== 'string') { throw new Error('name must be of type string.'); } @@ -1270,7 +1459,7 @@ function _listSiteIdentifiersAssignedToHostName(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/listSitesAssignedToHostName'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1326,12 +1515,13 @@ function _listSiteIdentifiersAssignedToHostName(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) { @@ -1400,12 +1590,14 @@ function _listPremierAddOnOffers(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } @@ -1418,7 +1610,7 @@ function _listPremierAddOnOffers(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/premieraddonoffers'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1460,12 +1652,13 @@ function _listPremierAddOnOffers(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) { @@ -1533,12 +1726,14 @@ function _listSkus(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } @@ -1551,7 +1746,7 @@ function _listSkus(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/skus'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1593,12 +1788,13 @@ function _listSkus(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) { @@ -1680,7 +1876,6 @@ function _verifyHostingEnvironmentVnet(parameters, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (parameters === null || parameters === undefined) { @@ -1689,6 +1884,9 @@ function _verifyHostingEnvironmentVnet(parameters, options, callback) { if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } @@ -1701,7 +1899,7 @@ function _verifyHostingEnvironmentVnet(parameters, options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/verifyHostingEnvironmentVnet'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1757,12 +1955,13 @@ function _verifyHostingEnvironmentVnet(parameters, 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) { @@ -1839,7 +2038,6 @@ function _move(resourceGroupName, moveResourceEnvelope, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1865,6 +2063,9 @@ function _move(resourceGroupName, moveResourceEnvelope, options, callback) { if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } @@ -1878,7 +2079,7 @@ function _move(resourceGroupName, moveResourceEnvelope, options, callback) { requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1992,6 +2193,9 @@ function _move(resourceGroupName, moveResourceEnvelope, options, callback) { * @param {string} [validateRequest.hostingEnvironment] Name of App Service * Environment where app or App Service plan should be created. * + * @param {boolean} [validateRequest.isXenon] true if App Service + * plan is running as a windows container + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2020,7 +2224,6 @@ function _validate(resourceGroupName, validateRequest, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2046,6 +2249,9 @@ function _validate(resourceGroupName, validateRequest, options, callback) { if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } @@ -2059,7 +2265,7 @@ function _validate(resourceGroupName, validateRequest, options, callback) { requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2115,12 +2321,13 @@ function _validate(resourceGroupName, validateRequest, 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) { @@ -2197,7 +2404,6 @@ function _validateMove(resourceGroupName, moveResourceEnvelope, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2223,6 +2429,9 @@ function _validateMove(resourceGroupName, moveResourceEnvelope, options, callbac if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } @@ -2236,7 +2445,7 @@ function _validateMove(resourceGroupName, moveResourceEnvelope, options, callbac requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2405,12 +2614,13 @@ function _listSourceControlsNext(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) { @@ -2445,6 +2655,137 @@ function _listSourceControlsNext(nextPageLink, options, callback) { }); } +/** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @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 BillingMeterCollection} 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 _listBillingMetersNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this; + 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.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.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.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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['BillingMeterCollection']().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 list of available geographical regions. * @@ -2534,12 +2875,13 @@ function _listGeoRegionsNext(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) { @@ -2663,12 +3005,13 @@ function _listSiteIdentifiersAssignedToHostNameNext(nextPageLink, 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) { @@ -2793,12 +3136,13 @@ function _listPremierAddOnOffersNext(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) { @@ -2861,6 +3205,7 @@ class WebSiteManagementClient extends ServiceClient { super(credentials, options); + this.apiVersion = '2018-02-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -2892,8 +3237,6 @@ class WebSiteManagementClient extends ServiceClient { this.diagnostics = new operations.Diagnostics(this); this.provider = new operations.Provider(this); this.recommendations = new operations.Recommendations(this); - this.resourceHealthMetadataOperations = new operations.ResourceHealthMetadataOperations(this); - this.billingMeters = new operations.BillingMeters(this); this.webApps = new operations.WebApps(this); this.appServiceEnvironments = new operations.AppServiceEnvironments(this); this.appServicePlans = new operations.AppServicePlans(this); @@ -2903,6 +3246,7 @@ class WebSiteManagementClient extends ServiceClient { this._listSourceControls = _listSourceControls; this._getSourceControl = _getSourceControl; this._updateSourceControl = _updateSourceControl; + this._listBillingMeters = _listBillingMeters; this._checkNameAvailability = _checkNameAvailability; this._getSubscriptionDeploymentLocations = _getSubscriptionDeploymentLocations; this._listGeoRegions = _listGeoRegions; @@ -2914,6 +3258,7 @@ class WebSiteManagementClient extends ServiceClient { this._validate = _validate; this._validateMove = _validateMove; this._listSourceControlsNext = _listSourceControlsNext; + this._listBillingMetersNext = _listBillingMetersNext; this._listGeoRegionsNext = _listGeoRegionsNext; this._listSiteIdentifiersAssignedToHostNameNext = _listSiteIdentifiersAssignedToHostNameNext; this._listPremierAddOnOffersNext = _listPremierAddOnOffersNext; @@ -3009,8 +3354,6 @@ class WebSiteManagementClient extends ServiceClient { * * @param {object} userDetails Details of publishing user * - * @param {string} [userDetails.userName] Username - * * @param {string} userDetails.publishingUserName Username used for publishing. * * @param {string} [userDetails.publishingPassword] Password used for @@ -3022,6 +3365,8 @@ class WebSiteManagementClient extends ServiceClient { * @param {string} [userDetails.publishingPasswordHashSalt] Password hash salt * used for publishing. * + * @param {string} [userDetails.scmUri] Url of SCM site. + * * @param {string} [userDetails.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -3056,8 +3401,6 @@ class WebSiteManagementClient extends ServiceClient { * * @param {object} userDetails Details of publishing user * - * @param {string} [userDetails.userName] Username - * * @param {string} userDetails.publishingUserName Username used for publishing. * * @param {string} [userDetails.publishingPassword] Password used for @@ -3069,6 +3412,8 @@ class WebSiteManagementClient extends ServiceClient { * @param {string} [userDetails.publishingPasswordHashSalt] Password hash salt * used for publishing. * + * @param {string} [userDetails.scmUri] Url of SCM site. + * * @param {string} [userDetails.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -3296,9 +3641,6 @@ class WebSiteManagementClient extends ServiceClient { * * @param {object} requestMessage Source control token information * - * @param {string} [requestMessage.sourceControlName] Name or source control - * type. - * * @param {string} [requestMessage.token] OAuth access token. * * @param {string} [requestMessage.tokenSecret] OAuth access token secret. @@ -3343,9 +3685,6 @@ class WebSiteManagementClient extends ServiceClient { * * @param {object} requestMessage Source control token information * - * @param {string} [requestMessage.sourceControlName] Name or source control - * type. - * * @param {string} [requestMessage.token] OAuth access token. * * @param {string} [requestMessage.tokenSecret] OAuth access token secret. @@ -3403,6 +3742,99 @@ class WebSiteManagementClient extends ServiceClient { } } + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @param {string} [options.osType] App Service OS type meters used for + * + * @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. + */ + listBillingMetersWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._listBillingMeters(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 list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @param {string} [options.osType] App Service OS type meters used for + * + * @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 {BillingMeterCollection} - 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 BillingMeterCollection} 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. + */ + listBillingMeters(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listBillingMeters(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBillingMeters(options, optionalCallback); + } + } + /** * @summary Check if a resource name is available. * @@ -3595,11 +4027,14 @@ class WebSiteManagementClient extends ServiceClient { * * @param {string} [options.sku] Name of SKU used to filter the regions. * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', - * 'PremiumV2', 'Dynamic', 'Isolated' + * 'Dynamic', 'Isolated', 'PremiumV2' * * @param {boolean} [options.linuxWorkersEnabled] Specify true if * you want to filter to only regions that support Linux workers. * + * @param {boolean} [options.xenonWorkersEnabled] Specify true if + * you want to filter to only regions that support Xenon workers. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -3632,11 +4067,14 @@ class WebSiteManagementClient extends ServiceClient { * * @param {string} [options.sku] Name of SKU used to filter the regions. * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', - * 'PremiumV2', 'Dynamic', 'Isolated' + * 'Dynamic', 'Isolated', 'PremiumV2' * * @param {boolean} [options.linuxWorkersEnabled] Specify true if * you want to filter to only regions that support Linux workers. * + * @param {boolean} [options.xenonWorkersEnabled] Specify true if + * you want to filter to only regions that support Xenon workers. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -4178,6 +4616,9 @@ class WebSiteManagementClient extends ServiceClient { * @param {string} [validateRequest.hostingEnvironment] Name of App Service * Environment where app or App Service plan should be created. * + * @param {boolean} [validateRequest.isXenon] true if App Service + * plan is running as a windows container + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4238,6 +4679,9 @@ class WebSiteManagementClient extends ServiceClient { * @param {string} [validateRequest.hostingEnvironment] Name of App Service * Environment where app or App Service plan should be created. * + * @param {boolean} [validateRequest.isXenon] true if App Service + * plan is running as a windows container + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4475,6 +4919,95 @@ class WebSiteManagementClient extends ServiceClient { } } + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @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. + */ + listBillingMetersNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._listBillingMetersNext(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 Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @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 {BillingMeterCollection} - 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 BillingMeterCollection} 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. + */ + listBillingMetersNext(nextPageLink, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listBillingMetersNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBillingMetersNext(nextPageLink, options, optionalCallback); + } + } + /** * @summary Get a list of available geographical regions. *