diff --git a/lib/services/websiteManagement2/LICENSE.txt b/lib/services/websiteManagement2/LICENSE.txt index 5431ba98b9..8f3d856145 100644 --- a/lib/services/websiteManagement2/LICENSE.txt +++ b/lib/services/websiteManagement2/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2019 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/lib/services/websiteManagement2/lib/models/analysisData.js b/lib/services/websiteManagement2/lib/models/analysisData.js index f23e81d09b..dd87f0e324 100644 --- a/lib/services/websiteManagement2/lib/models/analysisData.js +++ b/lib/services/websiteManagement2/lib/models/analysisData.js @@ -30,8 +30,8 @@ class AnalysisData { * @member {array} [data] Additional Source Data * @member {object} [detectorMetaData] Detector Meta Data * @member {object} [detectorMetaData.dataSource] Source of the Data - * @member {array} [detectorMetaData.dataSource.instructions] Instrunctions - * if any for the data source + * @member {array} [detectorMetaData.dataSource.instructions] Instructions if + * any for the data source * @member {array} [detectorMetaData.dataSource.dataSourceUri] Datasource Uri * Links */ diff --git a/lib/services/websiteManagement2/lib/models/appServiceCertificateCollection.js b/lib/services/websiteManagement2/lib/models/appServiceCertificateCollection.js index 5ca5f99e91..d076423bea 100644 --- a/lib/services/websiteManagement2/lib/models/appServiceCertificateCollection.js +++ b/lib/services/websiteManagement2/lib/models/appServiceCertificateCollection.js @@ -11,7 +11,7 @@ 'use strict'; /** - * Collection of certitificateorder certificates. + * Collection of certificate order certificates. */ class AppServiceCertificateCollection extends Array { /** diff --git a/lib/services/websiteManagement2/lib/models/appServiceCertificateOrderCollection.js b/lib/services/websiteManagement2/lib/models/appServiceCertificateOrderCollection.js index 6f45eabab2..7672bcbaaa 100644 --- a/lib/services/websiteManagement2/lib/models/appServiceCertificateOrderCollection.js +++ b/lib/services/websiteManagement2/lib/models/appServiceCertificateOrderCollection.js @@ -11,7 +11,7 @@ 'use strict'; /** - * Collection of certitificate orders. + * Collection of certificate orders. */ class AppServiceCertificateOrderCollection extends Array { /** diff --git a/lib/services/websiteManagement2/lib/models/appServiceEnvironmentPatchResource.js b/lib/services/websiteManagement2/lib/models/appServiceEnvironmentPatchResource.js index ab454a36fc..807e21c380 100644 --- a/lib/services/websiteManagement2/lib/models/appServiceEnvironmentPatchResource.js +++ b/lib/services/websiteManagement2/lib/models/appServiceEnvironmentPatchResource.js @@ -13,7 +13,7 @@ const models = require('./index'); /** - * ARM resource for a app service enviroment. + * ARM resource for a app service environment. * * @extends models['ProxyOnlyResource'] */ diff --git a/lib/services/websiteManagement2/lib/models/appServicePlan.js b/lib/services/websiteManagement2/lib/models/appServicePlan.js index 52f4a0c0fb..782a08b14e 100644 --- a/lib/services/websiteManagement2/lib/models/appServicePlan.js +++ b/lib/services/websiteManagement2/lib/models/appServicePlan.js @@ -25,7 +25,6 @@ class AppServicePlan extends models['Resource'] { * @member {string} [status] App Service plan status. Possible values * include: 'Ready', 'Pending', 'Creating' * @member {string} [subscription] App Service plan subscription. - * @member {string} [adminSiteName] App Service plan administration site. * @member {object} [hostingEnvironmentProfile] Specification for the App * Service Environment to use for the App Service plan. * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App @@ -180,13 +179,6 @@ class AppServicePlan extends models['Resource'] { name: 'String' } }, - adminSiteName: { - required: false, - serializedName: 'properties.adminSiteName', - type: { - name: 'String' - } - }, hostingEnvironmentProfile: { required: false, serializedName: 'properties.hostingEnvironmentProfile', diff --git a/lib/services/websiteManagement2/lib/models/appServicePlanPatchResource.js b/lib/services/websiteManagement2/lib/models/appServicePlanPatchResource.js index d16dc241df..70d140e5d3 100644 --- a/lib/services/websiteManagement2/lib/models/appServicePlanPatchResource.js +++ b/lib/services/websiteManagement2/lib/models/appServicePlanPatchResource.js @@ -25,7 +25,6 @@ class AppServicePlanPatchResource extends models['ProxyOnlyResource'] { * @member {string} [status] App Service plan status. Possible values * include: 'Ready', 'Pending', 'Creating' * @member {string} [subscription] App Service plan subscription. - * @member {string} [adminSiteName] App Service plan administration site. * @member {object} [hostingEnvironmentProfile] Specification for the App * Service Environment to use for the App Service plan. * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App @@ -139,13 +138,6 @@ class AppServicePlanPatchResource extends models['ProxyOnlyResource'] { name: 'String' } }, - adminSiteName: { - required: false, - serializedName: 'properties.adminSiteName', - type: { - name: 'String' - } - }, hostingEnvironmentProfile: { required: false, serializedName: 'properties.hostingEnvironmentProfile', diff --git a/lib/services/websiteManagement2/lib/models/certificate.js b/lib/services/websiteManagement2/lib/models/certificate.js index f7b9f4da55..61f8327fc2 100644 --- a/lib/services/websiteManagement2/lib/models/certificate.js +++ b/lib/services/websiteManagement2/lib/models/certificate.js @@ -28,7 +28,7 @@ class Certificate extends models['Resource'] { * @member {string} [selfLink] Self link. * @member {string} [issuer] Certificate issuer. * @member {date} [issueDate] Certificate issue Date. - * @member {date} [expirationDate] Certificate expriration date. + * @member {date} [expirationDate] Certificate expiration date. * @member {string} password Certificate password. * @member {string} [thumbprint] Certificate thumbprint. * @member {boolean} [valid] Is the certificate valid?. diff --git a/lib/services/websiteManagement2/lib/models/certificatePatchResource.js b/lib/services/websiteManagement2/lib/models/certificatePatchResource.js index 708ccf5cf0..08c82a0ac6 100644 --- a/lib/services/websiteManagement2/lib/models/certificatePatchResource.js +++ b/lib/services/websiteManagement2/lib/models/certificatePatchResource.js @@ -28,7 +28,7 @@ class CertificatePatchResource extends models['ProxyOnlyResource'] { * @member {string} [selfLink] Self link. * @member {string} [issuer] Certificate issuer. * @member {date} [issueDate] Certificate issue Date. - * @member {date} [expirationDate] Certificate expriration date. + * @member {date} [expirationDate] Certificate expiration date. * @member {string} password Certificate password. * @member {string} [thumbprint] Certificate thumbprint. * @member {boolean} [valid] Is the certificate valid?. diff --git a/lib/services/websiteManagement2/lib/models/corsSettings.js b/lib/services/websiteManagement2/lib/models/corsSettings.js index 888cff3aac..a0c38b7b09 100644 --- a/lib/services/websiteManagement2/lib/models/corsSettings.js +++ b/lib/services/websiteManagement2/lib/models/corsSettings.js @@ -20,6 +20,10 @@ class CorsSettings { * @member {array} [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. + * @member {boolean} [supportCredentials] Gets or sets whether CORS requests + * with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. */ constructor() { } @@ -51,6 +55,13 @@ class CorsSettings { } } } + }, + supportCredentials: { + required: false, + serializedName: 'supportCredentials', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/csmUsageQuota.js b/lib/services/websiteManagement2/lib/models/csmUsageQuota.js index 6a7322c0d3..577b280a5a 100644 --- a/lib/services/websiteManagement2/lib/models/csmUsageQuota.js +++ b/lib/services/websiteManagement2/lib/models/csmUsageQuota.js @@ -17,7 +17,7 @@ class CsmUsageQuota { /** * Create a CsmUsageQuota. - * @member {string} [unit] Units of measurement for the quota resourse. + * @member {string} [unit] Units of measurement for the quota resource. * @member {date} [nextResetTime] Next reset time for the resource counter. * @member {number} [currentValue] The current value of the resource counter. * @member {number} [limit] The resource limit. diff --git a/lib/services/websiteManagement2/lib/models/customHostnameAnalysisResult.js b/lib/services/websiteManagement2/lib/models/customHostnameAnalysisResult.js index e141ca367e..166bd366b6 100644 --- a/lib/services/websiteManagement2/lib/models/customHostnameAnalysisResult.js +++ b/lib/services/websiteManagement2/lib/models/customHostnameAnalysisResult.js @@ -41,7 +41,7 @@ class CustomHostnameAnalysisResult extends models['ProxyOnlyResource'] { * @member {boolean} [hasConflictOnScaleUnit] true if there is a * conflict on a scale unit; otherwise, false. * @member {boolean} [hasConflictAcrossSubscription] true if - * htere is a conflict across subscriptions; otherwise, false. + * there is a conflict across subscriptions; otherwise, false. * @member {string} [conflictingAppResourceId] Name of the conflicting app on * scale unit if it's within the same subscription. * @member {array} [cNameRecords] CName records controller can see for this diff --git a/lib/services/websiteManagement2/lib/models/dataSource.js b/lib/services/websiteManagement2/lib/models/dataSource.js index 480579c108..c833aaf2f7 100644 --- a/lib/services/websiteManagement2/lib/models/dataSource.js +++ b/lib/services/websiteManagement2/lib/models/dataSource.js @@ -17,7 +17,7 @@ class DataSource { /** * Create a DataSource. - * @member {array} [instructions] Instrunctions if any for the data source + * @member {array} [instructions] Instructions if any for the data source * @member {array} [dataSourceUri] Datasource Uri Links */ constructor() { diff --git a/lib/services/websiteManagement2/lib/models/deletedAppRestoreRequest.js b/lib/services/websiteManagement2/lib/models/deletedAppRestoreRequest.js index 715d8d3e51..4d5d895f02 100644 --- a/lib/services/websiteManagement2/lib/models/deletedAppRestoreRequest.js +++ b/lib/services/websiteManagement2/lib/models/deletedAppRestoreRequest.js @@ -28,6 +28,8 @@ class DeletedAppRestoreRequest extends models['ProxyOnlyResource'] { * @member {string} [snapshotTime] Point in time to restore the deleted app * from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. + * @member {boolean} [useDRSecondary] If true, the snapshot is retrieved from + * DRSecondary endpoint. */ constructor() { super(); @@ -98,6 +100,13 @@ class DeletedAppRestoreRequest extends models['ProxyOnlyResource'] { type: { name: 'String' } + }, + useDRSecondary: { + required: false, + serializedName: 'properties.useDRSecondary', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/deletedSite.js b/lib/services/websiteManagement2/lib/models/deletedSite.js index 3015110612..b313ad0c41 100644 --- a/lib/services/websiteManagement2/lib/models/deletedSite.js +++ b/lib/services/websiteManagement2/lib/models/deletedSite.js @@ -28,6 +28,7 @@ class DeletedSite extends models['ProxyOnlyResource'] { * @member {string} [deletedSiteName] Name of the deleted site * @member {string} [slot] Slot of the deleted site * @member {string} [deletedSiteKind] Kind of site that was deleted + * @member {string} [geoRegionName] Geo Region of the deleted site */ constructor() { super(); @@ -133,6 +134,14 @@ class DeletedSite extends models['ProxyOnlyResource'] { type: { name: 'String' } + }, + geoRegionName: { + required: false, + readOnly: true, + serializedName: 'properties.geoRegionName', + type: { + name: 'String' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/deployment.js b/lib/services/websiteManagement2/lib/models/deployment.js index f8fdc08349..675693e999 100644 --- a/lib/services/websiteManagement2/lib/models/deployment.js +++ b/lib/services/websiteManagement2/lib/models/deployment.js @@ -13,7 +13,7 @@ const models = require('./index'); /** - * User crendentials used for publishing activity. + * User credentials used for publishing activity. * * @extends models['ProxyOnlyResource'] */ diff --git a/lib/services/websiteManagement2/lib/models/detectorAbnormalTimePeriod.js b/lib/services/websiteManagement2/lib/models/detectorAbnormalTimePeriod.js index 2080fbf6f4..3d20c387cb 100644 --- a/lib/services/websiteManagement2/lib/models/detectorAbnormalTimePeriod.js +++ b/lib/services/websiteManagement2/lib/models/detectorAbnormalTimePeriod.js @@ -17,8 +17,8 @@ class DetectorAbnormalTimePeriod { /** * Create a DetectorAbnormalTimePeriod. - * @member {date} [startTime] Start time of the corelated event - * @member {date} [endTime] End time of the corelated event + * @member {date} [startTime] Start time of the correlated event + * @member {date} [endTime] End time of the correlated event * @member {string} [message] Message describing the event * @member {string} [source] Represents the name of the Detector * @member {number} [priority] Represents the rank of the Detector diff --git a/lib/services/websiteManagement2/lib/models/diagnosticDetectorResponse.js b/lib/services/websiteManagement2/lib/models/diagnosticDetectorResponse.js index 880a1116cf..6b47332876 100644 --- a/lib/services/websiteManagement2/lib/models/diagnosticDetectorResponse.js +++ b/lib/services/websiteManagement2/lib/models/diagnosticDetectorResponse.js @@ -13,7 +13,7 @@ const models = require('./index'); /** - * Class representing Reponse from Diagnostic Detectors + * Class representing Response from Diagnostic Detectors * * @extends models['ProxyOnlyResource'] */ @@ -37,8 +37,8 @@ class DiagnosticDetectorResponse extends models['ProxyOnlyResource'] { * @member {array} [data] Additional Data that detector wants to send. * @member {object} [responseMetaData] Meta Data * @member {object} [responseMetaData.dataSource] Source of the Data - * @member {array} [responseMetaData.dataSource.instructions] Instrunctions - * if any for the data source + * @member {array} [responseMetaData.dataSource.instructions] Instructions if + * any for the data source * @member {array} [responseMetaData.dataSource.dataSourceUri] Datasource Uri * Links */ diff --git a/lib/services/websiteManagement2/lib/models/domainAvailablilityCheckResult.js b/lib/services/websiteManagement2/lib/models/domainAvailablilityCheckResult.js index 545642c394..34cfb9a786 100644 --- a/lib/services/websiteManagement2/lib/models/domainAvailablilityCheckResult.js +++ b/lib/services/websiteManagement2/lib/models/domainAvailablilityCheckResult.js @@ -11,7 +11,7 @@ 'use strict'; /** - * Domain availablility check result. + * Domain availability check result. * */ class DomainAvailablilityCheckResult { diff --git a/lib/services/websiteManagement2/lib/models/geoDistribution.js b/lib/services/websiteManagement2/lib/models/geoDistribution.js new file mode 100644 index 0000000000..6653f54887 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/geoDistribution.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A global distribution definition. + * + */ +class GeoDistribution { + /** + * Create a GeoDistribution. + * @member {string} [location] Location. + * @member {number} [numberOfWorkers] NumberOfWorkers. + */ + constructor() { + } + + /** + * Defines the metadata of GeoDistribution + * + * @returns {object} metadata of GeoDistribution + * + */ + mapper() { + return { + required: false, + serializedName: 'GeoDistribution', + type: { + name: 'Composite', + className: 'GeoDistribution', + modelProperties: { + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + numberOfWorkers: { + required: false, + serializedName: 'numberOfWorkers', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = GeoDistribution; diff --git a/lib/services/websiteManagement2/lib/models/index.d.ts b/lib/services/websiteManagement2/lib/models/index.d.ts index 0e4d9b0de5..8f17ecc6d9 100644 --- a/lib/services/websiteManagement2/lib/models/index.d.ts +++ b/lib/services/websiteManagement2/lib/models/index.d.ts @@ -466,6 +466,8 @@ export interface VnetRoute extends ProxyOnlyResource { * required; otherwise, false. * @member {string} [dnsServers] DNS servers to be used by this Virtual * Network. This should be a comma-separated list of IP addresses. + * @member {boolean} [isSwift] Flag that is used to denote if this is VNET + * injection */ export interface VnetInfo extends ProxyOnlyResource { vnetResourceId?: string; @@ -474,6 +476,7 @@ export interface VnetInfo extends ProxyOnlyResource { readonly routes?: VnetRoute[]; readonly resyncRequired?: boolean; dnsServers?: string; + isSwift?: boolean; } /** @@ -496,7 +499,7 @@ export interface VnetGateway extends ProxyOnlyResource { * @class * Initializes a new instance of the User class. * @constructor - * User crendentials used for publishing activity. + * User credentials used for publishing activity. * * @member {string} publishingUserName Username used for publishing. * @member {string} [publishingPassword] Password used for publishing. @@ -659,6 +662,7 @@ export interface HybridConnection extends ProxyOnlyResource { * @member {string} [deletedSiteName] Name of the deleted site * @member {string} [slot] Slot of the deleted site * @member {string} [deletedSiteKind] Kind of site that was deleted + * @member {string} [geoRegionName] Geo Region of the deleted site */ export interface DeletedSite extends ProxyOnlyResource { readonly deletedSiteId?: number; @@ -668,6 +672,7 @@ export interface DeletedSite extends ProxyOnlyResource { readonly deletedSiteName?: string; readonly slot?: string; readonly deletedSiteKind?: string; + readonly geoRegionName?: string; } /** @@ -690,11 +695,25 @@ export interface ManagedServiceIdentity { identityIds?: string[]; } +/** + * @class + * Initializes a new instance of the GeoDistribution class. + * @constructor + * A global distribution definition. + * + * @member {string} [location] Location. + * @member {number} [numberOfWorkers] NumberOfWorkers. + */ +export interface GeoDistribution { + location?: string; + numberOfWorkers?: number; +} + /** * @class * Initializes a new instance of the SlotSwapStatus class. * @constructor - * The status of the last successfull slot swap operation. + * The status of the last successful slot swap operation. * * @member {date} [timestampUtc] The time the last successful slot swap * completed. @@ -780,12 +799,16 @@ export interface HostingEnvironmentProfile { * @constructor * IP security restriction on an app. * - * @member {string} ipAddress IP address the security restriction is valid for. + * @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} [vnetSubnetResourceId] Virtual network resource id + * @member {number} [vnetTrafficTag] (internal) Vnet traffic tag + * @member {number} [subnetTrafficTag] (internal) Subnet traffic tag * @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', @@ -795,8 +818,11 @@ export interface HostingEnvironmentProfile { * @member {string} [description] IP restriction rule description. */ export interface IpSecurityRestriction { - ipAddress: string; + ipAddress?: string; subnetMask?: string; + vnetSubnetResourceId?: string; + vnetTrafficTag?: number; + subnetTrafficTag?: number; action?: string; tag?: string; priority?: number; @@ -825,9 +851,14 @@ export interface ApiDefinitionInfo { * @member {array} [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. + * @member {boolean} [supportCredentials] Gets or sets whether CORS requests + * with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. */ export interface CorsSettings { allowedOrigins?: string[]; + supportCredentials?: boolean; } /** @@ -1001,13 +1032,13 @@ export interface SiteLimits { * @member {number} [reroutePercentage] Percentage of the traffic which will be * redirected to ActionHostName. * @member {number} [changeStep] In auto ramp up scenario this is the step to - * to add/remove from ReroutePercentage until it reaches + * add/remove from ReroutePercentage until it reaches * MinReroutePercentage or MaxReroutePercentage. Site - * metrics are checked every N minutes specificed in + * metrics are checked every N minutes specified in * ChangeIntervalInMinutes. * Custom decision algorithm can be provided in TiPCallback site extension * which URL can be specified in ChangeDecisionCallbackUrl. - * @member {number} [changeIntervalInMinutes] Specifies interval in mimuntes to + * @member {number} [changeIntervalInMinutes] Specifies interval in minutes to * reevaluate ReroutePercentage. * @member {number} [minReroutePercentage] Specifies lower boundary above which * ReroutePercentage will stay. @@ -1234,7 +1265,7 @@ export interface NameValuePair { * @member {string} [loadBalancing] Site load balancing. Possible values * include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' - * @member {object} [experiments] This is work around for polymophic types. + * @member {object} [experiments] This is work around for polymorphic types. * @member {array} [experiments.rampUpRules] List of ramp-up rules. * @member {object} [limits] Site limits. * @member {number} [limits.maxPercentageCpu] Maximum allowed CPU usage @@ -1281,6 +1312,10 @@ export interface NameValuePair { * @member {array} [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. + * @member {boolean} [cors.supportCredentials] Gets or sets whether CORS + * requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. * @member {object} [push] Push endpoint settings. * @member {boolean} [push.isPushEnabled] Gets or sets a flag indicating * whether the Push endpoint is enabled. @@ -1305,7 +1340,11 @@ export interface NameValuePair { * @member {number} [managedServiceIdentityId] Managed Service Identity Id * @member {number} [xManagedServiceIdentityId] Explicit Managed Service * Identity Id - * @member {array} [ipSecurityRestrictions] IP security restrictions. + * @member {array} [ipSecurityRestrictions] IP security restrictions for main. + * @member {array} [scmIpSecurityRestrictions] IP security restrictions for + * scm. + * @member {boolean} [scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * @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 @@ -1364,6 +1403,8 @@ export interface SiteConfig { managedServiceIdentityId?: number; xManagedServiceIdentityId?: number; ipSecurityRestrictions?: IpSecurityRestriction[]; + scmIpSecurityRestrictions?: IpSecurityRestriction[]; + scmIpSecurityRestrictionsUseMain?: boolean; http20Enabled?: boolean; minTlsVersion?: string; ftpsState?: string; @@ -1485,8 +1526,8 @@ export interface HostNameSslState { * @member {string} [siteConfig.loadBalancing] Site load balancing. Possible * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' - * @member {object} [siteConfig.experiments] This is work around for polymophic - * types. + * @member {object} [siteConfig.experiments] This is work around for + * polymorphic types. * @member {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. * @member {object} [siteConfig.limits] Site limits. * @member {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU @@ -1539,6 +1580,10 @@ export interface HostNameSslState { * @member {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. + * @member {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. * @member {object} [siteConfig.push] Push endpoint settings. * @member {boolean} [siteConfig.push.isPushEnabled] Gets or sets a flag * indicating whether the Push endpoint is enabled. @@ -1565,8 +1610,12 @@ export interface HostNameSslState { * Identity Id * @member {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed * Service Identity Id - * @member {array} [siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * @member {array} [siteConfig.ipSecurityRestrictions] IP security restrictions + * for main. + * @member {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * @member {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * @member {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web * site to allow clients to connect over http2.0 * @member {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the @@ -1599,6 +1648,8 @@ export interface HostNameSslState { * @member {boolean} [clientCertEnabled] true to enable client * certificate authentication (TLS mutual authentication); otherwise, * false. Default is false. + * @member {string} [clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths * @member {boolean} [hostNamesDisabled] true to disable the * public hostnames of the app; otherwise, false. * If true, the app is only accessible via API management process. @@ -1663,6 +1714,11 @@ export interface HostNameSslState { * @member {boolean} [httpsOnly] HttpsOnly: configures a web site to accept * only https requests. Issues redirect for * http requests + * @member {string} [redundancyMode] Site redundancy mode. Possible values + * include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * @member {uuid} [inProgressOperationId] Specifies an operation id if this + * site has a pending operation. + * @member {array} [geoDistributions] GeoDistributions for this site * @member {object} [identity] * @member {string} [identity.type] Type of managed service identity. Possible * values include: 'SystemAssigned', 'UserAssigned' @@ -1693,6 +1749,7 @@ export interface Site extends Resource { hostingEnvironmentProfile?: HostingEnvironmentProfile; clientAffinityEnabled?: boolean; clientCertEnabled?: boolean; + clientCertExclusionPaths?: string; hostNamesDisabled?: boolean; readonly outboundIpAddresses?: string; readonly possibleOutboundIpAddresses?: string; @@ -1706,6 +1763,9 @@ export interface Site extends Resource { readonly defaultHostName?: string; readonly slotSwapStatus?: SlotSwapStatus; httpsOnly?: boolean; + redundancyMode?: string; + readonly inProgressOperationId?: string; + geoDistributions?: GeoDistribution[]; identity?: ManagedServiceIdentity; } @@ -1795,7 +1855,6 @@ export interface SkuDescription { * @member {string} [status] App Service plan status. Possible values include: * 'Ready', 'Pending', 'Creating' * @member {string} [subscription] App Service plan subscription. - * @member {string} [adminSiteName] App Service plan administration site. * @member {object} [hostingEnvironmentProfile] Specification for the App * Service Environment to use for the App Service plan. * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App @@ -1858,7 +1917,6 @@ export interface AppServicePlan extends Resource { workerTierName?: string; readonly status?: string; readonly subscription?: string; - adminSiteName?: string; hostingEnvironmentProfile?: HostingEnvironmentProfile; readonly maximumNumberOfWorkers?: number; readonly geoRegion?: string; @@ -2385,7 +2443,7 @@ export interface Domain extends Resource { * @class * Initializes a new instance of the DomainAvailablilityCheckResult class. * @constructor - * Domain availablility check result. + * Domain availability check result. * * @member {string} [name] Name of the domain. * @member {boolean} [available] true if domain can be purchased @@ -2667,7 +2725,7 @@ export interface TopLevelDomainAgreementOption { * @member {string} [selfLink] Self link. * @member {string} [issuer] Certificate issuer. * @member {date} [issueDate] Certificate issue Date. - * @member {date} [expirationDate] Certificate expriration date. + * @member {date} [expirationDate] Certificate expiration date. * @member {string} password Certificate password. * @member {string} [thumbprint] Certificate thumbprint. * @member {boolean} [valid] Is the certificate valid?. @@ -2729,7 +2787,7 @@ export interface Certificate extends Resource { * @member {string} [selfLink] Self link. * @member {string} [issuer] Certificate issuer. * @member {date} [issueDate] Certificate issue Date. - * @member {date} [expirationDate] Certificate expriration date. + * @member {date} [expirationDate] Certificate expiration date. * @member {string} password Certificate password. * @member {string} [thumbprint] Certificate thumbprint. * @member {boolean} [valid] Is the certificate valid?. @@ -3049,7 +3107,7 @@ export interface LocalizableString { * @constructor * Usage of the quota resource. * - * @member {string} [unit] Units of measurement for the quota resourse. + * @member {string} [unit] Units of measurement for the quota resource. * @member {date} [nextResetTime] Next reset time for the resource counter. * @member {number} [currentValue] The current value of the resource counter. * @member {number} [limit] The resource limit. @@ -3228,8 +3286,8 @@ export interface Solution { * @constructor * Class representing Abnormal Time Period detected. * - * @member {date} [startTime] Start time of the corelated event - * @member {date} [endTime] End time of the corelated event + * @member {date} [startTime] Start time of the correlated event + * @member {date} [endTime] End time of the correlated event * @member {string} [message] Message describing the event * @member {string} [source] Represents the name of the Detector * @member {number} [priority] Represents the rank of the Detector @@ -3351,7 +3409,7 @@ export interface DiagnosticMetricSet { * @constructor * Class representing data source used by the detectors * - * @member {array} [instructions] Instrunctions if any for the data source + * @member {array} [instructions] Instructions if any for the data source * @member {array} [dataSourceUri] Datasource Uri Links */ export interface DataSource { @@ -3364,7 +3422,7 @@ export interface DataSource { * Initializes a new instance of the ResponseMetaData class. * @constructor * @member {object} [dataSource] Source of the Data - * @member {array} [dataSource.instructions] Instrunctions if any for the data + * @member {array} [dataSource.instructions] Instructions if any for the data * source * @member {array} [dataSource.dataSourceUri] Datasource Uri Links */ @@ -3391,7 +3449,7 @@ export interface ResponseMetaData { * @member {array} [data] Additional Source Data * @member {object} [detectorMetaData] Detector Meta Data * @member {object} [detectorMetaData.dataSource] Source of the Data - * @member {array} [detectorMetaData.dataSource.instructions] Instrunctions if + * @member {array} [detectorMetaData.dataSource.instructions] Instructions if * any for the data source * @member {array} [detectorMetaData.dataSource.dataSourceUri] Datasource Uri * Links @@ -3564,7 +3622,7 @@ export interface DiagnosticCategory extends ProxyOnlyResource { * @class * Initializes a new instance of the DiagnosticDetectorResponse class. * @constructor - * Class representing Reponse from Diagnostic Detectors + * Class representing Response from Diagnostic Detectors * * @member {date} [startTime] Start time of the period * @member {date} [endTime] End time of the period @@ -3583,7 +3641,7 @@ export interface DiagnosticCategory extends ProxyOnlyResource { * @member {array} [data] Additional Data that detector wants to send. * @member {object} [responseMetaData] Meta Data * @member {object} [responseMetaData.dataSource] Source of the Data - * @member {array} [responseMetaData.dataSource.instructions] Instrunctions if + * @member {array} [responseMetaData.dataSource.instructions] Instructions if * any for the data source * @member {array} [responseMetaData.dataSource.dataSourceUri] Datasource Uri * Links @@ -3611,11 +3669,14 @@ export interface DiagnosticDetectorResponse extends ProxyOnlyResource { * only). * @member {boolean} [isDefault] true if this is the default minor * version; otherwise, false. + * @member {boolean} [isRemoteDebuggingEnabled] true if this + * supports Remote Debugging, otherwise false. */ export interface StackMinorVersion { displayVersion?: string; runtimeVersion?: string; isDefault?: boolean; + isRemoteDebuggingEnabled?: boolean; } /** @@ -3632,12 +3693,15 @@ export interface StackMinorVersion { * version; otherwise, false. * @member {array} [minorVersions] Minor versions associated with the major * version. + * @member {boolean} [applicationInsights] true if this supports + * Application Insights; otherwise, false. */ export interface StackMajorVersion { displayVersion?: string; runtimeVersion?: string; isDefault?: boolean; minorVersions?: StackMinorVersion[]; + applicationInsights?: boolean; } /** @@ -3691,7 +3755,7 @@ export interface ApplicationStack { * @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". + * null then it should 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 @@ -3940,7 +4004,7 @@ export interface PremierAddOnOffer extends ProxyOnlyResource { * @class * Initializes a new instance of the ResourceNameAvailability class. * @constructor - * Information regarding availbility of a resource name. + * Information regarding availability of a resource name. * * @member {boolean} [nameAvailable] true indicates name is valid * and available. false indicates the name is invalid, @@ -4012,6 +4076,28 @@ export interface SourceControl extends ProxyOnlyResource { expirationTime?: Date; } +/** + * @class + * Initializes a new instance of the ValidateContainerSettingsRequest class. + * @constructor + * Container settings validation request context + * + * @member {string} [baseUrl] Base URL of the container registry + * @member {string} [username] Username for to access the container registry + * @member {string} [password] Password for to access the container registry + * @member {string} [repository] Repository name (image name) + * @member {string} [tag] Image tag + * @member {string} [platform] Platform (windows or linux) + */ +export interface ValidateContainerSettingsRequest { + baseUrl?: string; + username?: string; + password?: string; + repository?: string; + tag?: string; + platform?: string; +} + /** * @class * Initializes a new instance of the ValidateRequest class. @@ -4030,7 +4116,7 @@ export interface SourceControl extends ProxyOnlyResource { * @member {boolean} [isSpot] true if App Service plan is for Spot * instances; otherwise, false. * @member {number} [capacity] Target capacity of the App Service plan (number - * of VM's). + * of VMs). * @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 @@ -4498,7 +4584,7 @@ export interface CsmSlotEntity { * of the error. * @member {boolean} [hasConflictOnScaleUnit] true if there is a * conflict on a scale unit; otherwise, false. - * @member {boolean} [hasConflictAcrossSubscription] true if htere + * @member {boolean} [hasConflictAcrossSubscription] true if there * is a conflict across subscriptions; otherwise, false. * @member {string} [conflictingAppResourceId] Name of the conflicting app on * scale unit if it's within the same subscription. @@ -4540,18 +4626,21 @@ export interface CustomHostnameAnalysisResult extends ProxyOnlyResource { * @member {string} [snapshotTime] Point in time to restore the deleted app * from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. + * @member {boolean} [useDRSecondary] If true, the snapshot is retrieved from + * DRSecondary endpoint. */ export interface DeletedAppRestoreRequest extends ProxyOnlyResource { deletedSiteId?: string; recoverConfiguration?: boolean; snapshotTime?: string; + useDRSecondary?: boolean; } /** * @class * Initializes a new instance of the Deployment class. * @constructor - * User crendentials used for publishing activity. + * User credentials used for publishing activity. * * @member {number} [status] Deployment status. * @member {string} [message] Details about deployment status. @@ -4886,6 +4975,8 @@ export interface RelayServiceConnectionEntity extends ProxyOnlyResource { * @member {string} [virtualNetworkConnection.dnsServers] DNS servers to be * used by this Virtual Network. This should be a comma-separated list of IP * addresses. + * @member {boolean} [virtualNetworkConnection.isSwift] Flag that is used to + * denote if this is VNET injection * @member {array} [hybridConnections] The Hybrid Connections summary view. * @member {array} [hybridConnectionsV2] The Hybrid Connection V2 (Service Bus) * view. @@ -5083,7 +5174,7 @@ export interface PrivateAccess extends ProxyOnlyResource { * @member {date} [startTime] Start time. * @member {string} [totalProcessorTime] Total processor time. * @member {string} [userProcessorTime] User processor time. - * @member {string} [priviledgedProcessorTime] Priviledged processor time. + * @member {string} [priviledgedProcessorTime] Privileged processor time. * @member {string} [state] Thread state. * @member {string} [waitReason] Wait reason. */ @@ -5334,6 +5425,10 @@ export interface RestoreRequest extends ProxyOnlyResource { * authenticate end users. * More information on OpenID Connect: * http://openid.net/specs/openid-connect-core-1_0.html + * @member {string} [clientSecretCertificateThumbprint] An alternative to the + * client secret, that is the thumbprint of a certificate used for signing + * purposes. This property acts as + * a replacement for the Client Secret. It is also optional. * @member {string} [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 @@ -5417,6 +5512,7 @@ export interface SiteAuthSettings extends ProxyOnlyResource { tokenRefreshExtensionHours?: number; clientId?: string; clientSecret?: string; + clientSecretCertificateThumbprint?: string; issuer?: string; validateIssuer?: boolean; allowedAudiences?: string[]; @@ -5530,7 +5626,7 @@ export interface SiteCloneability { * @member {string} [loadBalancing] Site load balancing. Possible values * include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' - * @member {object} [experiments] This is work around for polymophic types. + * @member {object} [experiments] This is work around for polymorphic types. * @member {array} [experiments.rampUpRules] List of ramp-up rules. * @member {object} [limits] Site limits. * @member {number} [limits.maxPercentageCpu] Maximum allowed CPU usage @@ -5577,6 +5673,10 @@ export interface SiteCloneability { * @member {array} [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. + * @member {boolean} [cors.supportCredentials] Gets or sets whether CORS + * requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. * @member {object} [push] Push endpoint settings. * @member {boolean} [push.isPushEnabled] Gets or sets a flag indicating * whether the Push endpoint is enabled. @@ -5601,7 +5701,11 @@ export interface SiteCloneability { * @member {number} [managedServiceIdentityId] Managed Service Identity Id * @member {number} [xManagedServiceIdentityId] Explicit Managed Service * Identity Id - * @member {array} [ipSecurityRestrictions] IP security restrictions. + * @member {array} [ipSecurityRestrictions] IP security restrictions for main. + * @member {array} [scmIpSecurityRestrictions] IP security restrictions for + * scm. + * @member {boolean} [scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * @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 @@ -5660,6 +5764,8 @@ export interface SiteConfigResource extends ProxyOnlyResource { managedServiceIdentityId?: number; xManagedServiceIdentityId?: number; ipSecurityRestrictions?: IpSecurityRestriction[]; + scmIpSecurityRestrictions?: IpSecurityRestriction[]; + scmIpSecurityRestrictionsUseMain?: boolean; http20Enabled?: boolean; minTlsVersion?: string; ftpsState?: string; @@ -5899,8 +6005,8 @@ export interface SiteLogsConfig extends ProxyOnlyResource { * @member {string} [siteConfig.loadBalancing] Site load balancing. Possible * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' - * @member {object} [siteConfig.experiments] This is work around for polymophic - * types. + * @member {object} [siteConfig.experiments] This is work around for + * polymorphic types. * @member {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. * @member {object} [siteConfig.limits] Site limits. * @member {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU @@ -5953,6 +6059,10 @@ export interface SiteLogsConfig extends ProxyOnlyResource { * @member {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. + * @member {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. * @member {object} [siteConfig.push] Push endpoint settings. * @member {boolean} [siteConfig.push.isPushEnabled] Gets or sets a flag * indicating whether the Push endpoint is enabled. @@ -5979,8 +6089,12 @@ export interface SiteLogsConfig extends ProxyOnlyResource { * Identity Id * @member {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed * Service Identity Id - * @member {array} [siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * @member {array} [siteConfig.ipSecurityRestrictions] IP security restrictions + * for main. + * @member {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * @member {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * @member {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web * site to allow clients to connect over http2.0 * @member {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the @@ -6013,6 +6127,8 @@ export interface SiteLogsConfig extends ProxyOnlyResource { * @member {boolean} [clientCertEnabled] true to enable client * certificate authentication (TLS mutual authentication); otherwise, * false. Default is false. + * @member {string} [clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths * @member {boolean} [hostNamesDisabled] true to disable the * public hostnames of the app; otherwise, false. * If true, the app is only accessible via API management process. @@ -6077,6 +6193,11 @@ export interface SiteLogsConfig extends ProxyOnlyResource { * @member {boolean} [httpsOnly] HttpsOnly: configures a web site to accept * only https requests. Issues redirect for * http requests + * @member {string} [redundancyMode] Site redundancy mode. Possible values + * include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * @member {uuid} [inProgressOperationId] Specifies an operation id if this + * site has a pending operation. + * @member {array} [geoDistributions] GeoDistributions for this site */ export interface SitePatchResource extends ProxyOnlyResource { readonly state?: string; @@ -6099,6 +6220,7 @@ export interface SitePatchResource extends ProxyOnlyResource { hostingEnvironmentProfile?: HostingEnvironmentProfile; clientAffinityEnabled?: boolean; clientCertEnabled?: boolean; + clientCertExclusionPaths?: string; hostNamesDisabled?: boolean; readonly outboundIpAddresses?: string; readonly possibleOutboundIpAddresses?: string; @@ -6112,6 +6234,9 @@ export interface SitePatchResource extends ProxyOnlyResource { readonly defaultHostName?: string; readonly slotSwapStatus?: SlotSwapStatus; httpsOnly?: boolean; + redundancyMode?: string; + readonly inProgressOperationId?: string; + geoDistributions?: GeoDistribution[]; } /** @@ -6247,6 +6372,8 @@ export interface SnapshotRecoverySource { * @member {boolean} [ignoreConflictingHostNames] If true, custom hostname * conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. + * @member {boolean} [useDRSecondary] If true, the snapshot is retrieved from + * DRSecondary endpoint. */ export interface SnapshotRestoreRequest extends ProxyOnlyResource { snapshotTime?: string; @@ -6254,6 +6381,7 @@ export interface SnapshotRestoreRequest extends ProxyOnlyResource { overwrite: boolean; recoverConfiguration?: boolean; ignoreConflictingHostNames?: boolean; + useDRSecondary?: boolean; } /** @@ -6592,7 +6720,7 @@ export interface AppServiceEnvironmentResource extends Resource { * @class * Initializes a new instance of the AppServiceEnvironmentPatchResource class. * @constructor - * ARM resource for a app service enviroment. + * ARM resource for a app service environment. * * @member {string} appServiceEnvironmentPatchResourceName Name of the App * Service Environment. @@ -6893,7 +7021,6 @@ export interface WorkerPoolResource extends ProxyOnlyResource { * @member {string} [status] App Service plan status. Possible values include: * 'Ready', 'Pending', 'Creating' * @member {string} [subscription] App Service plan subscription. - * @member {string} [adminSiteName] App Service plan administration site. * @member {object} [hostingEnvironmentProfile] Specification for the App * Service Environment to use for the App Service plan. * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App @@ -6936,7 +7063,6 @@ export interface AppServicePlanPatchResource extends ProxyOnlyResource { workerTierName?: string; readonly status?: string; readonly subscription?: string; - adminSiteName?: string; hostingEnvironmentProfile?: HostingEnvironmentProfile; readonly maximumNumberOfWorkers?: number; readonly geoRegion?: string; @@ -6991,7 +7117,7 @@ export interface ResourceHealthMetadata extends ProxyOnlyResource { * @class * Initializes a new instance of the AppServiceCertificateOrderCollection class. * @constructor - * Collection of certitificate orders. + * Collection of certificate orders. * * @member {string} [nextLink] Link to next page of resources. */ @@ -7003,7 +7129,7 @@ export interface AppServiceCertificateOrderCollection extends ArrayActionHostName. * @member {number} [changeStep] In auto ramp up scenario this is the step to - * to add/remove from ReroutePercentage until it reaches + * add/remove from ReroutePercentage until it reaches * MinReroutePercentage or MaxReroutePercentage. - * Site metrics are checked every N minutes specificed in + * Site metrics are checked every N minutes specified in * ChangeIntervalInMinutes. * Custom decision algorithm can be provided in TiPCallback site extension * which URL can be specified in ChangeDecisionCallbackUrl. - * @member {number} [changeIntervalInMinutes] Specifies interval in mimuntes + * @member {number} [changeIntervalInMinutes] Specifies interval in minutes * to reevaluate ReroutePercentage. * @member {number} [minReroutePercentage] Specifies lower boundary above * which ReroutePercentage will stay. diff --git a/lib/services/websiteManagement2/lib/models/recommendation.js b/lib/services/websiteManagement2/lib/models/recommendation.js index 8f61433673..def3f7975e 100644 --- a/lib/services/websiteManagement2/lib/models/recommendation.js +++ b/lib/services/websiteManagement2/lib/models/recommendation.js @@ -44,7 +44,7 @@ class Recommendation extends models['ProxyOnlyResource'] { * @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". + * it's null then it should 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 diff --git a/lib/services/websiteManagement2/lib/models/resourceNameAvailability.js b/lib/services/websiteManagement2/lib/models/resourceNameAvailability.js index a733bc7a1e..ed0303cc43 100644 --- a/lib/services/websiteManagement2/lib/models/resourceNameAvailability.js +++ b/lib/services/websiteManagement2/lib/models/resourceNameAvailability.js @@ -11,7 +11,7 @@ 'use strict'; /** - * Information regarding availbility of a resource name. + * Information regarding availability of a resource name. * */ class ResourceNameAvailability { diff --git a/lib/services/websiteManagement2/lib/models/responseMetaData.js b/lib/services/websiteManagement2/lib/models/responseMetaData.js index 9215d9bd53..285c5e8d2c 100644 --- a/lib/services/websiteManagement2/lib/models/responseMetaData.js +++ b/lib/services/websiteManagement2/lib/models/responseMetaData.js @@ -17,8 +17,8 @@ class ResponseMetaData { /** * Create a ResponseMetaData. * @member {object} [dataSource] Source of the Data - * @member {array} [dataSource.instructions] Instrunctions if any for the - * data source + * @member {array} [dataSource.instructions] Instructions if any for the data + * source * @member {array} [dataSource.dataSourceUri] Datasource Uri Links */ constructor() { diff --git a/lib/services/websiteManagement2/lib/models/site.js b/lib/services/websiteManagement2/lib/models/site.js index 10ef4cbd6d..59146076b2 100644 --- a/lib/services/websiteManagement2/lib/models/site.js +++ b/lib/services/websiteManagement2/lib/models/site.js @@ -107,7 +107,7 @@ class Site extends models['Resource'] { * values include: 'WeightedRoundRobin', 'LeastRequests', * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * @member {object} [siteConfig.experiments] This is work around for - * polymophic types. + * polymorphic types. * @member {array} [siteConfig.experiments.rampUpRules] List of ramp-up * rules. * @member {object} [siteConfig.limits] Site limits. @@ -164,6 +164,10 @@ class Site extends models['Resource'] { * @member {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. + * @member {boolean} [siteConfig.cors.supportCredentials] Gets or sets + * whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. * @member {object} [siteConfig.push] Push endpoint settings. * @member {boolean} [siteConfig.push.isPushEnabled] Gets or sets a flag * indicating whether the Push endpoint is enabled. @@ -191,7 +195,11 @@ class Site extends models['Resource'] { * @member {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed * Service Identity Id * @member {array} [siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * @member {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * @member {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP + * security restrictions for scm to use main. * @member {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a * web site to allow clients to connect over http2.0 * @member {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the @@ -224,6 +232,8 @@ class Site extends models['Resource'] { * @member {boolean} [clientCertEnabled] true to enable client * certificate authentication (TLS mutual authentication); otherwise, * false. Default is false. + * @member {string} [clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths * @member {boolean} [hostNamesDisabled] true to disable the * public hostnames of the app; otherwise, false. * If true, the app is only accessible via API management @@ -289,6 +299,11 @@ class Site extends models['Resource'] { * @member {boolean} [httpsOnly] HttpsOnly: configures a web site to accept * only https requests. Issues redirect for * http requests + * @member {string} [redundancyMode] Site redundancy mode. Possible values + * include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * @member {uuid} [inProgressOperationId] Specifies an operation id if this + * site has a pending operation. + * @member {array} [geoDistributions] GeoDistributions for this site * @member {object} [identity] * @member {string} [identity.type] Type of managed service identity. * Possible values include: 'SystemAssigned', 'UserAssigned' @@ -554,6 +569,13 @@ class Site extends models['Resource'] { name: 'Boolean' } }, + clientCertExclusionPaths: { + required: false, + serializedName: 'properties.clientCertExclusionPaths', + type: { + name: 'String' + } + }, hostNamesDisabled: { required: false, serializedName: 'properties.hostNamesDisabled', @@ -655,6 +677,37 @@ class Site extends models['Resource'] { name: 'Boolean' } }, + redundancyMode: { + required: false, + serializedName: 'properties.redundancyMode', + type: { + name: 'Enum', + allowedValues: [ 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' ] + } + }, + inProgressOperationId: { + required: false, + readOnly: true, + serializedName: 'properties.inProgressOperationId', + type: { + name: 'String' + } + }, + geoDistributions: { + required: false, + serializedName: 'properties.geoDistributions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'GeoDistributionElementType', + type: { + name: 'Composite', + className: 'GeoDistribution' + } + } + } + }, identity: { required: false, serializedName: 'identity', diff --git a/lib/services/websiteManagement2/lib/models/siteAuthSettings.js b/lib/services/websiteManagement2/lib/models/siteAuthSettings.js index f35b25393d..f73fa8e9a8 100644 --- a/lib/services/websiteManagement2/lib/models/siteAuthSettings.js +++ b/lib/services/websiteManagement2/lib/models/siteAuthSettings.js @@ -67,6 +67,10 @@ class SiteAuthSettings extends models['ProxyOnlyResource'] { * authenticate end users. * More information on OpenID Connect: * http://openid.net/specs/openid-connect-core-1_0.html + * @member {string} [clientSecretCertificateThumbprint] An alternative to the + * client secret, that is the thumbprint of a certificate used for signing + * purposes. This property acts as + * a replacement for the Client Secret. It is also optional. * @member {string} [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 @@ -261,6 +265,13 @@ class SiteAuthSettings extends models['ProxyOnlyResource'] { name: 'String' } }, + clientSecretCertificateThumbprint: { + required: false, + serializedName: 'properties.clientSecretCertificateThumbprint', + type: { + name: 'String' + } + }, issuer: { required: false, serializedName: 'properties.issuer', diff --git a/lib/services/websiteManagement2/lib/models/siteConfig.js b/lib/services/websiteManagement2/lib/models/siteConfig.js index 5715d374ae..deee6e28b9 100644 --- a/lib/services/websiteManagement2/lib/models/siteConfig.js +++ b/lib/services/websiteManagement2/lib/models/siteConfig.js @@ -70,7 +70,7 @@ class SiteConfig { * @member {string} [loadBalancing] Site load balancing. Possible values * include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' - * @member {object} [experiments] This is work around for polymophic types. + * @member {object} [experiments] This is work around for polymorphic types. * @member {array} [experiments.rampUpRules] List of ramp-up rules. * @member {object} [limits] Site limits. * @member {number} [limits.maxPercentageCpu] Maximum allowed CPU usage @@ -120,6 +120,10 @@ class SiteConfig { * @member {array} [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. + * @member {boolean} [cors.supportCredentials] Gets or sets whether CORS + * requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. * @member {object} [push] Push endpoint settings. * @member {boolean} [push.isPushEnabled] Gets or sets a flag indicating * whether the Push endpoint is enabled. @@ -144,7 +148,12 @@ class SiteConfig { * @member {number} [managedServiceIdentityId] Managed Service Identity Id * @member {number} [xManagedServiceIdentityId] Explicit Managed Service * Identity Id - * @member {array} [ipSecurityRestrictions] IP security restrictions. + * @member {array} [ipSecurityRestrictions] IP security restrictions for + * main. + * @member {array} [scmIpSecurityRestrictions] IP security restrictions for + * scm. + * @member {boolean} [scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * @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 @@ -568,6 +577,28 @@ class SiteConfig { } } }, + scmIpSecurityRestrictions: { + required: false, + serializedName: 'scmIpSecurityRestrictions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'IpSecurityRestrictionElementType', + type: { + name: 'Composite', + className: 'IpSecurityRestriction' + } + } + } + }, + scmIpSecurityRestrictionsUseMain: { + required: false, + serializedName: 'scmIpSecurityRestrictionsUseMain', + type: { + name: 'Boolean' + } + }, http20Enabled: { required: false, serializedName: 'http20Enabled', diff --git a/lib/services/websiteManagement2/lib/models/siteConfigResource.js b/lib/services/websiteManagement2/lib/models/siteConfigResource.js index bbfa3cc80c..0b56df6165 100644 --- a/lib/services/websiteManagement2/lib/models/siteConfigResource.js +++ b/lib/services/websiteManagement2/lib/models/siteConfigResource.js @@ -73,7 +73,7 @@ class SiteConfigResource extends models['ProxyOnlyResource'] { * @member {string} [loadBalancing] Site load balancing. Possible values * include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' - * @member {object} [experiments] This is work around for polymophic types. + * @member {object} [experiments] This is work around for polymorphic types. * @member {array} [experiments.rampUpRules] List of ramp-up rules. * @member {object} [limits] Site limits. * @member {number} [limits.maxPercentageCpu] Maximum allowed CPU usage @@ -123,6 +123,10 @@ class SiteConfigResource extends models['ProxyOnlyResource'] { * @member {array} [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. + * @member {boolean} [cors.supportCredentials] Gets or sets whether CORS + * requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. * @member {object} [push] Push endpoint settings. * @member {boolean} [push.isPushEnabled] Gets or sets a flag indicating * whether the Push endpoint is enabled. @@ -147,7 +151,12 @@ class SiteConfigResource extends models['ProxyOnlyResource'] { * @member {number} [managedServiceIdentityId] Managed Service Identity Id * @member {number} [xManagedServiceIdentityId] Explicit Managed Service * Identity Id - * @member {array} [ipSecurityRestrictions] IP security restrictions. + * @member {array} [ipSecurityRestrictions] IP security restrictions for + * main. + * @member {array} [scmIpSecurityRestrictions] IP security restrictions for + * scm. + * @member {boolean} [scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * @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 @@ -603,6 +612,28 @@ class SiteConfigResource extends models['ProxyOnlyResource'] { } } }, + scmIpSecurityRestrictions: { + required: false, + serializedName: 'properties.scmIpSecurityRestrictions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'IpSecurityRestrictionElementType', + type: { + name: 'Composite', + className: 'IpSecurityRestriction' + } + } + } + }, + scmIpSecurityRestrictionsUseMain: { + required: false, + serializedName: 'properties.scmIpSecurityRestrictionsUseMain', + type: { + name: 'Boolean' + } + }, http20Enabled: { required: false, serializedName: 'properties.http20Enabled', diff --git a/lib/services/websiteManagement2/lib/models/sitePatchResource.js b/lib/services/websiteManagement2/lib/models/sitePatchResource.js index 39de10c15e..4ed92950d9 100644 --- a/lib/services/websiteManagement2/lib/models/sitePatchResource.js +++ b/lib/services/websiteManagement2/lib/models/sitePatchResource.js @@ -107,7 +107,7 @@ class SitePatchResource extends models['ProxyOnlyResource'] { * values include: 'WeightedRoundRobin', 'LeastRequests', * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * @member {object} [siteConfig.experiments] This is work around for - * polymophic types. + * polymorphic types. * @member {array} [siteConfig.experiments.rampUpRules] List of ramp-up * rules. * @member {object} [siteConfig.limits] Site limits. @@ -164,6 +164,10 @@ class SitePatchResource extends models['ProxyOnlyResource'] { * @member {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. + * @member {boolean} [siteConfig.cors.supportCredentials] Gets or sets + * whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. * @member {object} [siteConfig.push] Push endpoint settings. * @member {boolean} [siteConfig.push.isPushEnabled] Gets or sets a flag * indicating whether the Push endpoint is enabled. @@ -191,7 +195,11 @@ class SitePatchResource extends models['ProxyOnlyResource'] { * @member {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed * Service Identity Id * @member {array} [siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * @member {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * @member {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP + * security restrictions for scm to use main. * @member {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a * web site to allow clients to connect over http2.0 * @member {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the @@ -224,6 +232,8 @@ class SitePatchResource extends models['ProxyOnlyResource'] { * @member {boolean} [clientCertEnabled] true to enable client * certificate authentication (TLS mutual authentication); otherwise, * false. Default is false. + * @member {string} [clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths * @member {boolean} [hostNamesDisabled] true to disable the * public hostnames of the app; otherwise, false. * If true, the app is only accessible via API management @@ -289,6 +299,11 @@ class SitePatchResource extends models['ProxyOnlyResource'] { * @member {boolean} [httpsOnly] HttpsOnly: configures a web site to accept * only https requests. Issues redirect for * http requests + * @member {string} [redundancyMode] Site redundancy mode. Possible values + * include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * @member {uuid} [inProgressOperationId] Specifies an operation id if this + * site has a pending operation. + * @member {array} [geoDistributions] GeoDistributions for this site */ constructor() { super(); @@ -525,6 +540,13 @@ class SitePatchResource extends models['ProxyOnlyResource'] { name: 'Boolean' } }, + clientCertExclusionPaths: { + required: false, + serializedName: 'properties.clientCertExclusionPaths', + type: { + name: 'String' + } + }, hostNamesDisabled: { required: false, serializedName: 'properties.hostNamesDisabled', @@ -625,6 +647,37 @@ class SitePatchResource extends models['ProxyOnlyResource'] { type: { name: 'Boolean' } + }, + redundancyMode: { + required: false, + serializedName: 'properties.redundancyMode', + type: { + name: 'Enum', + allowedValues: [ 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' ] + } + }, + inProgressOperationId: { + required: false, + readOnly: true, + serializedName: 'properties.inProgressOperationId', + type: { + name: 'String' + } + }, + geoDistributions: { + required: false, + serializedName: 'properties.geoDistributions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'GeoDistributionElementType', + type: { + name: 'Composite', + className: 'GeoDistribution' + } + } + } } } } diff --git a/lib/services/websiteManagement2/lib/models/slotSwapStatus.js b/lib/services/websiteManagement2/lib/models/slotSwapStatus.js index 6d399a5285..3e8094ba28 100644 --- a/lib/services/websiteManagement2/lib/models/slotSwapStatus.js +++ b/lib/services/websiteManagement2/lib/models/slotSwapStatus.js @@ -11,7 +11,7 @@ 'use strict'; /** - * The status of the last successfull slot swap operation. + * The status of the last successful slot swap operation. * */ class SlotSwapStatus { diff --git a/lib/services/websiteManagement2/lib/models/snapshotRestoreRequest.js b/lib/services/websiteManagement2/lib/models/snapshotRestoreRequest.js index ad5d840c8a..657a34f217 100644 --- a/lib/services/websiteManagement2/lib/models/snapshotRestoreRequest.js +++ b/lib/services/websiteManagement2/lib/models/snapshotRestoreRequest.js @@ -39,6 +39,8 @@ class SnapshotRestoreRequest extends models['ProxyOnlyResource'] { * @member {boolean} [ignoreConflictingHostNames] If true, custom hostname * conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. + * @member {boolean} [useDRSecondary] If true, the snapshot is retrieved from + * DRSecondary endpoint. */ constructor() { super(); @@ -124,6 +126,13 @@ class SnapshotRestoreRequest extends models['ProxyOnlyResource'] { type: { name: 'Boolean' } + }, + useDRSecondary: { + required: false, + serializedName: 'properties.useDRSecondary', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/stackMajorVersion.js b/lib/services/websiteManagement2/lib/models/stackMajorVersion.js index 6e76522dfb..37d9a60f00 100644 --- a/lib/services/websiteManagement2/lib/models/stackMajorVersion.js +++ b/lib/services/websiteManagement2/lib/models/stackMajorVersion.js @@ -25,6 +25,8 @@ class StackMajorVersion { * major version; otherwise, false. * @member {array} [minorVersions] Minor versions associated with the major * version. + * @member {boolean} [applicationInsights] true if this supports + * Application Insights; otherwise, false. */ constructor() { } @@ -78,6 +80,13 @@ class StackMajorVersion { } } } + }, + applicationInsights: { + required: false, + serializedName: 'applicationInsights', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/stackMinorVersion.js b/lib/services/websiteManagement2/lib/models/stackMinorVersion.js index 2154f681e0..5851000e34 100644 --- a/lib/services/websiteManagement2/lib/models/stackMinorVersion.js +++ b/lib/services/websiteManagement2/lib/models/stackMinorVersion.js @@ -23,6 +23,8 @@ class StackMinorVersion { * only). * @member {boolean} [isDefault] true if this is the default * minor version; otherwise, false. + * @member {boolean} [isRemoteDebuggingEnabled] true if this + * supports Remote Debugging, otherwise false. */ constructor() { } @@ -61,6 +63,13 @@ class StackMinorVersion { type: { name: 'Boolean' } + }, + isRemoteDebuggingEnabled: { + required: false, + serializedName: 'isRemoteDebuggingEnabled', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/user.js b/lib/services/websiteManagement2/lib/models/user.js index ec8071fce3..e51a3b2287 100644 --- a/lib/services/websiteManagement2/lib/models/user.js +++ b/lib/services/websiteManagement2/lib/models/user.js @@ -13,7 +13,7 @@ const models = require('./index'); /** - * User crendentials used for publishing activity. + * User credentials used for publishing activity. * * @extends models['ProxyOnlyResource'] */ diff --git a/lib/services/websiteManagement2/lib/models/validateContainerSettingsRequest.js b/lib/services/websiteManagement2/lib/models/validateContainerSettingsRequest.js new file mode 100644 index 0000000000..7d81d88a94 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/validateContainerSettingsRequest.js @@ -0,0 +1,92 @@ +/* + * 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'; + +/** + * Container settings validation request context + * + */ +class ValidateContainerSettingsRequest { + /** + * Create a ValidateContainerSettingsRequest. + * @member {string} [baseUrl] Base URL of the container registry + * @member {string} [username] Username for to access the container registry + * @member {string} [password] Password for to access the container registry + * @member {string} [repository] Repository name (image name) + * @member {string} [tag] Image tag + * @member {string} [platform] Platform (windows or linux) + */ + constructor() { + } + + /** + * Defines the metadata of ValidateContainerSettingsRequest + * + * @returns {object} metadata of ValidateContainerSettingsRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'ValidateContainerSettingsRequest', + type: { + name: 'Composite', + className: 'ValidateContainerSettingsRequest', + modelProperties: { + baseUrl: { + required: false, + serializedName: 'baseUrl', + type: { + name: 'String' + } + }, + username: { + required: false, + serializedName: 'username', + type: { + name: 'String' + } + }, + password: { + required: false, + serializedName: 'password', + type: { + name: 'String' + } + }, + repository: { + required: false, + serializedName: 'repository', + type: { + name: 'String' + } + }, + tag: { + required: false, + serializedName: 'tag', + type: { + name: 'String' + } + }, + platform: { + required: false, + serializedName: 'platform', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ValidateContainerSettingsRequest; diff --git a/lib/services/websiteManagement2/lib/models/validateRequest.js b/lib/services/websiteManagement2/lib/models/validateRequest.js index 3ca18ee528..5733471d59 100644 --- a/lib/services/websiteManagement2/lib/models/validateRequest.js +++ b/lib/services/websiteManagement2/lib/models/validateRequest.js @@ -30,7 +30,7 @@ class ValidateRequest { * @member {boolean} [isSpot] true if App Service plan is for * Spot instances; otherwise, false. * @member {number} [capacity] Target capacity of the App Service plan - * (number of VM's). + * (number of VMs). * @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 diff --git a/lib/services/websiteManagement2/lib/models/vnetInfo.js b/lib/services/websiteManagement2/lib/models/vnetInfo.js index 6340d209a5..8dc69dedb7 100644 --- a/lib/services/websiteManagement2/lib/models/vnetInfo.js +++ b/lib/services/websiteManagement2/lib/models/vnetInfo.js @@ -31,6 +31,8 @@ class VnetInfo extends models['ProxyOnlyResource'] { * required; otherwise, false. * @member {string} [dnsServers] DNS servers to be used by this Virtual * Network. This should be a comma-separated list of IP addresses. + * @member {boolean} [isSwift] Flag that is used to denote if this is VNET + * injection */ constructor() { super(); @@ -133,6 +135,13 @@ class VnetInfo extends models['ProxyOnlyResource'] { type: { name: 'String' } + }, + isSwift: { + required: false, + serializedName: 'properties.isSwift', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/websiteManagement2/lib/operations/appServiceCertificateOrders.js b/lib/services/websiteManagement2/lib/operations/appServiceCertificateOrders.js index c61d1b4c3d..96713a5e89 100644 --- a/lib/services/websiteManagement2/lib/operations/appServiceCertificateOrders.js +++ b/lib/services/websiteManagement2/lib/operations/appServiceCertificateOrders.js @@ -48,14 +48,12 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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.'); } @@ -68,7 +66,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -214,6 +212,7 @@ function _validatePurchaseInformation(appServiceCertificateOrder, options, callb if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (appServiceCertificateOrder === null || appServiceCertificateOrder === undefined) { @@ -222,9 +221,6 @@ 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.'); } @@ -237,7 +233,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -353,6 +349,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -375,9 +372,6 @@ 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.'); } @@ -391,7 +385,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -513,6 +507,7 @@ function _get(resourceGroupName, certificateOrderName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -538,9 +533,6 @@ 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.'); } @@ -555,7 +547,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -649,8 +641,8 @@ function _get(resourceGroupName, certificateOrderName, options, callback) { * * @param {string} certificateOrderName Name of the certificate order. * - * @param {object} certificateDistinguishedName Distinguished name to to use - * for the certificate order. + * @param {object} certificateDistinguishedName Distinguished name to use for + * the certificate order. * * @param {object} [certificateDistinguishedName.certificates] State of the Key * Vault secret. @@ -788,6 +780,7 @@ function _deleteMethod(resourceGroupName, certificateOrderName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -813,9 +806,6 @@ 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.'); } @@ -830,7 +820,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -905,8 +895,8 @@ function _deleteMethod(resourceGroupName, certificateOrderName, options, callbac * * @param {string} certificateOrderName Name of the certificate order. * - * @param {object} certificateDistinguishedName Distinguished name to to use - * for the certificate order. + * @param {object} certificateDistinguishedName Distinguished name to use for + * the certificate order. * * @param {object} [certificateDistinguishedName.certificates] State of the Key * Vault secret. @@ -961,6 +951,7 @@ function _update(resourceGroupName, certificateOrderName, certificateDistinguish if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -989,9 +980,6 @@ 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.'); } @@ -1006,7 +994,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1159,6 +1147,7 @@ function _listCertificates(resourceGroupName, certificateOrderName, options, cal if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1184,9 +1173,6 @@ 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.'); } @@ -1201,7 +1187,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1325,6 +1311,7 @@ function _getCertificate(resourceGroupName, certificateOrderName, name, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1353,9 +1340,6 @@ 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.'); } @@ -1371,7 +1355,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1591,6 +1575,7 @@ function _deleteCertificate(resourceGroupName, certificateOrderName, name, optio if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1619,9 +1604,6 @@ 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.'); } @@ -1637,7 +1619,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1753,6 +1735,7 @@ function _updateCertificate(resourceGroupName, certificateOrderName, name, keyVa if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1784,9 +1767,6 @@ 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.'); } @@ -1802,7 +1782,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1971,6 +1951,7 @@ function _reissue(resourceGroupName, certificateOrderName, reissueCertificateOrd if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1999,9 +1980,6 @@ 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.'); } @@ -2016,7 +1994,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2145,6 +2123,7 @@ function _renew(resourceGroupName, certificateOrderName, renewCertificateOrderRe if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2173,9 +2152,6 @@ 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.'); } @@ -2190,7 +2166,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2306,6 +2282,7 @@ function _resendEmail(resourceGroupName, certificateOrderName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2331,9 +2308,6 @@ 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.'); } @@ -2348,7 +2322,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2453,6 +2427,7 @@ function _resendRequestEmails(resourceGroupName, certificateOrderName, options, throw new Error('callback cannot be null.'); } let name = (options && options.name !== undefined) ? options.name : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2478,9 +2453,6 @@ 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.'); } @@ -2503,7 +2475,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2627,6 +2599,7 @@ function _retrieveSiteSeal(resourceGroupName, certificateOrderName, siteSealRequ if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2655,9 +2628,6 @@ 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.'); } @@ -2672,7 +2642,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2806,6 +2776,7 @@ function _verifyDomainOwnership(resourceGroupName, certificateOrderName, options if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2831,9 +2802,6 @@ 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.'); } @@ -2848,7 +2816,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2950,6 +2918,7 @@ function _retrieveCertificateActions(resourceGroupName, name, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2975,9 +2944,6 @@ 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.'); } @@ -2992,7 +2958,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3126,6 +3092,7 @@ function _retrieveCertificateEmailHistory(resourceGroupName, name, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3151,9 +3118,6 @@ 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.'); } @@ -3168,7 +3132,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3275,8 +3239,8 @@ function _retrieveCertificateEmailHistory(resourceGroupName, name, options, call * * @param {string} certificateOrderName Name of the certificate order. * - * @param {object} certificateDistinguishedName Distinguished name to to use - * for the certificate order. + * @param {object} certificateDistinguishedName Distinguished name to use for + * the certificate order. * * @param {object} [certificateDistinguishedName.certificates] State of the Key * Vault secret. @@ -3335,6 +3299,7 @@ function _beginCreateOrUpdate(resourceGroupName, certificateOrderName, certifica if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3363,9 +3328,6 @@ 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.'); } @@ -3380,7 +3342,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3549,6 +3511,7 @@ function _beginCreateOrUpdateCertificate(resourceGroupName, certificateOrderName if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3580,9 +3543,6 @@ 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.'); } @@ -3598,7 +3558,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4558,8 +4518,8 @@ class AppServiceCertificateOrders { * * @param {string} certificateOrderName Name of the certificate order. * - * @param {object} certificateDistinguishedName Distinguished name to to use - * for the certificate order. + * @param {object} certificateDistinguishedName Distinguished name to use for + * the certificate order. * * @param {object} [certificateDistinguishedName.certificates] State of the Key * Vault secret. @@ -4624,8 +4584,8 @@ class AppServiceCertificateOrders { * * @param {string} certificateOrderName Name of the certificate order. * - * @param {object} certificateDistinguishedName Distinguished name to to use - * for the certificate order. + * @param {object} certificateDistinguishedName Distinguished name to use for + * the certificate order. * * @param {object} [certificateDistinguishedName.certificates] State of the Key * Vault secret. @@ -4804,8 +4764,8 @@ class AppServiceCertificateOrders { * * @param {string} certificateOrderName Name of the certificate order. * - * @param {object} certificateDistinguishedName Distinguished name to to use - * for the certificate order. + * @param {object} certificateDistinguishedName Distinguished name to use for + * the certificate order. * * @param {object} [certificateDistinguishedName.certificates] State of the Key * Vault secret. @@ -4866,8 +4826,8 @@ class AppServiceCertificateOrders { * * @param {string} certificateOrderName Name of the certificate order. * - * @param {object} certificateDistinguishedName Distinguished name to to use - * for the certificate order. + * @param {object} certificateDistinguishedName Distinguished name to use for + * the certificate order. * * @param {object} [certificateDistinguishedName.certificates] State of the Key * Vault secret. @@ -6287,8 +6247,8 @@ class AppServiceCertificateOrders { * * @param {string} certificateOrderName Name of the certificate order. * - * @param {object} certificateDistinguishedName Distinguished name to to use - * for the certificate order. + * @param {object} certificateDistinguishedName Distinguished name to use for + * the certificate order. * * @param {object} [certificateDistinguishedName.certificates] State of the Key * Vault secret. @@ -6353,8 +6313,8 @@ class AppServiceCertificateOrders { * * @param {string} certificateOrderName Name of the certificate order. * - * @param {object} certificateDistinguishedName Distinguished name to to use - * for the certificate order. + * @param {object} certificateDistinguishedName Distinguished name to use for + * the certificate order. * * @param {object} [certificateDistinguishedName.certificates] State of the Key * Vault secret. diff --git a/lib/services/websiteManagement2/lib/operations/appServiceEnvironments.js b/lib/services/websiteManagement2/lib/operations/appServiceEnvironments.js index ad2df2aa00..69f9a3f169 100644 --- a/lib/services/websiteManagement2/lib/operations/appServiceEnvironments.js +++ b/lib/services/websiteManagement2/lib/operations/appServiceEnvironments.js @@ -48,14 +48,12 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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.'); } @@ -68,7 +66,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -188,6 +186,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -210,9 +209,6 @@ 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.'); } @@ -226,7 +222,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -348,6 +344,7 @@ function _get(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -373,9 +370,6 @@ 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 +384,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -838,6 +832,7 @@ function _update(resourceGroupName, name, hostingEnvironmentEnvelope, options, c if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -866,9 +861,6 @@ 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.'); } @@ -883,7 +875,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1037,6 +1029,7 @@ function _listCapacities(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1062,9 +1055,6 @@ 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.'); } @@ -1079,7 +1069,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1200,6 +1190,7 @@ function _listVips(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1225,9 +1216,6 @@ 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.'); } @@ -1242,7 +1230,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1449,6 +1437,7 @@ function _listDiagnostics(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1474,9 +1463,6 @@ 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.'); } @@ -1491,7 +1477,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1629,6 +1615,7 @@ function _getDiagnosticsItem(resourceGroupName, name, diagnosticsName, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1657,9 +1644,6 @@ 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.'); } @@ -1675,7 +1659,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1796,6 +1780,7 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1821,9 +1806,6 @@ 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.'); } @@ -1838,7 +1820,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1971,6 +1953,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2002,9 +1985,6 @@ 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.'); } @@ -2025,7 +2005,7 @@ function _listMetrics(resourceGroupName, name, options, callback) { if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2146,6 +2126,7 @@ function _listMultiRolePools(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2171,9 +2152,6 @@ 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.'); } @@ -2188,7 +2166,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2309,6 +2287,7 @@ function _getMultiRolePool(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2334,9 +2313,6 @@ 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.'); } @@ -2351,7 +2327,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2657,6 +2633,7 @@ function _updateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, op if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2685,9 +2662,6 @@ 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.'); } @@ -2702,7 +2676,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2858,6 +2832,7 @@ function _listMultiRolePoolInstanceMetricDefinitions(resourceGroupName, name, in if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2886,9 +2861,6 @@ 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.'); } @@ -2904,7 +2876,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3034,6 +3006,7 @@ function _listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, op throw new Error('callback cannot be null.'); } let details = (options && options.details !== undefined) ? options.details : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3065,9 +3038,6 @@ 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.'); } @@ -3086,7 +3056,7 @@ function _listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, op if (details !== null && details !== undefined) { queryParameters.push('details=' + encodeURIComponent(details.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3209,6 +3179,7 @@ function _listMultiRoleMetricDefinitions(resourceGroupName, name, options, callb if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3234,9 +3205,6 @@ 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.'); } @@ -3251,7 +3219,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3393,6 +3361,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3433,9 +3402,6 @@ 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.'); } @@ -3465,7 +3431,7 @@ function _listMultiRoleMetrics(resourceGroupName, name, options, callback) { if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3586,6 +3552,7 @@ function _listMultiRolePoolSkus(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3611,9 +3578,6 @@ 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.'); } @@ -3628,7 +3592,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3750,6 +3714,7 @@ function _listMultiRoleUsages(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3775,9 +3740,6 @@ 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.'); } @@ -3792,7 +3754,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3913,6 +3875,7 @@ function _listOperations(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3938,9 +3901,6 @@ 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.'); } @@ -3955,7 +3915,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4089,6 +4049,7 @@ function _reboot(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4114,9 +4075,6 @@ 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.'); } @@ -4131,7 +4089,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4316,6 +4274,7 @@ function _listAppServicePlans(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4341,9 +4300,6 @@ 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.'); } @@ -4358,7 +4314,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4483,6 +4439,7 @@ function _listWebApps(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let propertiesToInclude = (options && options.propertiesToInclude !== undefined) ? options.propertiesToInclude : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4511,9 +4468,6 @@ 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.'); } @@ -4531,7 +4485,7 @@ function _listWebApps(resourceGroupName, name, options, callback) { if (propertiesToInclude !== null && propertiesToInclude !== undefined) { queryParameters.push('propertiesToInclude=' + encodeURIComponent(propertiesToInclude)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4741,6 +4695,7 @@ function _listUsages(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4769,9 +4724,6 @@ 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.'); } @@ -4789,7 +4741,7 @@ function _listUsages(resourceGroupName, name, options, callback) { if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4910,6 +4862,7 @@ function _listWorkerPools(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4935,9 +4888,6 @@ 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.'); } @@ -4952,7 +4902,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5075,6 +5025,7 @@ function _getWorkerPool(resourceGroupName, name, workerPoolName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5103,9 +5054,6 @@ 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.'); } @@ -5121,7 +5069,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5431,6 +5379,7 @@ function _updateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEn if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5462,9 +5411,6 @@ 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.'); } @@ -5480,7 +5426,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5638,6 +5584,7 @@ function _listWorkerPoolInstanceMetricDefinitions(resourceGroupName, name, worke if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5669,9 +5616,6 @@ 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.'); } @@ -5688,7 +5632,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5827,6 +5771,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5864,9 +5809,6 @@ 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.'); } @@ -5889,7 +5831,7 @@ function _listWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6014,6 +5956,7 @@ function _listWebWorkerMetricDefinitions(resourceGroupName, name, workerPoolName if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6042,9 +5985,6 @@ 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.'); } @@ -6060,7 +6000,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6197,6 +6137,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6231,9 +6172,6 @@ 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.'); } @@ -6255,7 +6193,7 @@ function _listWebWorkerMetrics(resourceGroupName, name, workerPoolName, options, if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6378,6 +6316,7 @@ function _listWorkerPoolSkus(resourceGroupName, name, workerPoolName, options, c if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6406,9 +6345,6 @@ 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.'); } @@ -6424,7 +6360,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6547,6 +6483,7 @@ function _listWebWorkerUsages(resourceGroupName, name, workerPoolName, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6575,9 +6512,6 @@ 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.'); } @@ -6593,7 +6527,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6804,6 +6738,7 @@ function _beginCreateOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelop if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6832,9 +6767,6 @@ 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.'); } @@ -6849,7 +6781,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -7004,6 +6936,7 @@ function _beginDeleteMethod(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let forceDelete = (options && options.forceDelete !== undefined) ? options.forceDelete : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7032,9 +6965,6 @@ 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.'); } @@ -7052,7 +6982,7 @@ function _beginDeleteMethod(resourceGroupName, name, options, callback) { if (forceDelete !== null && forceDelete !== undefined) { queryParameters.push('forceDelete=' + encodeURIComponent(forceDelete.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -7161,6 +7091,7 @@ function _beginChangeVnet(resourceGroupName, name, vnetInfo, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7189,9 +7120,6 @@ function _beginChangeVnet(resourceGroupName, name, vnetInfo, 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.'); } @@ -7206,7 +7134,7 @@ function _beginChangeVnet(resourceGroupName, name, vnetInfo, options, callback) requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -7410,6 +7338,7 @@ function _beginCreateOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoo if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7438,9 +7367,6 @@ 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.'); } @@ -7455,7 +7381,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -7606,6 +7532,7 @@ function _beginResume(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7631,9 +7558,6 @@ 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.'); } @@ -7648,7 +7572,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -7786,6 +7710,7 @@ function _beginSuspend(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7811,9 +7736,6 @@ 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.'); } @@ -7828,7 +7750,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -8020,6 +7942,7 @@ function _beginCreateOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8051,9 +7974,6 @@ 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.'); } @@ -8069,7 +7989,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } diff --git a/lib/services/websiteManagement2/lib/operations/appServicePlans.js b/lib/services/websiteManagement2/lib/operations/appServicePlans.js index 8f99c59f4f..955394edaa 100644 --- a/lib/services/websiteManagement2/lib/operations/appServicePlans.js +++ b/lib/services/websiteManagement2/lib/operations/appServicePlans.js @@ -15,9 +15,9 @@ const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; /** - * @summary Get all App Service plans for a subcription. + * @summary Get all App Service plans for a subscription. * - * Get all App Service plans for a subcription. + * Get all App Service plans for a subscription. * * @param {object} [options] Optional Parameters. * @@ -54,6 +54,7 @@ function _list(options, callback) { throw new Error('callback cannot be null.'); } let detailed = (options && options.detailed !== undefined) ? options.detailed : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (detailed !== null && detailed !== undefined && typeof detailed !== 'boolean') { @@ -62,9 +63,6 @@ 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.'); } @@ -80,7 +78,7 @@ function _list(options, callback) { if (detailed !== null && detailed !== undefined) { queryParameters.push('detailed=' + encodeURIComponent(detailed.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -200,6 +198,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -222,9 +221,6 @@ 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.'); } @@ -238,7 +234,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -359,6 +355,7 @@ function _get(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -384,9 +381,6 @@ 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.'); } @@ -401,7 +395,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -499,9 +493,6 @@ function _get(resourceGroupName, name, options, callback) { * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * @@ -685,6 +676,7 @@ function _deleteMethod(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -710,9 +702,6 @@ 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.'); } @@ -727,7 +716,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -807,9 +796,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * @@ -876,6 +862,7 @@ function _update(resourceGroupName, name, appServicePlan, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -904,9 +891,6 @@ 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.'); } @@ -921,7 +905,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1072,6 +1056,7 @@ function _listCapabilities(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1097,9 +1082,6 @@ 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.'); } @@ -1114,7 +1096,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1253,6 +1235,7 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1284,9 +1267,6 @@ 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.'); } @@ -1303,7 +1283,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1427,6 +1407,7 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1458,9 +1439,6 @@ 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.'); } @@ -1477,7 +1455,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1584,6 +1562,7 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1615,9 +1594,6 @@ 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.'); } @@ -1634,7 +1610,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1759,6 +1735,7 @@ function _listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1790,9 +1767,6 @@ 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.'); } @@ -1809,7 +1783,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1932,6 +1906,7 @@ function _getHybridConnectionPlanLimit(resourceGroupName, name, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1957,9 +1932,6 @@ 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.'); } @@ -1974,7 +1946,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2096,6 +2068,7 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2121,9 +2094,6 @@ 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.'); } @@ -2138,7 +2108,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2262,6 +2232,7 @@ function _listMetricDefintions(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2287,9 +2258,6 @@ 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.'); } @@ -2304,7 +2272,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2388,9 +2356,9 @@ function _listMetricDefintions(resourceGroupName, name, options, callback) { } /** - * @summary Get metrics for an App Serice plan. + * @summary Get metrics for an App Service plan. * - * Get metrics for an App Serice plan. + * Get metrics for an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -2437,6 +2405,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2468,9 +2437,6 @@ 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.'); } @@ -2491,7 +2457,7 @@ function _listMetrics(resourceGroupName, name, options, callback) { if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2586,7 +2552,7 @@ function _listMetrics(resourceGroupName, name, options, callback) { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.softRestart] Specify true to performa + * @param {boolean} [options.softRestart] Specify true to perform * a soft restart, applies the configuration settings and restarts the apps if * necessary. The default is false, which always restarts and * reprovisions the apps @@ -2617,6 +2583,7 @@ function _restartWebApps(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let softRestart = (options && options.softRestart !== undefined) ? options.softRestart : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2645,9 +2612,6 @@ 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.'); } @@ -2665,7 +2629,7 @@ function _restartWebApps(resourceGroupName, name, options, callback) { if (softRestart !== null && softRestart !== undefined) { queryParameters.push('softRestart=' + encodeURIComponent(softRestart.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2782,6 +2746,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2816,9 +2781,6 @@ 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.'); } @@ -2842,7 +2804,7 @@ function _listWebApps(resourceGroupName, name, options, callback) { if (top !== null && top !== undefined) { queryParameters.push('$top=' + encodeURIComponent(top)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2926,9 +2888,9 @@ function _listWebApps(resourceGroupName, name, options, callback) { } /** - * @summary Gets all selectable sku's for a given App Service Plan + * @summary Gets all selectable SKUs for a given App Service Plan * - * Gets all selectable sku's for a given App Service Plan + * Gets all selectable SKUs for a given App Service Plan * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -2962,6 +2924,7 @@ function _getServerFarmSkus(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2987,9 +2950,6 @@ 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.'); } @@ -3004,7 +2964,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3137,6 +3097,7 @@ function _listUsages(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3165,9 +3126,6 @@ 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.'); } @@ -3185,7 +3143,7 @@ function _listUsages(resourceGroupName, name, options, callback) { if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3305,6 +3263,7 @@ function _listVnets(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3330,9 +3289,6 @@ 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.'); } @@ -3347,7 +3303,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3484,6 +3440,7 @@ function _getVnetFromServerFarm(resourceGroupName, name, vnetName, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3512,9 +3469,6 @@ 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.'); } @@ -3530,7 +3484,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3655,6 +3609,7 @@ function _getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3686,9 +3641,6 @@ 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.'); } @@ -3705,7 +3657,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3840,6 +3792,7 @@ function _updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, conn if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3874,9 +3827,6 @@ 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.'); } @@ -3893,7 +3843,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4031,6 +3981,7 @@ function _listRoutesForVnet(resourceGroupName, name, vnetName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4059,9 +4010,6 @@ 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.'); } @@ -4077,7 +4025,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4215,6 +4163,7 @@ function _getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4246,9 +4195,6 @@ 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.'); } @@ -4265,7 +4211,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4423,6 +4369,7 @@ function _createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4457,9 +4404,6 @@ 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.'); } @@ -4476,7 +4420,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4613,6 +4557,7 @@ function _deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4644,9 +4589,6 @@ 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.'); } @@ -4663,7 +4605,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4790,6 +4732,7 @@ function _updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4824,9 +4767,6 @@ 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.'); } @@ -4843,7 +4783,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4979,6 +4919,7 @@ function _rebootWorker(resourceGroupName, name, workerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5007,9 +4948,6 @@ 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.'); } @@ -5025,7 +4963,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5105,9 +5043,6 @@ function _rebootWorker(resourceGroupName, name, workerName, options, callback) { * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * @@ -5212,6 +5147,7 @@ function _beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5240,9 +5176,6 @@ 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.'); } @@ -5257,7 +5190,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5303,7 +5236,7 @@ function _beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -5350,7 +5283,7 @@ function _beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, } } // Deserialize Response - if (statusCode === 202) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -5366,15 +5299,32 @@ function _beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, 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['AppServicePlan']().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 all App Service plans for a subcription. + * @summary Get all App Service plans for a subscription. * - * Get all App Service plans for a subcription. + * Get all App Service plans for a subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -6028,9 +5978,9 @@ function _listMetricDefintionsNext(nextPageLink, options, callback) { } /** - * @summary Get metrics for an App Serice plan. + * @summary Get metrics for an App Service plan. * - * Get metrics for an App Serice plan. + * Get metrics for an App Service plan. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -6468,9 +6418,9 @@ class AppServicePlans { } /** - * @summary Get all App Service plans for a subcription. + * @summary Get all App Service plans for a subscription. * - * Get all App Service plans for a subcription. + * Get all App Service plans for a subscription. * * @param {object} [options] Optional Parameters. * @@ -6503,9 +6453,9 @@ class AppServicePlans { } /** - * @summary Get all App Service plans for a subcription. + * @summary Get all App Service plans for a subscription. * - * Get all App Service plans for a subcription. + * Get all App Service plans for a subscription. * * @param {object} [options] Optional Parameters. * @@ -6756,9 +6706,6 @@ class AppServicePlans { * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * @@ -6875,9 +6822,6 @@ class AppServicePlans { * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * @@ -7107,9 +7051,6 @@ class AppServicePlans { * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * @@ -7188,9 +7129,6 @@ class AppServicePlans { * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * @@ -8052,9 +7990,9 @@ class AppServicePlans { } /** - * @summary Get metrics for an App Serice plan. + * @summary Get metrics for an App Service plan. * - * Get metrics for an App Serice plan. + * Get metrics for an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -8096,9 +8034,9 @@ class AppServicePlans { } /** - * @summary Get metrics for an App Serice plan. + * @summary Get metrics for an App Service plan. * - * Get metrics for an App Serice plan. + * Get metrics for an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -8174,7 +8112,7 @@ class AppServicePlans { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.softRestart] Specify true to performa + * @param {boolean} [options.softRestart] Specify true to perform * a soft restart, applies the configuration settings and restarts the apps if * necessary. The default is false, which always restarts and * reprovisions the apps @@ -8214,7 +8152,7 @@ class AppServicePlans { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.softRestart] Specify true to performa + * @param {boolean} [options.softRestart] Specify true to perform * a soft restart, applies the configuration settings and restarts the apps if * necessary. The default is false, which always restarts and * reprovisions the apps @@ -8378,9 +8316,9 @@ class AppServicePlans { } /** - * @summary Gets all selectable sku's for a given App Service Plan + * @summary Gets all selectable SKUs for a given App Service Plan * - * Gets all selectable sku's for a given App Service Plan + * Gets all selectable SKUs for a given App Service Plan * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -8413,9 +8351,9 @@ class AppServicePlans { } /** - * @summary Gets all selectable sku's for a given App Service Plan + * @summary Gets all selectable SKUs for a given App Service Plan * - * Gets all selectable sku's for a given App Service Plan + * Gets all selectable SKUs for a given App Service Plan * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -9667,9 +9605,6 @@ class AppServicePlans { * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * @@ -9786,9 +9721,6 @@ class AppServicePlans { * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * @@ -9913,9 +9845,9 @@ class AppServicePlans { } /** - * @summary Get all App Service plans for a subcription. + * @summary Get all App Service plans for a subscription. * - * Get all App Service plans for a subcription. + * Get all App Service plans for a subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -9946,9 +9878,9 @@ class AppServicePlans { } /** - * @summary Get all App Service plans for a subcription. + * @summary Get all App Service plans for a subscription. * - * Get all App Service plans for a subcription. + * Get all App Service plans for a subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -10361,9 +10293,9 @@ class AppServicePlans { } /** - * @summary Get metrics for an App Serice plan. + * @summary Get metrics for an App Service plan. * - * Get metrics for an App Serice plan. + * Get metrics for an App Service plan. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -10394,9 +10326,9 @@ class AppServicePlans { } /** - * @summary Get metrics for an App Serice plan. + * @summary Get metrics for an App Service plan. * - * Get metrics for an App Serice plan. + * Get metrics for an App Service plan. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. diff --git a/lib/services/websiteManagement2/lib/operations/certificateRegistrationProvider.js b/lib/services/websiteManagement2/lib/operations/certificateRegistrationProvider.js index 14e286327f..c3e4a5c8b1 100644 --- a/lib/services/websiteManagement2/lib/operations/certificateRegistrationProvider.js +++ b/lib/services/websiteManagement2/lib/operations/certificateRegistrationProvider.js @@ -50,11 +50,9 @@ function _listOperations(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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.'); } @@ -66,7 +64,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } diff --git a/lib/services/websiteManagement2/lib/operations/certificates.js b/lib/services/websiteManagement2/lib/operations/certificates.js index 5bda762528..e65ef03e5b 100644 --- a/lib/services/websiteManagement2/lib/operations/certificates.js +++ b/lib/services/websiteManagement2/lib/operations/certificates.js @@ -47,14 +47,12 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-11-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.'); } @@ -67,7 +65,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -186,6 +184,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-11-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -208,9 +207,6 @@ 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.'); } @@ -224,7 +220,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -345,6 +341,7 @@ function _get(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-11-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -370,9 +367,6 @@ 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.'); } @@ -387,7 +381,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -533,6 +527,7 @@ function _createOrUpdate(resourceGroupName, name, certificateEnvelope, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-11-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -561,9 +556,6 @@ 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.'); } @@ -578,7 +570,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -712,6 +704,7 @@ function _deleteMethod(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-11-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -737,9 +730,6 @@ 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.'); } @@ -754,7 +744,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -878,6 +868,7 @@ function _update(resourceGroupName, name, certificateEnvelope, options, callback if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-11-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -906,9 +897,6 @@ 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.'); } @@ -923,7 +911,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } diff --git a/lib/services/websiteManagement2/lib/operations/deletedWebApps.js b/lib/services/websiteManagement2/lib/operations/deletedWebApps.js index e8f1fec2a2..47ebabf895 100644 --- a/lib/services/websiteManagement2/lib/operations/deletedWebApps.js +++ b/lib/services/websiteManagement2/lib/operations/deletedWebApps.js @@ -48,14 +48,12 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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.'); } @@ -68,7 +66,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } diff --git a/lib/services/websiteManagement2/lib/operations/diagnostics.js b/lib/services/websiteManagement2/lib/operations/diagnostics.js index 92f387cbf1..2abda0b645 100644 --- a/lib/services/websiteManagement2/lib/operations/diagnostics.js +++ b/lib/services/websiteManagement2/lib/operations/diagnostics.js @@ -53,6 +53,7 @@ function _listHostingEnvironmentDetectorResponses(resourceGroupName, name, optio if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -78,9 +79,6 @@ 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.'); } @@ -95,7 +93,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -227,6 +225,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -272,9 +271,6 @@ 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.'); } @@ -299,7 +295,7 @@ function _getHostingEnvironmentDetectorResponse(resourceGroupName, name, detecto if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -421,6 +417,7 @@ function _listSiteDetectorResponses(resourceGroupName, siteName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -446,9 +443,6 @@ 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.'); } @@ -463,7 +457,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -595,6 +589,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -640,9 +635,6 @@ 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.'); } @@ -667,7 +659,7 @@ function _getSiteDetectorResponse(resourceGroupName, siteName, detectorName, opt if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -789,6 +781,7 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, cal if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -814,9 +807,6 @@ 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.'); } @@ -831,7 +821,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -954,6 +944,7 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -982,9 +973,6 @@ 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.'); } @@ -1000,7 +988,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1124,6 +1112,7 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1152,9 +1141,6 @@ 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.'); } @@ -1170,7 +1156,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1295,6 +1281,7 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1326,9 +1313,6 @@ 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.'); } @@ -1345,7 +1329,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1479,6 +1463,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1527,9 +1512,6 @@ 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.'); } @@ -1555,7 +1537,7 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1679,6 +1661,7 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, opt if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1707,9 +1690,6 @@ 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.'); } @@ -1725,7 +1705,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1851,6 +1831,7 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1882,9 +1863,6 @@ 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.'); } @@ -1901,7 +1879,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2036,6 +2014,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2084,9 +2063,6 @@ 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.'); } @@ -2112,7 +2088,7 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2236,6 +2212,7 @@ function _listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, optio if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2264,9 +2241,6 @@ 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.'); } @@ -2282,7 +2256,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2416,6 +2390,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2464,9 +2439,6 @@ 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.'); } @@ -2492,7 +2464,7 @@ function _getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2616,6 +2588,7 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2644,9 +2617,6 @@ 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.'); } @@ -2662,7 +2632,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2787,6 +2757,7 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2818,9 +2789,6 @@ 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.'); } @@ -2837,7 +2805,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2963,6 +2931,7 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2994,9 +2963,6 @@ 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.'); } @@ -3013,7 +2979,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3140,6 +3106,7 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3174,9 +3141,6 @@ 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.'); } @@ -3194,7 +3158,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3330,6 +3294,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3381,9 +3346,6 @@ 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.'); } @@ -3410,7 +3372,7 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3536,6 +3498,7 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3567,9 +3530,6 @@ 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.'); } @@ -3586,7 +3546,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3714,6 +3674,7 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3748,9 +3709,6 @@ 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.'); } @@ -3768,7 +3726,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3905,6 +3863,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3956,9 +3915,6 @@ 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.'); } @@ -3985,7 +3941,7 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } diff --git a/lib/services/websiteManagement2/lib/operations/domainRegistrationProvider.js b/lib/services/websiteManagement2/lib/operations/domainRegistrationProvider.js index 15f1b4c10e..a20f0c8e13 100644 --- a/lib/services/websiteManagement2/lib/operations/domainRegistrationProvider.js +++ b/lib/services/websiteManagement2/lib/operations/domainRegistrationProvider.js @@ -50,11 +50,9 @@ function _listOperations(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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.'); } @@ -66,7 +64,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } diff --git a/lib/services/websiteManagement2/lib/operations/domains.js b/lib/services/websiteManagement2/lib/operations/domains.js index a1222e1242..480b69e1f0 100644 --- a/lib/services/websiteManagement2/lib/operations/domains.js +++ b/lib/services/websiteManagement2/lib/operations/domains.js @@ -51,14 +51,12 @@ function _checkAvailability(options, callback) { throw new Error('callback cannot be null.'); } let name = (options && options.name !== undefined) ? options.name : undefined; + let apiVersion = '2018-02-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.'); } @@ -79,7 +77,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -209,14 +207,12 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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.'); } @@ -229,7 +225,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -346,14 +342,12 @@ function _getControlCenterSsoRequest(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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.'); } @@ -366,7 +360,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -492,6 +486,7 @@ function _listRecommendations(parameters, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (parameters === null || parameters === undefined) { @@ -500,9 +495,6 @@ 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.'); } @@ -515,7 +507,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -648,6 +640,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -670,9 +663,6 @@ 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.'); } @@ -686,7 +676,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -807,6 +797,7 @@ function _get(resourceGroupName, domainName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -832,9 +823,6 @@ 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.'); } @@ -849,7 +837,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1135,6 +1123,7 @@ function _deleteMethod(resourceGroupName, domainName, options, callback) { throw new Error('callback cannot be null.'); } let forceHardDeleteDomain = (options && options.forceHardDeleteDomain !== undefined) ? options.forceHardDeleteDomain : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1163,9 +1152,6 @@ 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.'); } @@ -1183,7 +1169,7 @@ function _deleteMethod(resourceGroupName, domainName, options, callback) { if (forceHardDeleteDomain !== null && forceHardDeleteDomain !== undefined) { queryParameters.push('forceHardDeleteDomain=' + encodeURIComponent(forceHardDeleteDomain.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1362,6 +1348,7 @@ function _update(resourceGroupName, domainName, domain, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1396,9 +1383,6 @@ 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.'); } @@ -1413,7 +1397,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1566,6 +1550,7 @@ function _listOwnershipIdentifiers(resourceGroupName, domainName, options, callb if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1591,9 +1576,6 @@ 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.'); } @@ -1608,7 +1590,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1732,6 +1714,7 @@ function _getOwnershipIdentifier(resourceGroupName, domainName, name, options, c if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1760,9 +1743,6 @@ 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.'); } @@ -1778,7 +1758,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1911,6 +1891,7 @@ function _createOrUpdateOwnershipIdentifier(resourceGroupName, domainName, name, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1942,9 +1923,6 @@ 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.'); } @@ -1960,7 +1938,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2096,6 +2074,7 @@ function _deleteOwnershipIdentifier(resourceGroupName, domainName, name, options if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2124,9 +2103,6 @@ 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.'); } @@ -2142,7 +2118,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2257,6 +2233,7 @@ function _updateOwnershipIdentifier(resourceGroupName, domainName, name, domainO if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2288,9 +2265,6 @@ 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.'); } @@ -2306,7 +2280,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2440,6 +2414,7 @@ function _renew(resourceGroupName, domainName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2465,9 +2440,6 @@ 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.'); } @@ -2482,7 +2454,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2665,6 +2637,7 @@ function _beginCreateOrUpdate(resourceGroupName, domainName, domain, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2699,9 +2672,6 @@ 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.'); } @@ -2716,7 +2686,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } diff --git a/lib/services/websiteManagement2/lib/operations/index.d.ts b/lib/services/websiteManagement2/lib/operations/index.d.ts index 9e81c51925..431f6fc05d 100644 --- a/lib/services/websiteManagement2/lib/operations/index.d.ts +++ b/lib/services/websiteManagement2/lib/operations/index.d.ts @@ -332,8 +332,8 @@ export interface AppServiceCertificateOrders { * * @param {string} certificateOrderName Name of the certificate order. * - * @param {object} certificateDistinguishedName Distinguished name to to use - * for the certificate order. + * @param {object} certificateDistinguishedName Distinguished name to use for + * the certificate order. * * @param {object} [certificateDistinguishedName.certificates] State of the Key * Vault secret. @@ -386,8 +386,8 @@ export interface AppServiceCertificateOrders { * * @param {string} certificateOrderName Name of the certificate order. * - * @param {object} certificateDistinguishedName Distinguished name to to use - * for the certificate order. + * @param {object} certificateDistinguishedName Distinguished name to use for + * the certificate order. * * @param {object} [certificateDistinguishedName.certificates] State of the Key * Vault secret. @@ -524,8 +524,8 @@ export interface AppServiceCertificateOrders { * * @param {string} certificateOrderName Name of the certificate order. * - * @param {object} certificateDistinguishedName Distinguished name to to use - * for the certificate order. + * @param {object} certificateDistinguishedName Distinguished name to use for + * the certificate order. * * @param {object} [certificateDistinguishedName.certificates] State of the Key * Vault secret. @@ -574,8 +574,8 @@ export interface AppServiceCertificateOrders { * * @param {string} certificateOrderName Name of the certificate order. * - * @param {object} certificateDistinguishedName Distinguished name to to use - * for the certificate order. + * @param {object} certificateDistinguishedName Distinguished name to use for + * the certificate order. * * @param {object} [certificateDistinguishedName.certificates] State of the Key * Vault secret. @@ -1629,8 +1629,8 @@ export interface AppServiceCertificateOrders { * * @param {string} certificateOrderName Name of the certificate order. * - * @param {object} certificateDistinguishedName Distinguished name to to use - * for the certificate order. + * @param {object} certificateDistinguishedName Distinguished name to use for + * the certificate order. * * @param {object} [certificateDistinguishedName.certificates] State of the Key * Vault secret. @@ -1683,8 +1683,8 @@ export interface AppServiceCertificateOrders { * * @param {string} certificateOrderName Name of the certificate order. * - * @param {object} certificateDistinguishedName Distinguished name to to use - * for the certificate order. + * @param {object} certificateDistinguishedName Distinguished name to use for + * the certificate order. * * @param {object} [certificateDistinguishedName.certificates] State of the Key * Vault secret. @@ -8111,6 +8111,465 @@ export interface Recommendations { disableRecommendationForSubscription(name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Get past recommendations for an app, optionally specified by the + * time range. + * + * Get past recommendations for an app, optionally specified by the time range. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} hostingEnvironmentName Name of the hosting environment. + * + * @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=channel eq 'Api' or channel eq 'Notification' and startTime + * eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[PT1H|PT1M|P1D] + * + * @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. + */ + listHistoryForHostingEnvironmentWithHttpOperationResponse(resourceGroupName: string, hostingEnvironmentName: string, options?: { expiredOnly? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get past recommendations for an app, optionally specified by the + * time range. + * + * Get past recommendations for an app, optionally specified by the time range. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} hostingEnvironmentName Name of the hosting environment. + * + * @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=channel eq 'Api' or channel eq 'Notification' and startTime + * eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[PT1H|PT1M|P1D] + * + * @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 {RecommendationCollection} - 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. + * + * {RecommendationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendationCollection} 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. + */ + listHistoryForHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, options?: { expiredOnly? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listHistoryForHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, callback: ServiceCallback): void; + listHistoryForHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, options: { expiredOnly? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all recommendations for an app. + * + * Get all recommendations for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} hostingEnvironmentName Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.featured] Specify true to return only + * the most critical recommendations. The default is false, which + * returns all recommendations. + * + * @param {string} [options.filter] Return only channels specified in the + * filter. Filter is specified by using OData syntax. Example: $filter=channel + * eq 'Api' or channel eq 'Notification' + * + * @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. + */ + listRecommendedRulesForHostingEnvironmentWithHttpOperationResponse(resourceGroupName: string, hostingEnvironmentName: string, options?: { featured? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all recommendations for an app. + * + * Get all recommendations for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} hostingEnvironmentName Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.featured] Specify true to return only + * the most critical recommendations. The default is false, which + * returns all recommendations. + * + * @param {string} [options.filter] Return only channels specified in the + * filter. Filter is specified by using OData syntax. Example: $filter=channel + * eq 'Api' or channel eq 'Notification' + * + * @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 {RecommendationCollection} - 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. + * + * {RecommendationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendationCollection} 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. + */ + listRecommendedRulesForHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, options?: { featured? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listRecommendedRulesForHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, callback: ServiceCallback): void; + listRecommendedRulesForHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, options: { featured? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Disable all recommendations for an app. + * + * Disable all recommendations for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} environmentName Name of the app. + * + * @param {string} hostingEnvironmentName + * + * @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. + */ + disableAllForHostingEnvironmentWithHttpOperationResponse(resourceGroupName: string, environmentName: string, hostingEnvironmentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Disable all recommendations for an app. + * + * Disable all recommendations for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} environmentName Name of the app. + * + * @param {string} hostingEnvironmentName + * + * @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. + */ + disableAllForHostingEnvironment(resourceGroupName: string, environmentName: string, hostingEnvironmentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + disableAllForHostingEnvironment(resourceGroupName: string, environmentName: string, hostingEnvironmentName: string, callback: ServiceCallback): void; + disableAllForHostingEnvironment(resourceGroupName: string, environmentName: string, hostingEnvironmentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Reset all recommendation opt-out settings for an app. + * + * Reset all recommendation opt-out settings for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} environmentName Name of the app. + * + * @param {string} hostingEnvironmentName + * + * @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. + */ + resetAllFiltersForHostingEnvironmentWithHttpOperationResponse(resourceGroupName: string, environmentName: string, hostingEnvironmentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Reset all recommendation opt-out settings for an app. + * + * Reset all recommendation opt-out settings for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} environmentName Name of the app. + * + * @param {string} hostingEnvironmentName + * + * @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. + */ + resetAllFiltersForHostingEnvironment(resourceGroupName: string, environmentName: string, hostingEnvironmentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + resetAllFiltersForHostingEnvironment(resourceGroupName: string, environmentName: string, hostingEnvironmentName: string, callback: ServiceCallback): void; + resetAllFiltersForHostingEnvironment(resourceGroupName: string, environmentName: string, hostingEnvironmentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a recommendation rule for an app. + * + * Get a recommendation rule for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} hostingEnvironmentName Name of the hosting environment. + * + * @param {string} name Name of the recommendation. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.updateSeen] Specify true to update + * the last-seen timestamp of the recommendation object. + * + * @param {string} [options.recommendationId] The GUID of the recommendation + * object if you query an expired one. You don't need to specify it to query an + * active entry. + * + * @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. + */ + getRuleDetailsByHostingEnvironmentWithHttpOperationResponse(resourceGroupName: string, hostingEnvironmentName: string, name: string, options?: { updateSeen? : boolean, recommendationId? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a recommendation rule for an app. + * + * Get a recommendation rule for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} hostingEnvironmentName Name of the hosting environment. + * + * @param {string} name Name of the recommendation. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.updateSeen] Specify true to update + * the last-seen timestamp of the recommendation object. + * + * @param {string} [options.recommendationId] The GUID of the recommendation + * object if you query an expired one. You don't need to specify it to query an + * active entry. + * + * @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 {RecommendationRule} - 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. + * + * {RecommendationRule} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendationRule} 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. + */ + getRuleDetailsByHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, name: string, options?: { updateSeen? : boolean, recommendationId? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getRuleDetailsByHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, name: string, callback: ServiceCallback): void; + getRuleDetailsByHostingEnvironment(resourceGroupName: string, hostingEnvironmentName: string, name: string, options: { updateSeen? : boolean, recommendationId? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Disables the specific rule for a web site permanently. + * + * Disables the specific rule for a web site permanently. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} environmentName Site name + * + * @param {string} name Rule name + * + * @param {string} hostingEnvironmentName + * + * @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. + */ + disableRecommendationForHostingEnvironmentWithHttpOperationResponse(resourceGroupName: string, environmentName: string, name: string, hostingEnvironmentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Disables the specific rule for a web site permanently. + * + * Disables the specific rule for a web site permanently. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} environmentName Site name + * + * @param {string} name Rule name + * + * @param {string} hostingEnvironmentName + * + * @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. + */ + disableRecommendationForHostingEnvironment(resourceGroupName: string, environmentName: string, name: string, hostingEnvironmentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + disableRecommendationForHostingEnvironment(resourceGroupName: string, environmentName: string, name: string, hostingEnvironmentName: string, callback: ServiceCallback): void; + disableRecommendationForHostingEnvironment(resourceGroupName: string, environmentName: string, name: string, hostingEnvironmentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Get past recommendations for an app, optionally specified by the * time range. @@ -8402,64 +8861,193 @@ export interface Recommendations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - resetAllFiltersForWebApp(resourceGroupName: string, siteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - resetAllFiltersForWebApp(resourceGroupName: string, siteName: string, callback: ServiceCallback): void; - resetAllFiltersForWebApp(resourceGroupName: string, siteName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + resetAllFiltersForWebApp(resourceGroupName: string, siteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + resetAllFiltersForWebApp(resourceGroupName: string, siteName: string, callback: ServiceCallback): void; + resetAllFiltersForWebApp(resourceGroupName: string, siteName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a recommendation rule for an app. + * + * Get a recommendation rule for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {string} name Name of the recommendation. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.updateSeen] Specify true to update + * the last-seen timestamp of the recommendation object. + * + * @param {string} [options.recommendationId] The GUID of the recommendation + * object if you query an expired one. You don't need to specify it to query an + * active entry. + * + * @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. + */ + getRuleDetailsByWebAppWithHttpOperationResponse(resourceGroupName: string, siteName: string, name: string, options?: { updateSeen? : boolean, recommendationId? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a recommendation rule for an app. + * + * Get a recommendation rule for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {string} name Name of the recommendation. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.updateSeen] Specify true to update + * the last-seen timestamp of the recommendation object. + * + * @param {string} [options.recommendationId] The GUID of the recommendation + * object if you query an expired one. You don't need to specify it to query an + * active entry. + * + * @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 {RecommendationRule} - 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. + * + * {RecommendationRule} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendationRule} 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. + */ + getRuleDetailsByWebApp(resourceGroupName: string, siteName: string, name: string, options?: { updateSeen? : boolean, recommendationId? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getRuleDetailsByWebApp(resourceGroupName: string, siteName: string, name: string, callback: ServiceCallback): void; + getRuleDetailsByWebApp(resourceGroupName: string, siteName: string, name: string, options: { updateSeen? : boolean, recommendationId? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Disables the specific rule for a web site permanently. + * + * Disables the specific rule for a web site permanently. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site name + * + * @param {string} name Rule name + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + disableRecommendationForSiteWithHttpOperationResponse(resourceGroupName: string, siteName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Disables the specific rule for a web site permanently. + * + * Disables the specific rule for a web site permanently. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site name + * + * @param {string} name Rule name + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {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. + */ + disableRecommendationForSite(resourceGroupName: string, siteName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + disableRecommendationForSite(resourceGroupName: string, siteName: string, name: string, callback: ServiceCallback): void; + disableRecommendationForSite(resourceGroupName: string, siteName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Get a recommendation rule for an app. - * - * Get a recommendation rule for an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @summary List all recommendations for a subscription. * - * @param {string} siteName Name of the app. + * List all recommendations for a subscription. * - * @param {string} name Name of the recommendation. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.updateSeen] Specify true to update - * the last-seen timestamp of the recommendation object. - * - * @param {string} [options.recommendationId] The GUID of the recommedation - * object if you query an expired one. You don't need to specify it to query an - * active entry. - * * @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. */ - getRuleDetailsByWebAppWithHttpOperationResponse(resourceGroupName: string, siteName: string, name: string, options?: { updateSeen? : boolean, recommendationId? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Get a recommendation rule for an app. - * - * Get a recommendation rule for an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @summary List all recommendations for a subscription. * - * @param {string} siteName Name of the app. + * List all recommendations for a subscription. * - * @param {string} name Name of the recommendation. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.updateSeen] Specify true to update - * the last-seen timestamp of the recommendation object. - * - * @param {string} [options.recommendationId] The GUID of the recommedation - * object if you query an expired one. You don't need to specify it to query an - * active entry. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -8470,7 +9058,7 @@ export interface Recommendations { * * {Promise} A promise is returned. * - * @resolve {RecommendationRule} - The deserialized result object. + * @resolve {RecommendationCollection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8478,29 +9066,27 @@ export interface Recommendations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RecommendationRule} [result] - The deserialized result object if an error did not occur. - * See {@link RecommendationRule} for more information. + * {RecommendationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendationCollection} 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. */ - getRuleDetailsByWebApp(resourceGroupName: string, siteName: string, name: string, options?: { updateSeen? : boolean, recommendationId? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - getRuleDetailsByWebApp(resourceGroupName: string, siteName: string, name: string, callback: ServiceCallback): void; - getRuleDetailsByWebApp(resourceGroupName: string, siteName: string, name: string, options: { updateSeen? : boolean, recommendationId? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 Disables the specific rule for a web site permanently. - * - * Disables the specific rule for a web site permanently. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @summary Get past recommendations for an app, optionally specified by the + * time range. * - * @param {string} siteName Site name + * Get past recommendations for an app, optionally specified by the time range. * - * @param {string} name Rule name + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -8509,23 +9095,20 @@ export interface Recommendations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - disableRecommendationForSiteWithHttpOperationResponse(resourceGroupName: string, siteName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listHistoryForHostingEnvironmentNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Disables the specific rule for a web site permanently. - * - * Disables the specific rule for a web site permanently. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @summary Get past recommendations for an app, optionally specified by the + * time range. * - * @param {string} siteName Site name + * Get past recommendations for an app, optionally specified by the time range. * - * @param {string} name Rule name + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -8539,7 +9122,7 @@ export interface Recommendations { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {RecommendationCollection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8547,21 +9130,23 @@ export interface Recommendations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {RecommendationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendationCollection} 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. */ - disableRecommendationForSite(resourceGroupName: string, siteName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - disableRecommendationForSite(resourceGroupName: string, siteName: string, name: string, callback: ServiceCallback): void; - disableRecommendationForSite(resourceGroupName: string, siteName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listHistoryForHostingEnvironmentNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHistoryForHostingEnvironmentNext(nextPageLink: string, callback: ServiceCallback): void; + listHistoryForHostingEnvironmentNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary List all recommendations for a subscription. + * @summary Get all recommendations for an app. * - * List all recommendations for a subscription. + * Get all recommendations for an app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -8577,12 +9162,12 @@ export interface Recommendations { * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listRecommendedRulesForHostingEnvironmentNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary List all recommendations for a subscription. + * @summary Get all recommendations for an app. * - * List all recommendations for a subscription. + * Get all recommendations for an app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -8615,9 +9200,9 @@ export interface Recommendations { * * {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; + listRecommendedRulesForHostingEnvironmentNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listRecommendedRulesForHostingEnvironmentNext(nextPageLink: string, callback: ServiceCallback): void; + listRecommendedRulesForHostingEnvironmentNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -9074,7 +9659,7 @@ export interface WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -9166,6 +9751,11 @@ export interface WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -9207,7 +9797,13 @@ export interface WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -9242,6 +9838,9 @@ export interface WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -9302,6 +9901,12 @@ export interface WebApps { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service @@ -9459,7 +10064,7 @@ export interface WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -9551,6 +10156,11 @@ export interface WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -9592,7 +10202,13 @@ export interface WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -9627,6 +10243,9 @@ export interface WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -9687,6 +10306,12 @@ export interface WebApps { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service @@ -9943,7 +10568,7 @@ export interface WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -10035,6 +10660,11 @@ export interface WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -10076,7 +10706,13 @@ export interface WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -10111,6 +10747,9 @@ export interface WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -10171,6 +10810,12 @@ export interface WebApps { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {string} [siteEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -10316,7 +10961,7 @@ export interface WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -10408,6 +11053,11 @@ export interface WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -10449,7 +11099,13 @@ export interface WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -10484,6 +11140,9 @@ export interface WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -10544,6 +11203,12 @@ export interface WebApps { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {string} [siteEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -11655,174 +12320,184 @@ export interface WebApps { * 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 {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. - */ - updateAuthSettingsWithHttpOperationResponse(resourceGroupName: string, name: string, siteAuthSettings: models.SiteAuthSettings, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @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.clientSecretCertificateThumbprint] An + * alternative to the client secret, that is the thumbprint of a certificate + * used for signing purposes. This property acts as + * a replacement for the Client Secret. It is also optional. + * + * @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 {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. + */ + updateAuthSettingsWithHttpOperationResponse(resourceGroupName: string, name: string, siteAuthSettings: models.SiteAuthSettings, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @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.clientSecretCertificateThumbprint] An + * alternative to the client secret, that is the thumbprint of a certificate + * used for signing purposes. This property acts as + * a replacement for the Client Secret. It is also optional. * * @param {string} [siteAuthSettings.issuer] The OpenID Connect Issuer URI that * represents the entity which issues access tokens for this application. @@ -13312,285 +13987,36 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listSlotConfigurationNames(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listSlotConfigurationNames(resourceGroupName: string, name: string, callback: ServiceCallback): void; - listSlotConfigurationNames(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @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 {array} [slotConfigNames.azureStorageConfigNames] List of external - * Azure storage account identifiers. - * - * @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|ServiceError} - The error object. - */ - updateSlotConfigurationNamesWithHttpOperationResponse(resourceGroupName: string, name: string, slotConfigNames: models.SlotConfigNamesResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @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 {array} [slotConfigNames.azureStorageConfigNames] List of external - * Azure storage account identifiers. - * - * @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 {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 {SlotConfigNamesResource} - 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. - * - * {SlotConfigNamesResource} [result] - The deserialized result object if an error did not occur. - * See {@link SlotConfigNamesResource} 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. - */ - updateSlotConfigurationNames(resourceGroupName: string, name: string, slotConfigNames: models.SlotConfigNamesResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateSlotConfigurationNames(resourceGroupName: string, name: string, slotConfigNames: models.SlotConfigNamesResource, callback: ServiceCallback): void; - 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; - + listSlotConfigurationNames(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSlotConfigurationNames(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listSlotConfigurationNames(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. + * @summary 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. + * 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} 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. + * @param {object} slotConfigNames Names of application settings and connection + * strings. See example. * - * {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). + * @param {array} [slotConfigNames.connectionStringNames] List of connection + * string names. * - * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * @param {array} [slotConfigNames.appSettingNames] List of application + * settings names. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {array} [slotConfigNames.azureStorageConfigNames] List of external + * Azure storage account identifiers. * - * @param {string} name Name of the app. + * @param {string} [slotConfigNames.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -13599,122 +14025,37 @@ 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. */ - 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; - + updateSlotConfigurationNamesWithHttpOperationResponse(resourceGroupName: string, name: string, slotConfigNames: models.SlotConfigNamesResource, 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. + * @summary 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. + * 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} 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} 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 {array} [slotConfigNames.azureStorageConfigNames] List of external + * Azure storage account identifiers. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} [slotConfigNames.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -13728,7 +14069,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {SwiftVirtualNetwork} - The deserialized result object. + * @resolve {SlotConfigNamesResource} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13736,16 +14077,17 @@ export interface WebApps { * * {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. + * {SlotConfigNamesResource} [result] - The deserialized result object if an error did not occur. + * See {@link SlotConfigNamesResource} 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; + updateSlotConfigurationNames(resourceGroupName: string, name: string, slotConfigNames: models.SlotConfigNamesResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateSlotConfigurationNames(resourceGroupName: string, name: string, slotConfigNames: models.SlotConfigNamesResource, callback: ServiceCallback): void; + updateSlotConfigurationNames(resourceGroupName: string, name: string, slotConfigNames: models.SlotConfigNamesResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -13912,7 +14254,7 @@ export interface WebApps { * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' * - * @param {object} [siteConfig.experiments] This is work around for polymophic + * @param {object} [siteConfig.experiments] This is work around for polymorphic * types. * * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. @@ -13994,6 +14336,11 @@ export interface WebApps { * origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteConfig.push] Push endpoint settings. * * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag @@ -14033,7 +14380,14 @@ export interface WebApps { * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed * Service Identity Id * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions + * for main. + * + * @param {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * + * @param {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web * site to allow clients to connect over http2.0 @@ -14159,7 +14513,7 @@ export interface WebApps { * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' * - * @param {object} [siteConfig.experiments] This is work around for polymophic + * @param {object} [siteConfig.experiments] This is work around for polymorphic * types. * * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. @@ -14241,6 +14595,11 @@ export interface WebApps { * origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteConfig.push] Push endpoint settings. * * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag @@ -14280,7 +14639,14 @@ export interface WebApps { * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed * Service Identity Id * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions + * for main. + * + * @param {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * + * @param {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web * site to allow clients to connect over http2.0 @@ -14425,7 +14791,7 @@ export interface WebApps { * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' * - * @param {object} [siteConfig.experiments] This is work around for polymophic + * @param {object} [siteConfig.experiments] This is work around for polymorphic * types. * * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. @@ -14507,6 +14873,11 @@ export interface WebApps { * origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteConfig.push] Push endpoint settings. * * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag @@ -14546,7 +14917,14 @@ export interface WebApps { * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed * Service Identity Id * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions + * for main. + * + * @param {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * + * @param {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web * site to allow clients to connect over http2.0 @@ -14672,7 +15050,7 @@ export interface WebApps { * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' * - * @param {object} [siteConfig.experiments] This is work around for polymophic + * @param {object} [siteConfig.experiments] This is work around for polymorphic * types. * * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. @@ -14754,6 +15132,11 @@ export interface WebApps { * origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteConfig.push] Push endpoint settings. * * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag @@ -14793,7 +15176,14 @@ export interface WebApps { * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed * Service Identity Id * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions + * for main. + * + * @param {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * + * @param {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web * site to allow clients to connect over http2.0 @@ -19996,6 +20386,339 @@ export interface WebApps { getMigrateMySqlStatus(resourceGroupName: string, name: string, 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 all network features used by the app (or deployment slot, if * specified). @@ -20092,11 +20815,11 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getNetworkTraceOperationWithHttpOperationResponse(resourceGroupName: string, name: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getNetworkTraceOperationWithHttpOperationResponse(resourceGroupName: string, name: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Gets a named operation for a network trace capturing (or deployment @@ -20124,7 +20847,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20132,15 +20855,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {Array} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getNetworkTraceOperation(resourceGroupName: string, name: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getNetworkTraceOperation(resourceGroupName: string, name: string, operationId: string, callback: ServiceCallback): void; - getNetworkTraceOperation(resourceGroupName: string, name: string, operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getNetworkTraceOperation(resourceGroupName: string, name: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getNetworkTraceOperation(resourceGroupName: string, name: string, operationId: string, callback: ServiceCallback): void; + getNetworkTraceOperation(resourceGroupName: string, name: string, operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -20248,11 +20971,11 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - startWebSiteNetworkTraceOperationWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + startWebSiteNetworkTraceOperationWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Start capturing network packets for the site. @@ -20284,7 +21007,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20292,15 +21015,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {Array} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - startWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - startWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, callback: ServiceCallback): void; - startWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + startWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + startWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, callback: ServiceCallback): void; + startWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -20460,11 +21183,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. */ - getNetworkTraceOperationV2WithHttpOperationResponse(resourceGroupName: string, name: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getNetworkTraceOperationV2WithHttpOperationResponse(resourceGroupName: string, name: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Gets a named operation for a network trace capturing (or deployment @@ -20492,7 +21215,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20500,15 +21223,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {Array} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getNetworkTraceOperationV2(resourceGroupName: string, name: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getNetworkTraceOperationV2(resourceGroupName: string, name: string, operationId: string, callback: ServiceCallback): void; - getNetworkTraceOperationV2(resourceGroupName: string, name: string, operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getNetworkTraceOperationV2(resourceGroupName: string, name: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getNetworkTraceOperationV2(resourceGroupName: string, name: string, operationId: string, callback: ServiceCallback): void; + getNetworkTraceOperationV2(resourceGroupName: string, name: string, operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -22657,6 +23380,9 @@ export interface WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -22695,6 +23421,9 @@ export interface WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -22769,6 +23498,9 @@ export interface WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -22825,6 +23557,9 @@ export interface WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -23400,7 +24135,7 @@ export interface WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -23492,6 +24227,11 @@ export interface WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -23533,7 +24273,13 @@ export interface WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -23568,6 +24314,9 @@ export interface WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -23628,6 +24377,12 @@ export interface WebApps { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service @@ -23788,7 +24543,7 @@ export interface WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -23880,6 +24635,11 @@ export interface WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -23921,7 +24681,13 @@ export interface WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -23956,6 +24722,9 @@ export interface WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -24016,6 +24785,12 @@ export interface WebApps { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service @@ -24281,7 +25056,403 @@ export interface WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic 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 {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * + * @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 for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. + * + * @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 {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * + * @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.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + 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 + * 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] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] 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 {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @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 polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -24373,6 +25544,11 @@ export interface WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -24414,7 +25590,13 @@ export interface WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -24449,6 +25631,9 @@ export interface WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -24509,381 +25694,11 @@ export interface WebApps { * 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 - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - 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 - * 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] Obsolete: Hyper-V sandbox. - * - * @param {boolean} [siteEnvelope.hyperV] 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 {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided - * Azure storage accounts. - * - * @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 {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' * - * @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 {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -26069,6 +26884,11 @@ export interface WebApps { * More information on OpenID Connect: * http://openid.net/specs/openid-connect-core-1_0.html * + * @param {string} [siteAuthSettings.clientSecretCertificateThumbprint] An + * alternative to the client secret, that is the thumbprint of a certificate + * used for signing purposes. This property acts as + * a replacement for the Client Secret. It is also optional. + * * @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 @@ -26241,6 +27061,11 @@ export interface WebApps { * More information on OpenID Connect: * http://openid.net/specs/openid-connect-core-1_0.html * + * @param {string} [siteAuthSettings.clientSecretCertificateThumbprint] An + * alternative to the client secret, that is the thumbprint of a certificate + * used for signing purposes. This property acts as + * a replacement for the Client Secret. It is also optional. + * * @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 @@ -27699,364 +28524,23 @@ 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; - - - /** - * @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 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 {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. - * - * @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. - */ - getSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: 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 {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. - * - * @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. - */ - 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; + 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 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. + * @summary Gets the Push settings associated with web 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. + * 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 {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} name Name of web app. * - * @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 {string} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -28065,42 +28549,24 @@ 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. */ - updateSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listSitePushSettingsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, 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. + * @summary Gets the Push settings associated with web 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. + * 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 {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} name Name of web app. * - * @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 {string} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -28114,7 +28580,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {SwiftVirtualNetwork} - The deserialized result object. + * @resolve {PushSettings} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -28122,16 +28588,16 @@ export interface WebApps { * * {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. + * {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. */ - 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; + 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; /** @@ -28304,7 +28770,7 @@ export interface WebApps { * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' * - * @param {object} [siteConfig.experiments] This is work around for polymophic + * @param {object} [siteConfig.experiments] This is work around for polymorphic * types. * * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. @@ -28386,6 +28852,11 @@ export interface WebApps { * origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteConfig.push] Push endpoint settings. * * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag @@ -28425,7 +28896,14 @@ export interface WebApps { * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed * Service Identity Id * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions + * for main. + * + * @param {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * + * @param {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web * site to allow clients to connect over http2.0 @@ -28554,7 +29032,7 @@ export interface WebApps { * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' * - * @param {object} [siteConfig.experiments] This is work around for polymophic + * @param {object} [siteConfig.experiments] This is work around for polymorphic * types. * * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. @@ -28636,6 +29114,11 @@ export interface WebApps { * origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteConfig.push] Push endpoint settings. * * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag @@ -28675,7 +29158,14 @@ export interface WebApps { * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed * Service Identity Id * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions + * for main. + * + * @param {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * + * @param {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web * site to allow clients to connect over http2.0 @@ -28823,7 +29313,7 @@ export interface WebApps { * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' * - * @param {object} [siteConfig.experiments] This is work around for polymophic + * @param {object} [siteConfig.experiments] This is work around for polymorphic * types. * * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. @@ -28905,6 +29395,11 @@ export interface WebApps { * origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteConfig.push] Push endpoint settings. * * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag @@ -28944,7 +29439,14 @@ export interface WebApps { * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed * Service Identity Id * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions + * for main. + * + * @param {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * + * @param {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web * site to allow clients to connect over http2.0 @@ -29073,7 +29575,7 @@ export interface WebApps { * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' * - * @param {object} [siteConfig.experiments] This is work around for polymophic + * @param {object} [siteConfig.experiments] This is work around for polymorphic * types. * * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. @@ -29155,6 +29657,11 @@ export interface WebApps { * origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteConfig.push] Push endpoint settings. * * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag @@ -29194,7 +29701,14 @@ export interface WebApps { * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed * Service Identity Id * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions + * for main. + * + * @param {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * + * @param {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web * site to allow clients to connect over http2.0 @@ -34569,6 +35083,365 @@ export interface WebApps { getMigrateMySqlStatusSlot(resourceGroupName: string, name: string, slot: string, 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 {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. + * + * @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. + */ + getSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: 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 {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. + * + * @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. + */ + 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; + + /** * @summary Gets all network features used by the app (or deployment slot, if * specified). @@ -34674,11 +35547,11 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getNetworkTraceOperationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, operationId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getNetworkTraceOperationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, operationId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Gets a named operation for a network trace capturing (or deployment @@ -34709,7 +35582,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -34717,15 +35590,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {Array} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getNetworkTraceOperationSlot(resourceGroupName: string, name: string, operationId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getNetworkTraceOperationSlot(resourceGroupName: string, name: string, operationId: string, slot: string, callback: ServiceCallback): void; - getNetworkTraceOperationSlot(resourceGroupName: string, name: string, operationId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getNetworkTraceOperationSlot(resourceGroupName: string, name: string, operationId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getNetworkTraceOperationSlot(resourceGroupName: string, name: string, operationId: string, slot: string, callback: ServiceCallback): void; + getNetworkTraceOperationSlot(resourceGroupName: string, name: string, operationId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -34839,11 +35712,11 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - startWebSiteNetworkTraceOperationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + startWebSiteNetworkTraceOperationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Start capturing network packets for the site. @@ -34877,7 +35750,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -34885,15 +35758,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {Array} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - startWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - startWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - startWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + startWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + startWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + startWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -35066,11 +35939,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. */ - getNetworkTraceOperationSlotV2WithHttpOperationResponse(resourceGroupName: string, name: string, operationId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getNetworkTraceOperationSlotV2WithHttpOperationResponse(resourceGroupName: string, name: string, operationId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Gets a named operation for a network trace capturing (or deployment @@ -35101,7 +35974,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -35109,15 +35982,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {Array} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getNetworkTraceOperationSlotV2(resourceGroupName: string, name: string, operationId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getNetworkTraceOperationSlotV2(resourceGroupName: string, name: string, operationId: string, slot: string, callback: ServiceCallback): void; - getNetworkTraceOperationSlotV2(resourceGroupName: string, name: string, operationId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getNetworkTraceOperationSlotV2(resourceGroupName: string, name: string, operationId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getNetworkTraceOperationSlotV2(resourceGroupName: string, name: string, operationId: string, slot: string, callback: ServiceCallback): void; + getNetworkTraceOperationSlotV2(resourceGroupName: string, name: string, operationId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -37426,6 +38299,9 @@ export interface WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -37467,6 +38343,9 @@ export interface WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -37544,6 +38423,9 @@ export interface WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -37603,6 +38485,9 @@ export interface WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -38188,6 +39073,75 @@ export interface WebApps { listSnapshotsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @param {string} slot Website Slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSnapshotsFromDRSecondarySlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @param {string} slot Website Slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SnapshotCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SnapshotCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSnapshotsFromDRSecondarySlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSnapshotsFromDRSecondarySlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listSnapshotsFromDRSecondarySlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Gets the source control configuration of an app. * @@ -38664,11 +39618,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. */ - startNetworkTraceSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + startNetworkTraceSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Start capturing network packets for the site. @@ -38702,7 +39656,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -38710,15 +39664,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {Array} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - startNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - startNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - startNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + startNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + startNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + startNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -39727,6 +40681,9 @@ export interface WebApps { * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by * this Virtual Network. This should be a comma-separated list of IP addresses. * + * @param {boolean} [connectionEnvelope.isSwift] Flag that is used to denote if + * this is VNET injection + * * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -39772,6 +40729,9 @@ export interface WebApps { * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by * this Virtual Network. This should be a comma-separated list of IP addresses. * + * @param {boolean} [connectionEnvelope.isSwift] Flag that is used to denote if + * this is VNET injection + * * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -39914,6 +40874,9 @@ export interface WebApps { * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by * this Virtual Network. This should be a comma-separated list of IP addresses. * + * @param {boolean} [connectionEnvelope.isSwift] Flag that is used to denote if + * this is VNET injection + * * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -39959,6 +40922,9 @@ export interface WebApps { * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by * this Virtual Network. This should be a comma-separated list of IP addresses. * + * @param {boolean} [connectionEnvelope.isSwift] Flag that is used to denote if + * this is VNET injection + * * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -40545,32 +41511,96 @@ export interface WebApps { * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @returns {Promise} A promise is returned + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + swapSlotWithProductionWithHttpOperationResponse(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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. */ - swapSlotWithProductionWithHttpOperationResponse(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + swapSlotWithProduction(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + swapSlotWithProduction(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, callback: ServiceCallback): void; + swapSlotWithProduction(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** - * @summary Swaps two deployment slots of an app. + * @summary Returns all Snapshots to the user. * - * Swaps two deployment slots of an app. + * Returns all Snapshots to the user. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Website Name. * - * @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 {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} slotSwapEntity.preserveVnet true to preserve - * Virtual Network to the slot during swap; otherwise, false. + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSnapshotsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @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. * @@ -40584,7 +41614,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SnapshotCollection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -40592,21 +41622,22 @@ 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. + * {SnapshotCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - swapSlotWithProduction(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - swapSlotWithProduction(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, callback: ServiceCallback): void; - swapSlotWithProduction(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listSnapshots(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSnapshots(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listSnapshots(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Returns all Snapshots to the user. + * @summary Returns all Snapshots to the user from DRSecondary endpoint. * - * Returns all Snapshots to the user. + * Returns all Snapshots to the user from DRSecondary endpoint. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -40624,12 +41655,12 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - listSnapshotsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listSnapshotsFromDRSecondaryWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Returns all Snapshots to the user. + * @summary Returns all Snapshots to the user from DRSecondary endpoint. * - * Returns all Snapshots to the user. + * Returns all Snapshots to the user from DRSecondary endpoint. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -40663,9 +41694,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listSnapshots(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listSnapshots(resourceGroupName: string, name: string, callback: ServiceCallback): void; - listSnapshots(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listSnapshotsFromDRSecondary(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSnapshotsFromDRSecondary(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listSnapshotsFromDRSecondary(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -41104,11 +42135,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. */ - startNetworkTraceWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + startNetworkTraceWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Start capturing network packets for the site. @@ -41140,7 +42171,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -41148,15 +42179,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {Array} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - startNetworkTrace(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - startNetworkTrace(resourceGroupName: string, name: string, callback: ServiceCallback): void; - startNetworkTrace(resourceGroupName: string, name: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + startNetworkTrace(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + startNetworkTrace(resourceGroupName: string, name: string, callback: ServiceCallback): void; + startNetworkTrace(resourceGroupName: string, name: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -42085,6 +43116,9 @@ export interface WebApps { * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by * this Virtual Network. This should be a comma-separated list of IP addresses. * + * @param {boolean} [connectionEnvelope.isSwift] Flag that is used to denote if + * this is VNET injection + * * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -42127,6 +43161,9 @@ export interface WebApps { * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by * this Virtual Network. This should be a comma-separated list of IP addresses. * + * @param {boolean} [connectionEnvelope.isSwift] Flag that is used to denote if + * this is VNET injection + * * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -42260,6 +43297,9 @@ export interface WebApps { * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by * this Virtual Network. This should be a comma-separated list of IP addresses. * + * @param {boolean} [connectionEnvelope.isSwift] Flag that is used to denote if + * this is VNET injection + * * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -42302,6 +43342,9 @@ export interface WebApps { * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by * this Virtual Network. This should be a comma-separated list of IP addresses. * + * @param {boolean} [connectionEnvelope.isSwift] Flag that is used to denote if + * this is VNET injection + * * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -42869,7 +43912,7 @@ export interface WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -42961,6 +44004,11 @@ export interface WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -43002,7 +44050,13 @@ export interface WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -43037,6 +44091,9 @@ export interface WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -43097,6 +44154,12 @@ export interface WebApps { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service @@ -43254,7 +44317,7 @@ export interface WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -43346,6 +44409,11 @@ export interface WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -43387,7 +44455,13 @@ export interface WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -43422,6 +44496,9 @@ export interface WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -43482,6 +44559,12 @@ export interface WebApps { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service @@ -44324,11 +45407,11 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginStartWebSiteNetworkTraceOperationWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginStartWebSiteNetworkTraceOperationWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Start capturing network packets for the site. @@ -44360,7 +45443,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -44368,15 +45451,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {Array} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginStartWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - beginStartWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, callback: ServiceCallback): void; - beginStartWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginStartWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginStartWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, callback: ServiceCallback): void; + beginStartWebSiteNetworkTraceOperation(resourceGroupName: string, name: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -44546,6 +45629,9 @@ export interface WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -44584,6 +45670,9 @@ export interface WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -44658,6 +45747,9 @@ export interface WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -44714,6 +45806,9 @@ export interface WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -44946,7 +46041,7 @@ export interface WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -45038,6 +46133,11 @@ export interface WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -45079,7 +46179,13 @@ export interface WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -45114,6 +46220,9 @@ export interface WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -45174,6 +46283,12 @@ export interface WebApps { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service @@ -45334,7 +46449,7 @@ export interface WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -45426,6 +46541,11 @@ export interface WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -45467,7 +46587,13 @@ export interface WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -45502,6 +46628,9 @@ export interface WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -45562,6 +46691,12 @@ export interface WebApps { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service @@ -46248,11 +47383,11 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginStartWebSiteNetworkTraceOperationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginStartWebSiteNetworkTraceOperationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Start capturing network packets for the site. @@ -46286,7 +47421,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -46294,15 +47429,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {Array} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName: string, name: string, slot: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -46478,6 +47613,9 @@ export interface WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -46519,6 +47657,9 @@ export interface WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -46596,6 +47737,9 @@ export interface WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -46655,6 +47799,9 @@ export interface WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -46998,11 +48145,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. */ - beginStartNetworkTraceSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginStartNetworkTraceSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Start capturing network packets for the site. @@ -47036,7 +48183,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -47044,15 +48191,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {Array} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginStartNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - beginStartNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - beginStartNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginStartNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginStartNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + beginStartNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -47271,11 +48418,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. */ - beginStartNetworkTraceWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginStartNetworkTraceWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Start capturing network packets for the site. @@ -47307,7 +48454,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -47315,15 +48462,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {Array} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginStartNetworkTrace(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - beginStartNetworkTrace(resourceGroupName: string, name: string, callback: ServiceCallback): void; - beginStartNetworkTrace(resourceGroupName: string, name: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginStartNetworkTrace(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginStartNetworkTrace(resourceGroupName: string, name: string, callback: ServiceCallback): void; + beginStartNetworkTrace(resourceGroupName: string, name: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -50168,6 +51315,67 @@ export interface WebApps { listSnapshotsSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSnapshotsFromDRSecondarySlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SnapshotCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SnapshotCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSnapshotsFromDRSecondarySlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSnapshotsFromDRSecondarySlotNext(nextPageLink: string, callback: ServiceCallback): void; + listSnapshotsFromDRSecondarySlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary List triggered web jobs for an app, or a deployment slot. * @@ -50546,6 +51754,67 @@ export interface WebApps { listSnapshotsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSnapshotsFromDRSecondaryNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SnapshotCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SnapshotCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSnapshotsFromDRSecondaryNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSnapshotsFromDRSecondaryNext(nextPageLink: string, callback: ServiceCallback): void; + listSnapshotsFromDRSecondaryNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary List triggered web jobs for an app, or a deployment slot. * @@ -56954,9 +58223,9 @@ export interface AppServicePlans { /** - * @summary Get all App Service plans for a subcription. + * @summary Get all App Service plans for a subscription. * - * Get all App Service plans for a subcription. + * Get all App Service plans for a subscription. * * @param {object} [options] Optional Parameters. * @@ -56977,9 +58246,9 @@ export interface AppServicePlans { listWithHttpOperationResponse(options?: { detailed? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Get all App Service plans for a subcription. + * @summary Get all App Service plans for a subscription. * - * Get all App Service plans for a subcription. + * Get all App Service plans for a subscription. * * @param {object} [options] Optional Parameters. * @@ -57161,9 +58430,6 @@ export interface AppServicePlans { * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * @@ -57268,9 +58534,6 @@ export interface AppServicePlans { * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * @@ -57458,9 +58721,6 @@ export interface AppServicePlans { * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * @@ -57527,9 +58787,6 @@ export interface AppServicePlans { * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * @@ -58160,9 +59417,9 @@ export interface AppServicePlans { /** - * @summary Get metrics for an App Serice plan. + * @summary Get metrics for an App Service plan. * - * Get metrics for an App Serice plan. + * Get metrics for an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -58192,9 +59449,9 @@ export interface AppServicePlans { listMetricsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Get metrics for an App Serice plan. + * @summary Get metrics for an App Service plan. * - * Get metrics for an App Serice plan. + * Get metrics for an App Service plan. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -58255,7 +59512,7 @@ export interface AppServicePlans { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.softRestart] Specify true to performa + * @param {boolean} [options.softRestart] Specify true to perform * a soft restart, applies the configuration settings and restarts the apps if * necessary. The default is false, which always restarts and * reprovisions the apps @@ -58283,7 +59540,7 @@ export interface AppServicePlans { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.softRestart] Specify true to performa + * @param {boolean} [options.softRestart] Specify true to perform * a soft restart, applies the configuration settings and restarts the apps if * necessary. The default is false, which always restarts and * reprovisions the apps @@ -58405,9 +59662,9 @@ export interface AppServicePlans { /** - * @summary Gets all selectable sku's for a given App Service Plan + * @summary Gets all selectable SKUs for a given App Service Plan * - * Gets all selectable sku's for a given App Service Plan + * Gets all selectable SKUs for a given App Service Plan * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -58428,9 +59685,9 @@ export interface AppServicePlans { getServerFarmSkusWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets all selectable sku's for a given App Service Plan + * @summary Gets all selectable SKUs for a given App Service Plan * - * Gets all selectable sku's for a given App Service Plan + * Gets all selectable SKUs for a given App Service Plan * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -59370,9 +60627,6 @@ export interface AppServicePlans { * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * @@ -59477,9 +60731,6 @@ export interface AppServicePlans { * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for * the App Service Environment to use for the App Service plan. * @@ -59589,9 +60840,9 @@ export interface AppServicePlans { /** - * @summary Get all App Service plans for a subcription. + * @summary Get all App Service plans for a subscription. * - * Get all App Service plans for a subcription. + * Get all App Service plans for a subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -59610,9 +60861,9 @@ export interface AppServicePlans { listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Get all App Service plans for a subcription. + * @summary Get all App Service plans for a subscription. * - * Get all App Service plans for a subcription. + * Get all App Service plans for a subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -59902,9 +61153,9 @@ export interface AppServicePlans { /** - * @summary Get metrics for an App Serice plan. + * @summary Get metrics for an App Service plan. * - * Get metrics for an App Serice plan. + * Get metrics for an App Service plan. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -59923,9 +61174,9 @@ export interface AppServicePlans { listMetricsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Get metrics for an App Serice plan. + * @summary Get metrics for an App Service plan. * - * Get metrics for an App Serice plan. + * Get metrics for an App Service plan. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. diff --git a/lib/services/websiteManagement2/lib/operations/provider.js b/lib/services/websiteManagement2/lib/operations/provider.js index 243f5f22f9..738f4d3516 100644 --- a/lib/services/websiteManagement2/lib/operations/provider.js +++ b/lib/services/websiteManagement2/lib/operations/provider.js @@ -52,14 +52,12 @@ function _getAvailableStacks(options, callback) { throw new Error('callback cannot be null.'); } let osTypeSelected = (options && options.osTypeSelected !== undefined) ? options.osTypeSelected : undefined; + let apiVersion = '2018-02-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.'); } @@ -74,7 +72,7 @@ function _getAvailableStacks(options, callback) { if (osTypeSelected !== null && osTypeSelected !== undefined) { queryParameters.push('osTypeSelected=' + encodeURIComponent(osTypeSelected)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -193,11 +191,9 @@ function _listOperations(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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.'); } @@ -209,7 +205,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -330,6 +326,7 @@ function _getAvailableStacksOnPrem(options, callback) { throw new Error('callback cannot be null.'); } let osTypeSelected = (options && options.osTypeSelected !== undefined) ? options.osTypeSelected : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (osTypeSelected !== null && osTypeSelected !== undefined && typeof osTypeSelected.valueOf() !== 'string') { @@ -338,9 +335,6 @@ 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.'); } @@ -356,7 +350,7 @@ function _getAvailableStacksOnPrem(options, callback) { if (osTypeSelected !== null && osTypeSelected !== undefined) { queryParameters.push('osTypeSelected=' + encodeURIComponent(osTypeSelected)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } diff --git a/lib/services/websiteManagement2/lib/operations/recommendations.js b/lib/services/websiteManagement2/lib/operations/recommendations.js index 82dd249fea..0237a5d613 100644 --- a/lib/services/websiteManagement2/lib/operations/recommendations.js +++ b/lib/services/websiteManagement2/lib/operations/recommendations.js @@ -59,6 +59,7 @@ function _list(options, callback) { } let featured = (options && options.featured !== undefined) ? options.featured : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (featured !== null && featured !== undefined && typeof featured !== 'boolean') { @@ -70,9 +71,6 @@ 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.'); } @@ -91,7 +89,7 @@ function _list(options, callback) { if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -206,14 +204,12 @@ function _resetAllFilters(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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.'); } @@ -226,7 +222,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -327,6 +323,7 @@ function _disableRecommendationForSubscription(name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { @@ -335,9 +332,6 @@ 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.'); } @@ -351,7 +345,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -425,7 +419,7 @@ function _disableRecommendationForSubscription(name, options, callback) { * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} siteName Name of the app. + * @param {string} hostingEnvironmentName Name of the hosting environment. * * @param {object} [options] Optional Parameters. * @@ -455,7 +449,7 @@ function _disableRecommendationForSubscription(name, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listHistoryForWebApp(resourceGroupName, siteName, options, callback) { +function _listHistoryForHostingEnvironment(resourceGroupName, hostingEnvironmentName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -467,6 +461,7 @@ function _listHistoryForWebApp(resourceGroupName, siteName, options, callback) { } let expiredOnly = (options && options.expiredOnly !== undefined) ? options.expiredOnly : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -486,8 +481,8 @@ function _listHistoryForWebApp(resourceGroupName, siteName, options, callback) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } - 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 (hostingEnvironmentName === null || hostingEnvironmentName === undefined || typeof hostingEnvironmentName.valueOf() !== 'string') { + throw new Error('hostingEnvironmentName 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.'); @@ -498,9 +493,6 @@ function _listHistoryForWebApp(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.'); } @@ -510,9 +502,9 @@ function _listHistoryForWebApp(resourceGroupName, siteName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendationHistory'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendationHistory'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{hostingEnvironmentName}', encodeURIComponent(hostingEnvironmentName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; if (expiredOnly !== null && expiredOnly !== undefined) { @@ -521,7 +513,7 @@ function _listHistoryForWebApp(resourceGroupName, siteName, options, callback) { if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -612,7 +604,7 @@ function _listHistoryForWebApp(resourceGroupName, siteName, options, callback) { * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} siteName Name of the app. + * @param {string} hostingEnvironmentName Name of the app. * * @param {object} [options] Optional Parameters. * @@ -641,7 +633,7 @@ function _listHistoryForWebApp(resourceGroupName, siteName, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listRecommendedRulesForWebApp(resourceGroupName, siteName, options, callback) { +function _listRecommendedRulesForHostingEnvironment(resourceGroupName, hostingEnvironmentName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -653,6 +645,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -672,8 +665,8 @@ function _listRecommendedRulesForWebApp(resourceGroupName, siteName, options, ca throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } - 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 (hostingEnvironmentName === null || hostingEnvironmentName === undefined || typeof hostingEnvironmentName.valueOf() !== 'string') { + throw new Error('hostingEnvironmentName cannot be null or undefined and it must be of type string.'); } if (featured !== null && featured !== undefined && typeof featured !== 'boolean') { throw new Error('featured must be of type boolean.'); @@ -684,9 +677,6 @@ 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.'); } @@ -696,9 +686,9 @@ function _listRecommendedRulesForWebApp(resourceGroupName, siteName, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{hostingEnvironmentName}', encodeURIComponent(hostingEnvironmentName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; if (featured !== null && featured !== undefined) { @@ -707,7 +697,7 @@ function _listRecommendedRulesForWebApp(resourceGroupName, siteName, options, ca if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -798,7 +788,9 @@ function _listRecommendedRulesForWebApp(resourceGroupName, siteName, options, ca * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} siteName Name of the app. + * @param {string} environmentName Name of the app. + * + * @param {string} hostingEnvironmentName * * @param {object} [options] Optional Parameters. * @@ -817,7 +809,7 @@ function _listRecommendedRulesForWebApp(resourceGroupName, siteName, options, ca * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _disableAllForWebApp(resourceGroupName, siteName, options, callback) { +function _disableAllForHostingEnvironment(resourceGroupName, environmentName, hostingEnvironmentName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -827,6 +819,7 @@ function _disableAllForWebApp(resourceGroupName, siteName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -846,15 +839,15 @@ function _disableAllForWebApp(resourceGroupName, siteName, options, callback) { throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } - 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 (environmentName === null || environmentName === undefined || typeof environmentName.valueOf() !== 'string') { + throw new Error('environmentName cannot be null or undefined and it must be of type string.'); + } + if (hostingEnvironmentName === null || hostingEnvironmentName === undefined || typeof hostingEnvironmentName.valueOf() !== 'string') { + throw new Error('hostingEnvironmentName 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.'); } @@ -864,12 +857,13 @@ function _disableAllForWebApp(resourceGroupName, siteName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/disable'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/disable'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{hostingEnvironmentName}', encodeURIComponent(hostingEnvironmentName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('environmentName=' + encodeURIComponent(environmentName)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -942,7 +936,9 @@ function _disableAllForWebApp(resourceGroupName, siteName, options, callback) { * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} siteName Name of the app. + * @param {string} environmentName Name of the app. + * + * @param {string} hostingEnvironmentName * * @param {object} [options] Optional Parameters. * @@ -961,7 +957,7 @@ function _disableAllForWebApp(resourceGroupName, siteName, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _resetAllFiltersForWebApp(resourceGroupName, siteName, options, callback) { +function _resetAllFiltersForHostingEnvironment(resourceGroupName, environmentName, hostingEnvironmentName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -971,6 +967,7 @@ function _resetAllFiltersForWebApp(resourceGroupName, siteName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -990,15 +987,15 @@ function _resetAllFiltersForWebApp(resourceGroupName, siteName, options, callbac throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } - 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 (environmentName === null || environmentName === undefined || typeof environmentName.valueOf() !== 'string') { + throw new Error('environmentName cannot be null or undefined and it must be of type string.'); + } + if (hostingEnvironmentName === null || hostingEnvironmentName === undefined || typeof hostingEnvironmentName.valueOf() !== 'string') { + throw new Error('hostingEnvironmentName 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.'); } @@ -1008,12 +1005,13 @@ function _resetAllFiltersForWebApp(resourceGroupName, siteName, options, callbac // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/reset'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/reset'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{hostingEnvironmentName}', encodeURIComponent(hostingEnvironmentName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('environmentName=' + encodeURIComponent(environmentName)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1086,7 +1084,7 @@ function _resetAllFiltersForWebApp(resourceGroupName, siteName, options, callbac * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} siteName Name of the app. + * @param {string} hostingEnvironmentName Name of the hosting environment. * * @param {string} name Name of the recommendation. * @@ -1095,7 +1093,7 @@ function _resetAllFiltersForWebApp(resourceGroupName, siteName, options, callbac * @param {boolean} [options.updateSeen] Specify true to update * the last-seen timestamp of the recommendation object. * - * @param {string} [options.recommendationId] The GUID of the recommedation + * @param {string} [options.recommendationId] The GUID of the recommendation * object if you query an expired one. You don't need to specify it to query an * active entry. * @@ -1115,7 +1113,7 @@ function _resetAllFiltersForWebApp(resourceGroupName, siteName, options, callbac * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, callback) { +function _getRuleDetailsByHostingEnvironment(resourceGroupName, hostingEnvironmentName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1127,6 +1125,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1146,8 +1145,8 @@ function _getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, cal throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } - 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 (hostingEnvironmentName === null || hostingEnvironmentName === undefined || typeof hostingEnvironmentName.valueOf() !== 'string') { + throw new Error('hostingEnvironmentName 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.'); @@ -1161,9 +1160,6 @@ 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.'); } @@ -1173,9 +1169,9 @@ function _getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{hostingEnvironmentName}', encodeURIComponent(hostingEnvironmentName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; @@ -1185,7 +1181,7 @@ function _getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, cal if (recommendationId !== null && recommendationId !== undefined) { queryParameters.push('recommendationId=' + encodeURIComponent(recommendationId)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1276,10 +1272,12 @@ function _getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, cal * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} siteName Site name + * @param {string} environmentName Site name * * @param {string} name Rule name * + * @param {string} hostingEnvironmentName + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1297,7 +1295,7 @@ function _getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, cal * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _disableRecommendationForSite(resourceGroupName, siteName, name, options, callback) { +function _disableRecommendationForHostingEnvironment(resourceGroupName, environmentName, name, hostingEnvironmentName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1307,6 +1305,7 @@ function _disableRecommendationForSite(resourceGroupName, siteName, name, option if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1326,18 +1325,18 @@ function _disableRecommendationForSite(resourceGroupName, siteName, name, option throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); } } - 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 (environmentName === null || environmentName === undefined || typeof environmentName.valueOf() !== 'string') { + throw new Error('environmentName 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.'); } + if (hostingEnvironmentName === null || hostingEnvironmentName === undefined || typeof hostingEnvironmentName.valueOf() !== 'string') { + throw new Error('hostingEnvironmentName 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.'); } @@ -1347,13 +1346,14 @@ function _disableRecommendationForSite(resourceGroupName, siteName, name, option // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}/disable'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}/disable'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{hostingEnvironmentName}', encodeURIComponent(hostingEnvironmentName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('environmentName=' + encodeURIComponent(environmentName)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1419,15 +1419,27 @@ function _disableRecommendationForSite(resourceGroupName, siteName, name, option } /** - * @summary List all recommendations for a subscription. + * @summary Get past recommendations for an app, optionally specified by the + * time range. * - * List all recommendations for a subscription. + * Get past recommendations for an app, optionally specified by the time range. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. * * @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=channel eq 'Api' or channel eq 'Notification' and startTime + * eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[PT1H|PT1M|P1D] + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1445,7 +1457,7 @@ function _disableRecommendationForSite(resourceGroupName, siteName, name, option * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listNext(nextPageLink, options, callback) { +function _listHistoryForWebApp(resourceGroupName, siteName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1455,10 +1467,39 @@ function _listNext(nextPageLink, 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 = '2018-02-01'; // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -1468,8 +1509,22 @@ function _listNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendationHistory'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); @@ -1550,16 +1605,25 @@ function _listNext(nextPageLink, options, callback) { } /** - * @summary Get past recommendations for an app, optionally specified by the - * time range. + * @summary Get all recommendations for an app. * - * Get past recommendations for an app, optionally specified by the time range. + * Get all recommendations for an app. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.featured] Specify true to return only + * the most critical recommendations. The default is false, which + * returns all recommendations. + * + * @param {string} [options.filter] Return only channels specified in the + * filter. Filter is specified by using OData syntax. Example: $filter=channel + * eq 'Api' or channel eq 'Notification' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1577,7 +1641,7 @@ function _listNext(nextPageLink, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listHistoryForWebAppNext(nextPageLink, options, callback) { +function _listRecommendedRulesForWebApp(resourceGroupName, siteName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1587,10 +1651,39 @@ function _listHistoryForWebAppNext(nextPageLink, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let featured = (options && options.featured !== undefined) ? options.featured : undefined; + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2018-02-01'; // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (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 (featured !== null && featured !== undefined && typeof featured !== 'boolean') { + throw new Error('featured 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -1600,8 +1693,22 @@ function _listHistoryForWebAppNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (featured !== null && featured !== undefined) { + queryParameters.push('featured=' + encodeURIComponent(featured.toString())); + } + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); @@ -1682,12 +1789,14 @@ function _listHistoryForWebAppNext(nextPageLink, options, callback) { } /** - * @summary Get all recommendations for an app. + * @summary Disable all recommendations for an app. * - * Get all recommendations for an app. + * Disable all recommendations for an app. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. * * @param {object} [options] Optional Parameters. * @@ -1700,15 +1809,13 @@ function _listHistoryForWebAppNext(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 RecommendationCollection} 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 _listRecommendedRulesForWebAppNext(nextPageLink, options, callback) { +function _disableAllForWebApp(resourceGroupName, siteName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1718,10 +1825,31 @@ function _listRecommendedRulesForWebAppNext(nextPageLink, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.'); @@ -1731,12 +1859,20 @@ function _listRecommendedRulesForWebAppNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/disable'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1761,7 +1897,7 @@ function _listRecommendedRulesForWebAppNext(nextPageLink, 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); @@ -1771,13 +1907,12 @@ function _listRecommendedRulesForWebAppNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1790,54 +1925,1569 @@ function _listRecommendedRulesForWebAppNext(nextPageLink, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Reset all recommendation opt-out settings for an app. + * + * Reset all recommendation opt-out settings for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName 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 _resetAllFiltersForWebApp(resourceGroupName, siteName, 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 = '2018-02-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 (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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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/{siteName}/recommendations/reset'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + 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 { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RecommendationCollection']().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); }); } -/** Class representing a Recommendations. */ -class Recommendations { - /** - * Create a Recommendations. - * @param {WebSiteManagementClient} client Reference to the service client. +/** + * @summary Get a recommendation rule for an app. + * + * Get a recommendation rule for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {string} name Name of the recommendation. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.updateSeen] Specify true to update + * the last-seen timestamp of the recommendation object. + * + * @param {string} [options.recommendationId] The GUID of the recommendation + * object if you query an expired one. You don't need to specify it to query an + * active entry. + * + * @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 RecommendationRule} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getRuleDetailsByWebApp(resourceGroupName, siteName, 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 updateSeen = (options && options.updateSeen !== undefined) ? options.updateSeen : undefined; + let recommendationId = (options && options.recommendationId !== undefined) ? options.recommendationId : undefined; + let apiVersion = '2018-02-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 (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 (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (updateSeen !== null && updateSeen !== undefined && typeof updateSeen !== 'boolean') { + throw new Error('updateSeen must be of type boolean.'); + } + if (recommendationId !== null && recommendationId !== undefined && typeof recommendationId.valueOf() !== 'string') { + throw new Error('recommendationId 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/{siteName}/recommendations/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (updateSeen !== null && updateSeen !== undefined) { + queryParameters.push('updateSeen=' + encodeURIComponent(updateSeen.toString())); + } + if (recommendationId !== null && recommendationId !== undefined) { + queryParameters.push('recommendationId=' + encodeURIComponent(recommendationId)); + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + 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['RecommendationRule']().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 Disables the specific rule for a web site permanently. + * + * Disables the specific rule for a web site permanently. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site name + * + * @param {string} name Rule 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 _disableRecommendationForSite(resourceGroupName, siteName, 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 = '2018-02-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 (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 (name === 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/{siteName}/recommendations/{name}/disable'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + 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; + try { + parsedErrorResponse = JSON.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 all recommendations for a subscription. + * + * List all recommendations for a subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 RecommendationCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* 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['RecommendationCollection']().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 past recommendations for an app, optionally specified by the + * time range. + * + * Get past recommendations for an app, optionally specified by the time range. + * + * @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 RecommendationCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listHistoryForHostingEnvironmentNext(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['RecommendationCollection']().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 recommendations for an app. + * + * Get all recommendations for an app. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendationCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listRecommendedRulesForHostingEnvironmentNext(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['RecommendationCollection']().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 past recommendations for an app, optionally specified by the + * time range. + * + * Get past recommendations for an app, optionally specified by the time range. + * + * @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 RecommendationCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listHistoryForWebAppNext(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['RecommendationCollection']().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 recommendations for an app. + * + * Get all recommendations for an app. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendationCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listRecommendedRulesForWebAppNext(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['RecommendationCollection']().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); + }); +} + +/** Class representing a Recommendations. */ +class Recommendations { + /** + * Create a Recommendations. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._resetAllFilters = _resetAllFilters; + this._disableRecommendationForSubscription = _disableRecommendationForSubscription; + this._listHistoryForHostingEnvironment = _listHistoryForHostingEnvironment; + this._listRecommendedRulesForHostingEnvironment = _listRecommendedRulesForHostingEnvironment; + this._disableAllForHostingEnvironment = _disableAllForHostingEnvironment; + this._resetAllFiltersForHostingEnvironment = _resetAllFiltersForHostingEnvironment; + this._getRuleDetailsByHostingEnvironment = _getRuleDetailsByHostingEnvironment; + this._disableRecommendationForHostingEnvironment = _disableRecommendationForHostingEnvironment; + this._listHistoryForWebApp = _listHistoryForWebApp; + this._listRecommendedRulesForWebApp = _listRecommendedRulesForWebApp; + this._disableAllForWebApp = _disableAllForWebApp; + this._resetAllFiltersForWebApp = _resetAllFiltersForWebApp; + this._getRuleDetailsByWebApp = _getRuleDetailsByWebApp; + this._disableRecommendationForSite = _disableRecommendationForSite; + this._listNext = _listNext; + this._listHistoryForHostingEnvironmentNext = _listHistoryForHostingEnvironmentNext; + this._listRecommendedRulesForHostingEnvironmentNext = _listRecommendedRulesForHostingEnvironmentNext; + this._listHistoryForWebAppNext = _listHistoryForWebAppNext; + this._listRecommendedRulesForWebAppNext = _listRecommendedRulesForWebAppNext; + } + + /** + * @summary List all recommendations for a subscription. + * + * List all recommendations for a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.featured] Specify true to return only + * the most critical recommendations. The default is false, which + * returns all recommendations. + * + * @param {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime + * eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[PT1H|PT1M|P1D] + * + * @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. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(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 all recommendations for a subscription. + * + * List all recommendations for a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.featured] Specify true to return only + * the most critical recommendations. The default is false, which + * returns all recommendations. + * + * @param {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime + * eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[PT1H|PT1M|P1D] + * + * @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 {RecommendationCollection} - 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 RecommendationCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(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._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * @summary Reset all recommendation opt-out settings for a subscription. + * + * Reset all recommendation opt-out settings for a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + resetAllFiltersWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._resetAllFilters(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Reset all recommendation opt-out settings for a subscription. + * + * Reset all recommendation opt-out settings for a subscription. + * + * @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. + */ + resetAllFilters(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._resetAllFilters(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._resetAllFilters(options, optionalCallback); + } + } + + /** + * @summary Disables the specified rule so it will not apply to a subscription + * in the future. + * + * Disables the specified rule so it will not apply to a subscription in the + * future. + * + * @param {string} name Rule name + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + disableRecommendationForSubscriptionWithHttpOperationResponse(name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._disableRecommendationForSubscription(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 Disables the specified rule so it will not apply to a subscription + * in the future. + * + * Disables the specified rule so it will not apply to a subscription in the + * future. + * + * @param {string} name Rule name + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + disableRecommendationForSubscription(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._disableRecommendationForSubscription(name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._disableRecommendationForSubscription(name, options, optionalCallback); + } + } + + /** + * @summary Get past recommendations for an app, optionally specified by the + * time range. + * + * Get past recommendations for an app, optionally specified by the time range. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} hostingEnvironmentName Name of the hosting environment. + * + * @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=channel eq 'Api' or channel eq 'Notification' and startTime + * eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[PT1H|PT1M|P1D] + * + * @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. + */ + listHistoryForHostingEnvironmentWithHttpOperationResponse(resourceGroupName, hostingEnvironmentName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHistoryForHostingEnvironment(resourceGroupName, hostingEnvironmentName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get past recommendations for an app, optionally specified by the + * time range. + * + * Get past recommendations for an app, optionally specified by the time range. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} hostingEnvironmentName Name of the hosting environment. + * + * @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=channel eq 'Api' or channel eq 'Notification' and startTime + * eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[PT1H|PT1M|P1D] + * + * @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 {RecommendationCollection} - 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 RecommendationCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. */ - constructor(client) { - this.client = client; - this._list = _list; - this._resetAllFilters = _resetAllFilters; - this._disableRecommendationForSubscription = _disableRecommendationForSubscription; - this._listHistoryForWebApp = _listHistoryForWebApp; - this._listRecommendedRulesForWebApp = _listRecommendedRulesForWebApp; - this._disableAllForWebApp = _disableAllForWebApp; - this._resetAllFiltersForWebApp = _resetAllFiltersForWebApp; - this._getRuleDetailsByWebApp = _getRuleDetailsByWebApp; - this._disableRecommendationForSite = _disableRecommendationForSite; - this._listNext = _listNext; - this._listHistoryForWebAppNext = _listHistoryForWebAppNext; - this._listRecommendedRulesForWebAppNext = _listRecommendedRulesForWebAppNext; + listHistoryForHostingEnvironment(resourceGroupName, hostingEnvironmentName, 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._listHistoryForHostingEnvironment(resourceGroupName, hostingEnvironmentName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHistoryForHostingEnvironment(resourceGroupName, hostingEnvironmentName, options, optionalCallback); + } } /** - * @summary List all recommendations for a subscription. + * @summary Get all recommendations for an app. * - * List all recommendations for a subscription. + * Get all recommendations for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} hostingEnvironmentName Name of the app. * * @param {object} [options] Optional Parameters. * @@ -1845,10 +3495,9 @@ class Recommendations { * the most critical recommendations. The default is false, which * returns all recommendations. * - * @param {string} [options.filter] Filter is specified by using OData syntax. - * Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime - * eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D] + * @param {string} [options.filter] Return only channels specified in the + * filter. Filter is specified by using OData syntax. Example: $filter=channel + * eq 'Api' or channel eq 'Notification' * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1859,11 +3508,11 @@ class Recommendations { * * @reject {Error} - The error object. */ - listWithHttpOperationResponse(options) { + listRecommendedRulesForHostingEnvironmentWithHttpOperationResponse(resourceGroupName, hostingEnvironmentName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { + self._listRecommendedRulesForHostingEnvironment(resourceGroupName, hostingEnvironmentName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1874,9 +3523,14 @@ class Recommendations { } /** - * @summary List all recommendations for a subscription. + * @summary Get all recommendations for an app. * - * List all recommendations for a subscription. + * Get all recommendations for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} hostingEnvironmentName Name of the app. * * @param {object} [options] Optional Parameters. * @@ -1884,10 +3538,201 @@ class Recommendations { * the most critical recommendations. The default is false, which * returns all recommendations. * - * @param {string} [options.filter] Filter is specified by using OData syntax. - * Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime - * eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[PT1H|PT1M|P1D] + * @param {string} [options.filter] Return only channels specified in the + * filter. Filter is specified by using OData syntax. Example: $filter=channel + * eq 'Api' or channel eq 'Notification' + * + * @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 {RecommendationCollection} - 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 RecommendationCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listRecommendedRulesForHostingEnvironment(resourceGroupName, hostingEnvironmentName, 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._listRecommendedRulesForHostingEnvironment(resourceGroupName, hostingEnvironmentName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listRecommendedRulesForHostingEnvironment(resourceGroupName, hostingEnvironmentName, options, optionalCallback); + } + } + + /** + * @summary Disable all recommendations for an app. + * + * Disable all recommendations for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} environmentName Name of the app. + * + * @param {string} hostingEnvironmentName + * + * @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. + */ + disableAllForHostingEnvironmentWithHttpOperationResponse(resourceGroupName, environmentName, hostingEnvironmentName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._disableAllForHostingEnvironment(resourceGroupName, environmentName, hostingEnvironmentName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Disable all recommendations for an app. + * + * Disable all recommendations for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} environmentName Name of the app. + * + * @param {string} hostingEnvironmentName + * + * @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. + */ + disableAllForHostingEnvironment(resourceGroupName, environmentName, hostingEnvironmentName, 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._disableAllForHostingEnvironment(resourceGroupName, environmentName, hostingEnvironmentName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._disableAllForHostingEnvironment(resourceGroupName, environmentName, hostingEnvironmentName, options, optionalCallback); + } + } + + /** + * @summary Reset all recommendation opt-out settings for an app. + * + * Reset all recommendation opt-out settings for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} environmentName Name of the app. + * + * @param {string} hostingEnvironmentName + * + * @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. + */ + resetAllFiltersForHostingEnvironmentWithHttpOperationResponse(resourceGroupName, environmentName, hostingEnvironmentName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._resetAllFiltersForHostingEnvironment(resourceGroupName, environmentName, hostingEnvironmentName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Reset all recommendation opt-out settings for an app. + * + * Reset all recommendation opt-out settings for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} environmentName Name of the app. + * + * @param {string} hostingEnvironmentName + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1899,7 +3744,7 @@ class Recommendations { * * {Promise} A promise is returned * - * @resolve {RecommendationCollection} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1907,15 +3752,13 @@ class Recommendations { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RecommendationCollection} 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. */ - list(options, optionalCallback) { + resetAllFiltersForHostingEnvironment(resourceGroupName, environmentName, hostingEnvironmentName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1924,38 +3767,52 @@ class Recommendations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { + self._resetAllFiltersForHostingEnvironment(resourceGroupName, environmentName, hostingEnvironmentName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._list(options, optionalCallback); + return self._resetAllFiltersForHostingEnvironment(resourceGroupName, environmentName, hostingEnvironmentName, options, optionalCallback); } } /** - * @summary Reset all recommendation opt-out settings for a subscription. + * @summary Get a recommendation rule for an app. * - * Reset all recommendation opt-out settings for a subscription. + * Get a recommendation rule for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} hostingEnvironmentName Name of the hosting environment. + * + * @param {string} name Name of the recommendation. * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.updateSeen] Specify true to update + * the last-seen timestamp of the recommendation object. + * + * @param {string} [options.recommendationId] The GUID of the recommendation + * object if you query an expired one. You don't need to specify it to query an + * active entry. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - resetAllFiltersWithHttpOperationResponse(options) { + getRuleDetailsByHostingEnvironmentWithHttpOperationResponse(resourceGroupName, hostingEnvironmentName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._resetAllFilters(options, (err, result, request, response) => { + self._getRuleDetailsByHostingEnvironment(resourceGroupName, hostingEnvironmentName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1966,12 +3823,26 @@ class Recommendations { } /** - * @summary Reset all recommendation opt-out settings for a subscription. + * @summary Get a recommendation rule for an app. * - * Reset all recommendation opt-out settings for a subscription. + * Get a recommendation rule for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} hostingEnvironmentName Name of the hosting environment. + * + * @param {string} name Name of the recommendation. * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.updateSeen] Specify true to update + * the last-seen timestamp of the recommendation object. + * + * @param {string} [options.recommendationId] The GUID of the recommendation + * object if you query an expired one. You don't need to specify it to query an + * active entry. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1982,7 +3853,7 @@ class Recommendations { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {RecommendationRule} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1990,13 +3861,14 @@ class Recommendations { * * {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 RecommendationRule} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - resetAllFilters(options, optionalCallback) { + getRuleDetailsByHostingEnvironment(resourceGroupName, hostingEnvironmentName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2005,26 +3877,31 @@ class Recommendations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._resetAllFilters(options, (err, result, request, response) => { + self._getRuleDetailsByHostingEnvironment(resourceGroupName, hostingEnvironmentName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._resetAllFilters(options, optionalCallback); + return self._getRuleDetailsByHostingEnvironment(resourceGroupName, hostingEnvironmentName, name, options, optionalCallback); } } /** - * @summary Disables the specified rule so it will not apply to a subscription - * in the future. + * @summary Disables the specific rule for a web site permanently. * - * Disables the specified rule so it will not apply to a subscription in the - * future. + * Disables the specific rule for a web site permanently. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} environmentName Site name * * @param {string} name Rule name * + * @param {string} hostingEnvironmentName + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2036,11 +3913,11 @@ class Recommendations { * * @reject {Error} - The error object. */ - disableRecommendationForSubscriptionWithHttpOperationResponse(name, options) { + disableRecommendationForHostingEnvironmentWithHttpOperationResponse(resourceGroupName, environmentName, name, hostingEnvironmentName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._disableRecommendationForSubscription(name, options, (err, result, request, response) => { + self._disableRecommendationForHostingEnvironment(resourceGroupName, environmentName, name, hostingEnvironmentName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2051,14 +3928,19 @@ class Recommendations { } /** - * @summary Disables the specified rule so it will not apply to a subscription - * in the future. + * @summary Disables the specific rule for a web site permanently. * - * Disables the specified rule so it will not apply to a subscription in the - * future. + * Disables the specific rule for a web site permanently. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} environmentName Site name * * @param {string} name Rule name * + * @param {string} hostingEnvironmentName + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2085,7 +3967,7 @@ class Recommendations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - disableRecommendationForSubscription(name, options, optionalCallback) { + disableRecommendationForHostingEnvironment(resourceGroupName, environmentName, name, hostingEnvironmentName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2094,14 +3976,14 @@ class Recommendations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._disableRecommendationForSubscription(name, options, (err, result, request, response) => { + self._disableRecommendationForHostingEnvironment(resourceGroupName, environmentName, name, hostingEnvironmentName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._disableRecommendationForSubscription(name, options, optionalCallback); + return self._disableRecommendationForHostingEnvironment(resourceGroupName, environmentName, name, hostingEnvironmentName, options, optionalCallback); } } @@ -2526,7 +4408,7 @@ class Recommendations { * @param {boolean} [options.updateSeen] Specify true to update * the last-seen timestamp of the recommendation object. * - * @param {string} [options.recommendationId] The GUID of the recommedation + * @param {string} [options.recommendationId] The GUID of the recommendation * object if you query an expired one. You don't need to specify it to query an * active entry. * @@ -2570,7 +4452,7 @@ class Recommendations { * @param {boolean} [options.updateSeen] Specify true to update * the last-seen timestamp of the recommendation object. * - * @param {string} [options.recommendationId] The GUID of the recommedation + * @param {string} [options.recommendationId] The GUID of the recommendation * object if you query an expired one. You don't need to specify it to query an * active entry. * @@ -2803,6 +4685,186 @@ class Recommendations { } } + /** + * @summary Get past recommendations for an app, optionally specified by the + * time range. + * + * Get past recommendations for an app, optionally specified by the time range. + * + * @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. + */ + listHistoryForHostingEnvironmentNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHistoryForHostingEnvironmentNext(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 Get past recommendations for an app, optionally specified by the + * time range. + * + * Get past recommendations for an app, optionally specified by the time range. + * + * @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 {RecommendationCollection} - 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 RecommendationCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listHistoryForHostingEnvironmentNext(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._listHistoryForHostingEnvironmentNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHistoryForHostingEnvironmentNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get all recommendations for an app. + * + * Get all recommendations for an app. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listRecommendedRulesForHostingEnvironmentNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listRecommendedRulesForHostingEnvironmentNext(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 Get all recommendations for an app. + * + * Get all recommendations for an app. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [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 {RecommendationCollection} - 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 RecommendationCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listRecommendedRulesForHostingEnvironmentNext(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._listRecommendedRulesForHostingEnvironmentNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listRecommendedRulesForHostingEnvironmentNext(nextPageLink, options, optionalCallback); + } + } + /** * @summary Get past recommendations for an app, optionally specified by the * time range. diff --git a/lib/services/websiteManagement2/lib/operations/resourceHealthMetadataOperations.js b/lib/services/websiteManagement2/lib/operations/resourceHealthMetadataOperations.js index c75a8a1995..e33e7b65e0 100644 --- a/lib/services/websiteManagement2/lib/operations/resourceHealthMetadataOperations.js +++ b/lib/services/websiteManagement2/lib/operations/resourceHealthMetadataOperations.js @@ -48,14 +48,12 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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.'); } @@ -68,7 +66,7 @@ function _list(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/resourceHealthMetadata'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -190,6 +188,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -212,9 +211,6 @@ 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.'); } @@ -228,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -352,6 +348,7 @@ function _listBySite(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -377,9 +374,6 @@ function _listBySite(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.'); } @@ -394,7 +388,7 @@ function _listBySite(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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -517,6 +511,7 @@ function _getBySite(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -542,9 +537,6 @@ function _getBySite(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.'); } @@ -559,7 +551,7 @@ function _getBySite(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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -686,6 +678,7 @@ function _listBySiteSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -714,9 +707,6 @@ function _listBySiteSlot(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.'); } @@ -732,7 +722,7 @@ function _listBySiteSlot(resourceGroupName, name, slot, options, callback) { requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -858,6 +848,7 @@ function _getBySiteSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -886,9 +877,6 @@ function _getBySiteSlot(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.'); } @@ -904,7 +892,7 @@ function _getBySiteSlot(resourceGroupName, name, slot, options, callback) { requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } diff --git a/lib/services/websiteManagement2/lib/operations/topLevelDomains.js b/lib/services/websiteManagement2/lib/operations/topLevelDomains.js index 20fa9e42ae..d115b1f78f 100644 --- a/lib/services/websiteManagement2/lib/operations/topLevelDomains.js +++ b/lib/services/websiteManagement2/lib/operations/topLevelDomains.js @@ -48,14 +48,12 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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.'); } @@ -68,7 +66,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -186,6 +184,7 @@ function _get(name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { @@ -194,9 +193,6 @@ 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.'); } @@ -210,7 +206,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -341,6 +337,7 @@ function _listAgreements(name, agreementOption, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { @@ -352,9 +349,6 @@ 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.'); } @@ -368,7 +362,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } diff --git a/lib/services/websiteManagement2/lib/operations/webApps.js b/lib/services/websiteManagement2/lib/operations/webApps.js index 2214b95634..de2e5399b4 100644 --- a/lib/services/websiteManagement2/lib/operations/webApps.js +++ b/lib/services/websiteManagement2/lib/operations/webApps.js @@ -47,14 +47,12 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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.'); } @@ -67,7 +65,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -191,6 +189,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { throw new Error('callback cannot be null.'); } let includeSlots = (options && options.includeSlots !== undefined) ? options.includeSlots : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -216,9 +215,6 @@ 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.'); } @@ -235,7 +231,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (includeSlots !== null && includeSlots !== undefined) { queryParameters.push('includeSlots=' + encodeURIComponent(includeSlots.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -356,6 +352,7 @@ function _get(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -381,9 +378,6 @@ 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.'); } @@ -398,7 +392,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -611,7 +605,7 @@ function _get(resourceGroupName, name, options, callback) { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -703,6 +697,11 @@ function _get(resourceGroupName, name, 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 {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -744,7 +743,13 @@ function _get(resourceGroupName, name, options, callback) { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -779,6 +784,9 @@ function _get(resourceGroupName, name, options, callback) { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -839,6 +847,12 @@ function _get(resourceGroupName, name, options, callback) { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service @@ -970,6 +984,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1001,9 +1016,6 @@ 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.'); } @@ -1024,7 +1036,7 @@ function _deleteMethod(resourceGroupName, name, options, callback) { if (deleteEmptyServerFarm !== null && deleteEmptyServerFarm !== undefined) { queryParameters.push('deleteEmptyServerFarm=' + encodeURIComponent(deleteEmptyServerFarm.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1219,7 +1231,7 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -1311,6 +1323,11 @@ function _deleteMethod(resourceGroupName, name, 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 {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -1352,7 +1369,13 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -1387,6 +1410,9 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -1447,6 +1473,12 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {string} [siteEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -1477,6 +1509,7 @@ function _update(resourceGroupName, name, siteEnvelope, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1505,9 +1538,6 @@ 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.'); } @@ -1522,7 +1552,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1678,6 +1708,7 @@ function _analyzeCustomHostname(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let hostName = (options && options.hostName !== undefined) ? options.hostName : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1706,9 +1737,6 @@ 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.'); } @@ -1726,7 +1754,7 @@ function _analyzeCustomHostname(resourceGroupName, name, options, callback) { if (hostName !== null && hostName !== undefined) { queryParameters.push('hostName=' + encodeURIComponent(hostName)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1857,6 +1885,7 @@ function _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1885,9 +1914,6 @@ 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.'); } @@ -1902,7 +1928,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2056,6 +2082,7 @@ function _backup(resourceGroupName, name, request, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2084,9 +2111,6 @@ 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.'); } @@ -2101,7 +2125,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2236,6 +2260,7 @@ function _listBackups(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2261,9 +2286,6 @@ 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.'); } @@ -2278,7 +2300,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2401,6 +2423,7 @@ function _getBackupStatus(resourceGroupName, name, backupId, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2429,9 +2452,6 @@ 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2447,7 +2467,7 @@ function _getBackupStatus(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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2569,6 +2589,7 @@ function _deleteBackup(resourceGroupName, name, backupId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2597,9 +2618,6 @@ function _deleteBackup(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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2615,7 +2633,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2762,6 +2780,7 @@ function _listBackupStatusSecrets(resourceGroupName, name, backupId, request, op if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2793,9 +2812,6 @@ 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.'); } @@ -2811,7 +2827,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3057,6 +3073,7 @@ function _listConfigurations(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3082,9 +3099,6 @@ 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.'); } @@ -3099,7 +3113,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3226,6 +3240,7 @@ function _updateApplicationSettings(resourceGroupName, name, appSettings, option if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3254,9 +3269,6 @@ 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.'); } @@ -3271,7 +3283,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3406,6 +3418,7 @@ function _listApplicationSettings(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3431,9 +3444,6 @@ 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.'); } @@ -3448,7 +3458,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3598,6 +3608,11 @@ function _listApplicationSettings(resourceGroupName, name, options, callback) { * More information on OpenID Connect: * http://openid.net/specs/openid-connect-core-1_0.html * + * @param {string} [siteAuthSettings.clientSecretCertificateThumbprint] An + * alternative to the client secret, that is the thumbprint of a certificate + * used for signing purposes. This property acts as + * a replacement for the Client Secret. It is also optional. + * * @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 @@ -3715,6 +3730,7 @@ function _updateAuthSettings(resourceGroupName, name, siteAuthSettings, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3743,9 +3759,6 @@ 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.'); } @@ -3760,7 +3773,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3895,6 +3908,7 @@ function _getAuthSettings(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3920,9 +3934,6 @@ 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.'); } @@ -3937,7 +3948,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4065,6 +4076,7 @@ function _updateAzureStorageAccounts(resourceGroupName, name, azureStorageAccoun if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4093,9 +4105,6 @@ function _updateAzureStorageAccounts(resourceGroupName, name, azureStorageAccoun if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4110,7 +4119,7 @@ function _updateAzureStorageAccounts(resourceGroupName, name, azureStorageAccoun requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4246,6 +4255,7 @@ function _listAzureStorageAccounts(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4271,9 +4281,6 @@ function _listAzureStorageAccounts(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.'); } @@ -4288,7 +4295,7 @@ function _listAzureStorageAccounts(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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4445,6 +4452,7 @@ function _updateBackupConfiguration(resourceGroupName, name, request, options, c if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4473,9 +4481,6 @@ 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.'); } @@ -4490,7 +4495,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4624,6 +4629,7 @@ function _deleteBackupConfiguration(resourceGroupName, name, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4649,9 +4655,6 @@ 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.'); } @@ -4666,7 +4669,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4769,6 +4772,7 @@ function _getBackupConfiguration(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4794,9 +4798,6 @@ 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.'); } @@ -4811,7 +4812,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4940,6 +4941,7 @@ function _updateConnectionStrings(resourceGroupName, name, connectionStrings, op if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4968,9 +4970,6 @@ 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.'); } @@ -4985,7 +4984,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5121,6 +5120,7 @@ function _listConnectionStrings(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5146,9 +5146,6 @@ 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.'); } @@ -5163,7 +5160,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5284,6 +5281,7 @@ function _getDiagnosticLogsConfiguration(resourceGroupName, name, options, callb if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5309,9 +5307,6 @@ 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.'); } @@ -5326,7 +5321,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5531,6 +5526,7 @@ function _updateDiagnosticLogsConfig(resourceGroupName, name, siteLogsConfig, op if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5559,9 +5555,6 @@ 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.'); } @@ -5576,7 +5569,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5718,6 +5711,7 @@ function _updateMetadata(resourceGroupName, name, metadata, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5746,9 +5740,6 @@ 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.'); } @@ -5763,7 +5754,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -5898,6 +5889,7 @@ function _listMetadata(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5923,9 +5915,6 @@ 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.'); } @@ -5940,7 +5929,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6164,6 +6153,7 @@ function _updateSitePushSettings(resourceGroupName, name, pushSettings, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6192,9 +6182,6 @@ 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.'); } @@ -6209,7 +6196,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6344,6 +6331,7 @@ function _listSitePushSettings(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6369,9 +6357,6 @@ 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.'); } @@ -6386,7 +6371,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6510,6 +6495,7 @@ function _listSlotConfigurationNames(resourceGroupName, name, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6535,9 +6521,6 @@ 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.'); } @@ -6552,7 +6535,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6690,6 +6673,7 @@ function _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6718,9 +6702,6 @@ 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.'); } @@ -6735,7 +6716,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6833,9 +6814,11 @@ function _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, } /** - * @summary Gets a Swift Virtual Network connection. + * @summary 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. + * 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. @@ -6854,13 +6837,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 SwiftVirtualNetwork} 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 _getSwiftVirtualNetworkConnection(resourceGroupName, name, options, callback) { +function _getConfiguration(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -6870,6 +6853,7 @@ function _getSwiftVirtualNetworkConnection(resourceGroupName, name, options, cal if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6895,9 +6879,6 @@ function _getSwiftVirtualNetworkConnection(resourceGroupName, 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.'); } @@ -6907,12 +6888,12 @@ function _getSwiftVirtualNetworkConnection(resourceGroupName, name, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/virtualNetwork'; + 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6980,7 +6961,7 @@ function _getSwiftVirtualNetworkConnection(resourceGroupName, name, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SwiftVirtualNetwork']().mapper(); + let resultMapper = new client.models['SiteConfigResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -6996,32 +6977,250 @@ function _getSwiftVirtualNetworkConnection(resourceGroupName, name, options, cal } /** - * @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. + * @summary 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. + * 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} connectionEnvelope Properties of the Virtual Network - * connection. See example. + * @param {object} siteConfig JSON representation of a SiteConfig object. 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 {number} [siteConfig.numberOfWorkers] Number of workers. * - * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies - * if the scale unit this Web App is on supports Swift integration. + * @param {array} [siteConfig.defaultDocuments] Default documents. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @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 {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @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 polymorphic + * 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 {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * + * @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 + * for main. + * + * @param {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * + * @param {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. + * + * @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. * @@ -7035,13 +7234,13 @@ function _getSwiftVirtualNetworkConnection(resourceGroupName, name, 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 SwiftVirtualNetwork} 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 _createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, callback) { +function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -7051,6 +7250,7 @@ function _createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, c if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7073,15 +7273,12 @@ function _createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, 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 (connectionEnvelope === null || connectionEnvelope === undefined) { - throw new Error('connectionEnvelope cannot be null or undefined.'); + 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.'); } @@ -7091,12 +7288,12 @@ function _createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, c // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/virtualNetwork'; + 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -7125,14 +7322,14 @@ function _createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, c 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'); + 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(connectionEnvelope, null, 2)}.`); + `payload - ${JSON.stringify(siteConfig, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -7178,7 +7375,7 @@ function _createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, c parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SwiftVirtualNetwork']().mapper(); + let resultMapper = new client.models['SiteConfigResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -7194,16 +7391,251 @@ function _createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, c } /** - * @summary Deletes a Swift Virtual Network connection from an app (or - * deployment slot). + * @summary Updates the configuration of an app. * - * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * 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 {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @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 polymorphic + * 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 {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * + * @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 + * for main. + * + * @param {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * + * @param {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. + * + * @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 @@ -7215,13 +7647,14 @@ function _createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, 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. + * 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 _deleteSwiftVirtualNetwork(resourceGroupName, name, options, callback) { +function _updateConfiguration(resourceGroupName, name, siteConfig, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -7231,6 +7664,7 @@ function _deleteSwiftVirtualNetwork(resourceGroupName, name, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7253,12 +7687,12 @@ function _deleteSwiftVirtualNetwork(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.'); } @@ -7268,19 +7702,19 @@ function _deleteSwiftVirtualNetwork(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/virtualNetwork'; + 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -7298,14 +7732,28 @@ function _deleteSwiftVirtualNetwork(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 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); @@ -7315,12 +7763,13 @@ function _deleteSwiftVirtualNetwork(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) { @@ -7333,39 +7782,40 @@ function _deleteSwiftVirtualNetwork(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['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 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. + * @summary 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. + * 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} 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 @@ -7378,13 +7828,14 @@ function _deleteSwiftVirtualNetwork(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 SwiftVirtualNetwork} 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 _updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, callback) { +function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -7394,6 +7845,7 @@ function _updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectio if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7416,15 +7868,9 @@ function _updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectio if (name === 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.'); } @@ -7434,19 +7880,19 @@ function _updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectio // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/virtualNetwork'; + 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -7464,21 +7910,7 @@ function _updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectio } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -7521,7 +7953,7 @@ function _updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectio parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SwiftVirtualNetwork']().mapper(); + let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -7537,17 +7969,18 @@ function _updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectio } /** - * @summary Gets the configuration of an app, such as platform version and - * bitness, default documents, virtual applications, Always On, etc. + * @summary 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. + * 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 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 @@ -7566,7 +7999,7 @@ function _updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectio * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getConfiguration(resourceGroupName, name, options, callback) { +function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -7576,6 +8009,7 @@ function _getConfiguration(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7598,12 +8032,12 @@ function _getConfiguration(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 (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.'); } @@ -7613,12 +8047,13 @@ 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/web/snapshots/{snapshotId}'; 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -7702,258 +8137,35 @@ function _getConfiguration(resourceGroupName, name, options, callback) { } /** - * @summary Updates the configuration of an app. + * @summary Reverts the configuration of an app to a previous snapshot. * - * Updates the configuration of an app. + * 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 {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 {object} [siteConfig.azureStorageAccounts] User-provided Azure - * storage accounts. - * - * @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 {string} snapshotId The ID of the snapshot to read. * - * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request - * Count. + * @param {object} [options] Optional Parameters. * - * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] - * Time interval. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule - * based on private bytes. + * @param {function} callback - The callback. * - * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based - * on status codes. + * @returns {function} callback(err, result, request, response) * - * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule - * based on request execution time. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] - * Time taken. + * {null} [result] - The deserialized result object if an error did not occur. * - * @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. + * {object} [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 _recoverSiteConfigurationSnapshot(resourceGroupName, name, snapshotId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -7963,6 +8175,7 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7985,15 +8198,12 @@ 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 (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.'); } @@ -8003,19 +8213,20 @@ 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/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(this.client.apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -8033,28 +8244,14 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio } } } - // 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 !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -8064,13 +8261,12 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8083,261 +8279,20 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['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. + * @summary Gets the last lines of docker logs for the given site * - * Updates the configuration of an app. + * 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 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 {object} [siteConfig.azureStorageAccounts] User-provided Azure - * storage accounts. - * - * @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} name Name of web app. * * @param {object} [options] Optional Parameters. * @@ -8351,13 +8306,12 @@ 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. * * {object} [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 _getWebSiteContainerLogs(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -8367,6 +8321,7 @@ function _updateConfiguration(resourceGroupName, name, siteConfig, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8389,15 +8344,9 @@ 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.'); } @@ -8407,19 +8356,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}/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)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -8437,44 +8386,31 @@ 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 + 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8484,42 +8420,22 @@ function _updateConfiguration(resourceGroupName, name, siteConfig, options, call } 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 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 the ZIP archived docker log files for the given site * - * 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 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 {string} name Name of web app. * * @param {object} [options] Optional Parameters. * @@ -8533,14 +8449,12 @@ 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. * * {object} [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 _getContainerLogsZip(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -8550,6 +8464,7 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8575,9 +8490,6 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, 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.'); } @@ -8587,19 +8499,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}/containerlogs/zip/download'; 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)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -8619,28 +8531,29 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba } 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8650,43 +8563,22 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba } 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['SiteConfigurationSnapshotInfoCollection']().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 Gets a snapshot of the configuration of an app at a previous point - * in time. + * @summary List continuous web jobs for an app, or a deployment slot. * - * Gets a snapshot of the configuration of an app at a previous point in time. + * 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 Name of the app. - * - * @param {string} snapshotId The ID of the snapshot to read. + * @param {string} name Site name. * * @param {object} [options] Optional Parameters. * @@ -8700,13 +8592,14 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, 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 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 _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, callback) { +function _listContinuousWebJobs(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -8716,6 +8609,7 @@ function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8738,15 +8632,9 @@ 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.'); } @@ -8756,13 +8644,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}/continuouswebjobs'; 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -8830,7 +8717,7 @@ function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, 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) { @@ -8846,16 +8733,17 @@ function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, } /** - * @summary Reverts the configuration of an app to a previous snapshot. + * @summary Gets a continuous web job by its ID for an app, or a deployment + * slot. * - * Reverts the configuration of an app to a previous 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} snapshotId The ID of the snapshot to read. + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -8868,13 +8756,14 @@ function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, 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 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 _recoverSiteConfigurationSnapshot(resourceGroupName, name, snapshotId, options, callback) { +function _getContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -8884,6 +8773,7 @@ function _recoverSiteConfigurationSnapshot(resourceGroupName, name, snapshotId, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8906,15 +8796,12 @@ function _recoverSiteConfigurationSnapshot(resourceGroupName, name, snapshotId, if (name === 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -8924,20 +8811,20 @@ function _recoverSiteConfigurationSnapshot(resourceGroupName, name, snapshotId, // 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'; + 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('{snapshotId}', encodeURIComponent(snapshotId)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -8962,7 +8849,7 @@ function _recoverSiteConfigurationSnapshot(resourceGroupName, name, snapshotId, 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); @@ -8990,20 +8877,40 @@ function _recoverSiteConfigurationSnapshot(resourceGroupName, name, snapshotId, // 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['ContinuousWebJob']().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 last lines of docker logs for the given site + * @summary Delete a continuous web job by its ID for an app, or a deployment + * slot. * - * Gets the last lines of docker logs for the given site + * 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 web app. + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -9016,13 +8923,13 @@ function _recoverSiteConfigurationSnapshot(resourceGroupName, name, snapshotId, * * {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 _getWebSiteContainerLogs(resourceGroupName, name, options, callback) { +function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9032,6 +8939,7 @@ function _getWebSiteContainerLogs(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9054,12 +8962,12 @@ 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 (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.'); } @@ -9069,19 +8977,20 @@ 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}/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(this.client.apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -9101,22 +9010,20 @@ function _getWebSiteContainerLogs(resourceGroupName, name, 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 !== 204) { - 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; @@ -9133,22 +9040,25 @@ function _getWebSiteContainerLogs(resourceGroupName, name, options, callback) { } 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 Start a continuous web job for an app, or a deployment slot. * - * Gets the ZIP archived docker log files for the given site + * 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 web app. + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -9161,13 +9071,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. + * {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 _getContainerLogsZip(resourceGroupName, name, options, callback) { +function _startContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9177,6 +9087,7 @@ function _getContainerLogsZip(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9199,11 +9110,159 @@ function _getContainerLogsZip(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.'); + } + } 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}/continuouswebjobs/{webJobName}/start'; + 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)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 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 Stop a continuous web job 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 Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _stopContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-02-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 (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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -9214,12 +9273,13 @@ function _getContainerLogsZip(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}/continuouswebjobs/{webJobName}/stop'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -9246,22 +9306,20 @@ function _getContainerLogsZip(resourceGroupName, name, 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 !== 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; @@ -9278,22 +9336,23 @@ function _getContainerLogsZip(resourceGroupName, name, options, callback) { } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + return callback(null, result, httpRequest, response); }); } /** - * @summary List continuous web jobs for an app, or a deployment slot. + * @summary List deployments for an app, or a deployment slot. * - * List continuous web jobs 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 Site name. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -9307,14 +9366,13 @@ function _getContainerLogsZip(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 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 _listContinuousWebJobs(resourceGroupName, name, options, callback) { +function _listDeployments(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9324,6 +9382,7 @@ function _listContinuousWebJobs(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9349,9 +9408,6 @@ 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.'); } @@ -9361,12 +9417,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}/deployments'; 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)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -9434,7 +9490,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['DeploymentCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -9450,17 +9506,16 @@ function _listContinuousWebJobs(resourceGroupName, name, options, callback) { } /** - * @summary Gets a continuous web job by its ID for an app, or a deployment - * slot. + * @summary Get a deployment by its ID for an app, or a deployment slot. * - * Gets 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. * * @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 {object} [options] Optional Parameters. * @@ -9474,13 +9529,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 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 _getContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { +function _getDeployment(resourceGroupName, name, id, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9490,6 +9545,7 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9512,15 +9568,12 @@ 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 (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.'); } @@ -9530,13 +9583,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}/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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -9568,7 +9621,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); @@ -9578,12 +9631,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) { @@ -9603,7 +9657,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['Deployment']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -9619,17 +9673,39 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call } /** - * @summary Delete 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. * - * Delete 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 {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. * @@ -9642,13 +9718,14 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, 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 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 _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { +function _createDeployment(resourceGroupName, name, id, deployment, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9658,6 +9735,7 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, c if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9680,15 +9758,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 (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.'); } @@ -9698,20 +9776,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}/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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -9729,14 +9807,28 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, c } } } - 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 !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -9746,12 +9838,13 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, 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) { @@ -9764,22 +9857,39 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, 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['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 Start a continuous web job for an app, or a deployment slot. + * @summary Delete a deployment by its ID for an app, or a deployment slot. * - * Start a continuous web job 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 {object} [options] Optional Parameters. * @@ -9798,7 +9908,7 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, c * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _startContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { +function _deleteDeployment(resourceGroupName, name, id, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9808,6 +9918,7 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9830,15 +9941,12 @@ 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 (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.'); } @@ -9848,20 +9956,20 @@ 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}/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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -9886,7 +9994,7 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, options, ca 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); @@ -9920,16 +10028,20 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, options, ca } /** - * @summary Stop 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. * - * Stop 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 {object} [options] Optional Parameters. * @@ -9942,13 +10054,14 @@ 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 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 _stopContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { +function _listDeploymentLog(resourceGroupName, name, id, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9958,6 +10071,7 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, options, cal if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9980,15 +10094,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 (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.'); } @@ -9998,20 +10109,20 @@ 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}/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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -10036,7 +10147,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); @@ -10046,12 +10157,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) { @@ -10064,21 +10176,82 @@ 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['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 List deployments 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. * - * List deployments 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 {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 @@ -10091,13 +10264,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 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 _listDeployments(resourceGroupName, name, options, callback) { +function _discoverBackup(resourceGroupName, name, request, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10107,6 +10280,7 @@ function _listDeployments(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10129,12 +10303,12 @@ 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 (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.'); } @@ -10144,19 +10318,19 @@ 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}/discoverbackup'; 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)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -10174,7 +10348,21 @@ function _listDeployments(resourceGroupName, name, options, callback) { } } } - 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) { @@ -10217,7 +10405,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['RestoreRequest']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10233,17 +10421,15 @@ function _listDeployments(resourceGroupName, name, options, callback) { } /** - * @summary Get a deployment by its ID for an app, or a deployment slot. + * @summary Lists ownership identifiers for domain associated with web app. * - * Get a deployment by its ID 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. * * @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 @@ -10256,13 +10442,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. + * 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 _getDeployment(resourceGroupName, name, id, options, callback) { +function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10272,6 +10458,7 @@ function _getDeployment(resourceGroupName, name, id, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10294,15 +10481,9 @@ 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -10312,13 +10493,12 @@ 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}/domainOwnershipIdentifiers'; 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -10386,7 +10566,7 @@ function _getDeployment(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['IdentifierCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10402,39 +10582,195 @@ function _getDeployment(resourceGroupName, name, id, options, callback) { } /** - * @summary Create a deployment for an app, or a deployment slot. + * @summary Get domain ownership identifier for web app. * - * Create a deployment 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 ID of an existing deployment. + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. * - * @param {object} deployment Deployment details. + * @param {object} [options] Optional Parameters. * - * @param {number} [deployment.status] Deployment status. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [deployment.message] Details about deployment status. + * @param {function} callback - The callback. * - * @param {string} [deployment.author] Who authored the deployment. + * @returns {function} callback(err, result, request, response) * - * @param {string} [deployment.deployer] Who performed the deployment. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} [deployment.authorEmail] Author email. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Identifier} for more information. * - * @param {date} [deployment.startTime] Start time. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {date} [deployment.endTime] End time. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +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.'); + } + let apiVersion = '2018-02-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 (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.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}/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)); + 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['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 Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. * - * @param {boolean} [deployment.active] True if deployment is currently active, - * false if completed and null if not started. + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. * - * @param {string} [deployment.details] Details on deployment. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} [deployment.kind] Kind of resource. + * @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. * @@ -10448,13 +10784,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. + * 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 _createDeployment(resourceGroupName, name, id, deployment, options, callback) { +function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10464,6 +10800,7 @@ function _createDeployment(resourceGroupName, name, id, deployment, options, cal if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10486,18 +10823,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 (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 (deployment === null || deployment === undefined) { - throw new Error('deployment cannot be null or undefined.'); + 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.'); } @@ -10507,13 +10841,13 @@ 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}/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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -10542,14 +10876,14 @@ function _createDeployment(resourceGroupName, name, id, deployment, options, cal 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; @@ -10595,7 +10929,7 @@ function _createDeployment(resourceGroupName, name, id, deployment, options, cal 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) { @@ -10611,16 +10945,17 @@ function _createDeployment(resourceGroupName, name, id, deployment, options, cal } /** - * @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 {object} [options] Optional Parameters. * @@ -10639,7 +10974,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 _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10649,6 +10984,7 @@ function _deleteDeployment(resourceGroupName, name, id, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10671,15 +11007,12 @@ 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 (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.'); } @@ -10689,13 +11022,13 @@ 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}/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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -10761,20 +11094,27 @@ function _deleteDeployment(resourceGroupName, name, id, options, callback) { } /** - * @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 {object} [options] Optional Parameters. * @@ -10788,13 +11128,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 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 _listDeploymentLog(resourceGroupName, name, id, options, callback) { +function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10804,6 +11144,7 @@ function _listDeploymentLog(resourceGroupName, name, id, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10826,15 +11167,15 @@ 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 (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.'); } @@ -10844,20 +11185,20 @@ 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}/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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -10875,7 +11216,21 @@ function _listDeploymentLog(resourceGroupName, name, id, 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) { @@ -10918,7 +11273,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['Identifier']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10934,58 +11289,14 @@ function _listDeploymentLog(resourceGroupName, name, id, options, callback) { } /** - * @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. + * @summary Get the status of the last MSDeploy operation. * - * 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. + * 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 {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} name Name of web app. * * @param {object} [options] Optional Parameters. * @@ -10999,13 +11310,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 RestoreRequest} 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 _discoverBackup(resourceGroupName, name, request, options, callback) { +function _getMSDeployStatus(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11015,6 +11326,7 @@ function _discoverBackup(resourceGroupName, name, request, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11037,15 +11349,9 @@ function _discoverBackup(resourceGroupName, name, request, 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -11055,19 +11361,19 @@ function _discoverBackup(resourceGroupName, name, request, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup'; + 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(this.client.apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -11085,21 +11391,7 @@ function _discoverBackup(resourceGroupName, name, request, options, callback) { } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -11142,7 +11434,7 @@ function _discoverBackup(resourceGroupName, name, request, options, callback) { 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['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11157,15 +11449,44 @@ function _discoverBackup(resourceGroupName, name, request, options, callback) { }); } + /** - * @summary Lists ownership identifiers for domain associated with web app. + * @summary Invoke the MSDeploy web app extension. * - * Lists ownership identifiers for domain associated with 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 {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. * @@ -11179,13 +11500,93 @@ function _discoverBackup(resourceGroupName, name, request, 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 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 _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callback) { +function _createMSDeployOperation(resourceGroupName, name, 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.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; + + 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 {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 _getMSDeployLog(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11195,6 +11596,7 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callb if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11220,9 +11622,6 @@ function _listDomainOwnershipIdentifiers(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.'); } @@ -11232,12 +11631,12 @@ 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}/extensions/MSDeploy/log'; 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)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -11269,7 +11668,7 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, 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); @@ -11279,13 +11678,12 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -11305,7 +11703,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['MSDeployLog']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11321,17 +11719,14 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callb } /** - * @summary Get domain ownership identifier for web app. + * @summary List the functions for a web site, or a deployment slot. * - * Get domain ownership identifier for web app. + * 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 {string} name Site name. * * @param {object} [options] Optional Parameters. * @@ -11345,13 +11740,14 @@ 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 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 _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, options, callback) { +function _listFunctions(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11361,6 +11757,7 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11383,15 +11780,9 @@ 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -11401,13 +11792,12 @@ 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}/functions'; 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)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -11439,7 +11829,7 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI 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); @@ -11449,13 +11839,12 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -11475,7 +11864,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['FunctionEnvelopeCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11491,27 +11880,14 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI } /** - * @summary Creates a domain ownership identifier for web app, or updates an - * existing ownership identifier. + * @summary 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. + * 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 {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 Name of web app. * * @param {object} [options] Optional Parameters. * @@ -11524,14 +11900,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. + * {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 _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, callback) { +function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11541,6 +11916,7 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11563,18 +11939,9 @@ 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -11584,20 +11951,19 @@ 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}/functions/admin/token'; 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)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -11615,21 +11981,7 @@ 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) { @@ -11672,7 +12024,13 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Identifier']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11688,17 +12046,17 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai } /** - * @summary Deletes a domain ownership identifier for a web app. + * @summary Get function information by its ID for web site, or a deployment + * slot. * - * Deletes a domain ownership identifier for a web app. + * 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} domainOwnershipIdentifierName Name of domain ownership - * identifier. + * @param {string} functionName Function name. * * @param {object} [options] Optional Parameters. * @@ -11711,13 +12069,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 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 _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, options, callback) { +function _getFunction(resourceGroupName, name, functionName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11727,6 +12086,7 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11749,15 +12109,12 @@ 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 (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.'); } @@ -11767,20 +12124,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}/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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -11805,7 +12162,7 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh 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); @@ -11833,33 +12190,63 @@ 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['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 Creates a domain ownership identifier for web app, or updates an - * existing ownership identifier. + * @summary Create function for web site, or a deployment slot. * - * Creates a domain ownership identifier for web app, or updates an existing - * ownership identifier. + * 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} domainOwnershipIdentifierName Name of domain ownership - * identifier. + * @param {string} functionName Function name. * - * @param {object} domainOwnershipIdentifier A JSON representation of the - * domain ownership properties. + * @param {object} functionEnvelope Function details. * - * @param {string} [domainOwnershipIdentifier.identifierId] String - * representation of the identity. + * @param {string} [functionEnvelope.functionAppId] Function App ID. * - * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * @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. * @@ -11873,13 +12260,94 @@ 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 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 _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, 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') { @@ -11889,6 +12357,7 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11911,18 +12380,12 @@ 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 (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.'); } @@ -11932,20 +12395,20 @@ 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}/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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -11963,28 +12426,14 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh } } } - // 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 !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -11994,13 +12443,12 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -12013,37 +12461,23 @@ function _updateDomainOwnershipIdentifier(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['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 Get the status of the last MSDeploy operation. + * @summary Get function secrets for a function in a web site, or a deployment + * slot. * - * Get the status of the last MSDeploy operation. + * 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} name Site name. + * + * @param {string} functionName Function name. * * @param {object} [options] Optional Parameters. * @@ -12057,13 +12491,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 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 _getMSDeployStatus(resourceGroupName, name, options, callback) { +function _listFunctionSecrets(resourceGroupName, name, functionName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -12073,6 +12507,7 @@ function _getMSDeployStatus(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12095,12 +12530,12 @@ function _getMSDeployStatus(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 (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.'); } @@ -12110,19 +12545,20 @@ 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}/functions/{functionName}/listsecrets'; 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(this.client.apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -12183,7 +12619,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['FunctionSecrets']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12198,124 +12634,15 @@ function _getMSDeployStatus(resourceGroupName, name, options, callback) { }); } - -/** - * @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 {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 _createMSDeployOperation(resourceGroupName, name, 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.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; - - 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 Get hostname bindings for an app or a deployment slot. * - * Get the MSDeploy Log for the last MSDeploy operation. + * 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 Name of web app. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -12329,13 +12656,14 @@ 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 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 _getMSDeployLog(resourceGroupName, name, options, callback) { +function _listHostNameBindings(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -12345,6 +12673,7 @@ function _getMSDeployLog(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12370,9 +12699,6 @@ function _getMSDeployLog(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.'); } @@ -12382,12 +12708,12 @@ 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}/hostNameBindings'; 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)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -12419,7 +12745,7 @@ function _getMSDeployLog(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -12429,12 +12755,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) { @@ -12454,7 +12781,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['HostNameBindingCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12470,14 +12797,18 @@ function _getMSDeployLog(resourceGroupName, name, options, callback) { } /** - * @summary List the functions for a web site, or a deployment slot. + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). * - * List the functions for a web site, or a deployment slot. + * 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 Site name. + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. * * @param {object} [options] Optional Parameters. * @@ -12491,14 +12822,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. + * 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 _listFunctions(resourceGroupName, name, options, callback) { +function _getHostNameBinding(resourceGroupName, name, hostName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -12508,6 +12838,7 @@ function _listFunctions(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12530,12 +12861,12 @@ 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 (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.'); } @@ -12545,12 +12876,13 @@ 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}/hostNameBindings/{hostName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -12582,7 +12914,7 @@ function _listFunctions(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -12592,12 +12924,13 @@ function _listFunctions(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) { @@ -12617,7 +12950,7 @@ function _listFunctions(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); + let resultMapper = new client.models['HostNameBinding']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12633,14 +12966,42 @@ function _listFunctions(resourceGroupName, name, options, callback) { } /** - * @summary Fetch a short lived token that can be exchanged for a master key. + * @summary Creates a hostname binding for an app. * - * Fetch a short lived token that can be exchanged for a master key. + * 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 web app. + * @param {string} name Name of the app. + * + * @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 {object} [options] Optional Parameters. * @@ -12653,13 +13014,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 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 _getFunctionsAdminToken(resourceGroupName, name, options, callback) { +function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -12669,6 +13031,7 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12691,12 +13054,15 @@ 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 (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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -12706,19 +13072,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}/hostNameBindings/{hostName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -12736,7 +13103,21 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { } } } - 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) { @@ -12779,13 +13160,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['HostNameBinding']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12801,17 +13176,16 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { } /** - * @summary Get function information by its ID for web site, or a deployment - * slot. + * @summary Deletes a hostname binding for an app. * - * Get function information by its ID 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} name Name of the app. * - * @param {string} functionName Function name. + * @param {string} hostName Hostname in the hostname binding. * * @param {object} [options] Optional Parameters. * @@ -12824,14 +13198,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. + * {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 _getFunction(resourceGroupName, name, functionName, options, callback) { +function _deleteHostNameBinding(resourceGroupName, name, hostName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -12841,6 +13214,7 @@ function _getFunction(resourceGroupName, name, functionName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12863,15 +13237,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 (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.'); } @@ -12881,20 +13252,20 @@ 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}/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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -12919,7 +13290,7 @@ function _getFunction(resourceGroupName, name, functionName, 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); @@ -12947,63 +13318,25 @@ function _getFunction(resourceGroupName, name, functionName, 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['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 Create function for web site, or a deployment slot. + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. * - * Create function for 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} functionName Function name. - * - * @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} name The name of the web app. * - * @param {string} [functionEnvelope.testData] Test data used when testing via - * the Azure Portal. + * @param {string} namespaceName The namespace for this hybrid connection. * - * @param {string} [functionEnvelope.kind] Kind of resource. + * @param {string} relayName The relay name for this hybrid connection. * * @param {object} [options] Optional Parameters. * @@ -13017,94 +13350,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. - * - * {object} [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) { - /* 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. + * 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 _deleteFunction(resourceGroupName, name, functionName, options, callback) { +function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13114,6 +13366,7 @@ function _deleteFunction(resourceGroupName, name, functionName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -13136,15 +13389,15 @@ 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 (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.'); } @@ -13154,20 +13407,21 @@ 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}/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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -13192,7 +13446,7 @@ function _deleteFunction(resourceGroupName, name, functionName, options, callbac 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); @@ -13202,12 +13456,13 @@ function _deleteFunction(resourceGroupName, name, functionName, 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) { @@ -13220,23 +13475,69 @@ 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['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 Get function secrets for a function in a web site, or a deployment - * slot. + * @summary Creates a new Hybrid Connection using a Service Bus relay. * - * Get function secrets for a function in a web site, 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 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} 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. * @@ -13250,13 +13551,13 @@ 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 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 _listFunctionSecrets(resourceGroupName, name, functionName, options, callback) { +function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13266,6 +13567,7 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -13288,15 +13590,18 @@ 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 (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.'); } @@ -13306,20 +13611,21 @@ 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}/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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13337,7 +13643,21 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, options, ca } } } - 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) { @@ -13380,7 +13700,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['HybridConnection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -13396,14 +13716,18 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, options, ca } /** - * @summary Get hostname bindings for an app or a deployment slot. + * @summary Removes a Hybrid Connection from this site. * - * Get hostname bindings for an app or a deployment slot. + * 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. * @@ -13416,15 +13740,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. + * {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 _listHostNameBindings(resourceGroupName, name, options, callback) { +function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13434,6 +13756,7 @@ function _listHostNameBindings(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -13456,12 +13779,15 @@ function _listHostNameBindings(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.'); } @@ -13471,19 +13797,21 @@ 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}/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(this.client.apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13508,7 +13836,7 @@ function _listHostNameBindings(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); @@ -13518,13 +13846,12 @@ function _listHostNameBindings(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -13537,41 +13864,52 @@ function _listHostNameBindings(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['HostNameBindingCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Get the named hostname binding for an app (or deployment slot, if - * specified). + * @summary Creates a new Hybrid Connection using a Service Bus relay. * - * Get the named hostname binding for an app (or deployment slot, if - * specified). + * 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 {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. * @@ -13585,13 +13923,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 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 _getHostNameBinding(resourceGroupName, name, hostName, options, callback) { +function _updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13601,6 +13939,7 @@ function _getHostNameBinding(resourceGroupName, name, hostName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -13623,15 +13962,18 @@ 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 (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.'); } @@ -13641,20 +13983,21 @@ 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}/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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13672,7 +14015,21 @@ function _getHostNameBinding(resourceGroupName, name, hostName, options, callbac } } } - 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) { @@ -13715,7 +14072,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['HybridConnection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -13731,42 +14088,18 @@ function _getHostNameBinding(resourceGroupName, name, hostName, options, callbac } /** - * @summary Creates a hostname binding for an app. + * @summary Gets the send key name and value for a Hybrid Connection. * - * Creates 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} 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} name The name of the web app. * - * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * @param {string} namespaceName The namespace for this hybrid connection. * - * @param {string} [hostNameBinding.kind] Kind of resource. + * @param {string} relayName The relay name for this hybrid connection. * * @param {object} [options] Optional Parameters. * @@ -13780,13 +14113,13 @@ 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 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 _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, callback) { +function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13796,6 +14129,7 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -13818,18 +14152,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 (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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -13839,20 +14170,21 @@ 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}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'; 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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13870,21 +14202,7 @@ 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) { @@ -13927,7 +14245,7 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN 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['HybridConnectionKey']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -13943,16 +14261,14 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN } /** - * @summary Deletes a hostname binding for an app. + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. * - * Deletes a hostname binding for an 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 Name of the app. - * - * @param {string} hostName Hostname in the hostname binding. + * @param {string} name The name of the web app. * * @param {object} [options] Optional Parameters. * @@ -13965,13 +14281,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 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 _deleteHostNameBinding(resourceGroupName, name, hostName, options, callback) { +function _listHybridConnections(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13981,6 +14298,7 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14003,15 +14321,9 @@ 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -14021,20 +14333,19 @@ 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}/hybridConnectionRelays'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -14059,7 +14370,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); @@ -14069,12 +14380,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) { @@ -14087,25 +14399,39 @@ 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['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 Retrieves a specific Service Bus Hybrid Connection used by this Web - * App. + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). * - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * 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 {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -14119,13 +14445,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 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 _getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { +function _listRelayServiceConnections(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14135,6 +14462,7 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14157,18 +14485,9 @@ 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.'); } @@ -14178,14 +14497,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}/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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -14253,7 +14570,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['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -14269,44 +14586,203 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, } /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. + * @summary Gets a hybrid connection configuration by its name. * - * Creates a new Hybrid Connection using a Service Bus relay. + * 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} name Name of the app. * - * @param {string} namespaceName The namespace for this hybrid connection. + * @param {string} entityName Name of the hybrid connection. * - * @param {string} relayName The relay name for this hybrid connection. + * @param {object} [options] Optional Parameters. * - * @param {object} connectionEnvelope The details of the hybrid connection. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. + * @param {function} callback - The callback. * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. + * @returns {function} callback(err, result, request, response) * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. * - * @param {number} [connectionEnvelope.port] The port of the endpoint. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getRelayServiceConnection(resourceGroupName, name, entityName, 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 = '2018-02-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 (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.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}/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)); + 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['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 configuration (PUT), or updates an + * existing one (PATCH). * - * @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. + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net + * @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. * @@ -14322,13 +14798,14 @@ 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 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 _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, callback) { +function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14338,6 +14815,7 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14360,11 +14838,8 @@ 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 (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.'); @@ -14372,9 +14847,6 @@ function _createOrUpdateHybridConnection(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.'); } @@ -14384,14 +14856,13 @@ 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}/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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -14421,7 +14892,7 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, 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); } @@ -14473,7 +14944,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['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -14489,18 +14960,16 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, } /** - * @summary Removes a Hybrid Connection from this site. + * @summary Deletes a relay service connection by its name. * - * Removes a Hybrid Connection from this site. + * 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 {object} [options] Optional Parameters. * @@ -14519,7 +14988,7 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { +function _deleteRelayServiceConnection(resourceGroupName, name, entityName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14529,6 +14998,7 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14551,18 +15021,12 @@ 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 (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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -14572,14 +15036,13 @@ 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}/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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -14645,44 +15108,35 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa } /** - * @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. * @@ -14698,13 +15152,14 @@ 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. + * 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 _updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, callback) { +function _updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14714,6 +15169,7 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14736,11 +15192,8 @@ 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 (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.'); @@ -14748,9 +15201,6 @@ function _updateHybridConnection(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.'); } @@ -14760,14 +15210,13 @@ 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}/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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -14797,7 +15246,7 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa 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); } @@ -14849,7 +15298,7 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa 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) { @@ -14865,18 +15314,14 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa } /** - * @summary Gets the send key name and value for a Hybrid Connection. + * @summary Gets all scale-out instances of an app. * - * Gets the send key name and value for a Hybrid Connection. + * Gets all scale-out instances 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} 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. * @@ -14890,13 +15335,14 @@ 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 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 _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, callback) { +function _listInstanceIdentifiers(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14906,6 +15352,7 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14928,18 +15375,9 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay if (name === 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.'); } @@ -14949,21 +15387,19 @@ 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}/instances'; 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(this.client.apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -15024,7 +15460,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['WebAppInstanceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -15040,14 +15476,16 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay } /** - * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * @summary Get the status of the last MSDeploy operation. * - * Retrieves all Service Bus Hybrid Connections used by this 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 The name of the web app. + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. * * @param {object} [options] Optional Parameters. * @@ -15061,13 +15499,13 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay * {Error} 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 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 _listHybridConnections(resourceGroupName, name, options, callback) { +function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15077,6 +15515,7 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15099,12 +15538,12 @@ 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 (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.'); } @@ -15114,12 +15553,13 @@ 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}/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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -15187,7 +15627,7 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { 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['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -15202,17 +15642,46 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { }); } + /** - * @summary Gets hybrid connections configured for an app (or deployment slot, - * if specified). + * @summary Invoke the MSDeploy web app extension. * - * Gets hybrid connections configured for an app (or deployment slot, if - * specified). + * 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. * @@ -15226,14 +15695,95 @@ 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. + * 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 _listRelayServiceConnections(resourceGroupName, name, 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') { @@ -15243,6 +15793,7 @@ function _listRelayServiceConnections(resourceGroupName, name, options, callback if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15265,12 +15816,12 @@ 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 (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.'); } @@ -15280,12 +15831,13 @@ 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}/instances/{instanceId}/extensions/MSDeploy/log'; 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -15317,7 +15869,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); @@ -15327,13 +15879,12 @@ function _listRelayServiceConnections(resourceGroupName, name, options, callback try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -15353,7 +15904,7 @@ function _listRelayServiceConnections(resourceGroupName, name, options, callback 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) { @@ -15369,16 +15920,20 @@ function _listRelayServiceConnections(resourceGroupName, name, options, callback } /** - * @summary Gets a hybrid connection configuration 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. * - * Gets a hybrid connection configuration 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} name Site name. * - * @param {string} entityName Name of the hybrid connection. + * @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. * @@ -15392,14 +15947,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 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 _getRelayServiceConnection(resourceGroupName, name, entityName, options, callback) { +function _listInstanceProcesses(resourceGroupName, name, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15409,6 +15963,7 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15431,15 +15986,12 @@ 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 (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.'); } @@ -15449,13 +16001,13 @@ 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}/instances/{instanceId}/processes'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -15487,7 +16039,7 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options 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); @@ -15497,13 +16049,12 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -15523,7 +16074,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['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -15539,37 +16090,22 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options } /** - * @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} name Site name. * - * @param {string} [connectionEnvelope.biztalkUri] + * @param {string} processId PID. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @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. * @@ -15583,14 +16119,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 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 _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, callback) { +function _getInstanceProcess(resourceGroupName, name, processId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15600,6 +16135,7 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15622,18 +16158,15 @@ 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 (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 (connectionEnvelope === null || connectionEnvelope === undefined) { - throw new Error('connectionEnvelope cannot be null or undefined.'); + 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.'); } @@ -15643,20 +16176,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}/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('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -15674,28 +16208,14 @@ 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) { 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); @@ -15705,13 +16225,12 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -15731,7 +16250,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['ProcessInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -15747,16 +16266,22 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa } /** - * @summary Deletes a relay service connection by its name. + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. * - * Deletes a relay service connection by its name. + * 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} entityName Name of the hybrid connection configuration. + * @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. * @@ -15775,7 +16300,7 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteRelayServiceConnection(resourceGroupName, name, entityName, options, callback) { +function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15785,6 +16310,7 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15807,15 +16333,15 @@ 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 (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.'); } @@ -15825,13 +16351,14 @@ 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}/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('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -15863,7 +16390,7 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, opti 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); @@ -15897,37 +16424,22 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, opti } /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). + * @summary Get a memory dump of a process 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 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} 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 Site name. * - * @param {string} [connectionEnvelope.biztalkUri] + * @param {string} processId PID. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @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. * @@ -15941,14 +16453,12 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, 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 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 _updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, callback) { +function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15958,6 +16468,7 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15980,18 +16491,15 @@ 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 (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 (connectionEnvelope === null || connectionEnvelope === undefined) { - throw new Error('connectionEnvelope cannot be null or undefined.'); + 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.'); } @@ -16001,20 +16509,21 @@ 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}/instances/{instanceId}/processes/{processId}/dump'; 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('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -16032,44 +16541,31 @@ 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 + 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -16079,40 +16575,30 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn } 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['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); - } - } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } /** - * @summary Gets all scale-out instances of an app. + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * Gets all scale-out instances of an app. + * 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. * @@ -16126,14 +16612,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 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 _listInstanceIdentifiers(resourceGroupName, name, options, callback) { +function _listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -16143,6 +16629,7 @@ function _listInstanceIdentifiers(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16165,12 +16652,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 (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.'); } @@ -16180,12 +16670,14 @@ 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}/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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -16217,7 +16709,7 @@ function _listInstanceIdentifiers(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); @@ -16227,13 +16719,12 @@ function _listInstanceIdentifiers(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -16253,7 +16744,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['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -16269,16 +16760,24 @@ function _listInstanceIdentifiers(resourceGroupName, name, options, callback) { } /** - * @summary Get the status of the last MSDeploy operation. + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. * - * Get the status of the last MSDeploy operation. + * 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 web app. + * @param {string} name Site name. * - * @param {string} instanceId ID of web app instance. + * @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. * @@ -16292,13 +16791,13 @@ 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 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 _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, callback) { +function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -16308,6 +16807,7 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16330,15 +16830,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 (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.'); } @@ -16348,13 +16851,15 @@ 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}/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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -16386,7 +16891,7 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options 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); @@ -16396,13 +16901,12 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -16422,7 +16926,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['ProcessModuleInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -16437,128 +16941,23 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options }); } - /** - * @summary Invoke the MSDeploy web app extension. + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. * - * Invoke the MSDeploy web app extension. + * 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 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. - * - * 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} 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. * @@ -16572,13 +16971,14 @@ 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. + * 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 _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, callback) { +function _listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -16588,6 +16988,7 @@ function _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, c if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16610,15 +17011,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 (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.'); } @@ -16628,13 +17029,14 @@ 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}/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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -16701,7 +17103,7 @@ function _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, c 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['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -16717,17 +17119,21 @@ function _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, c } /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. - * - * Get list of processes for a web site, or a deployment slot, or for a + * @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. * * @param {string} name Site name. * + * @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". @@ -16744,13 +17150,13 @@ 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 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 _listInstanceProcesses(resourceGroupName, name, instanceId, options, callback) { +function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -16760,6 +17166,7 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16782,15 +17189,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 (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.'); } @@ -16800,13 +17210,15 @@ 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}/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 = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -16873,7 +17285,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['ProcessThreadInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -16889,22 +17301,16 @@ 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 Shows whether an app can be cloned to another resource group or + * subscription. * - * Get process information 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} 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. * @@ -16918,13 +17324,13 @@ 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 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 _getInstanceProcess(resourceGroupName, name, processId, instanceId, options, callback) { +function _isCloneable(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -16934,6 +17340,7 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16956,18 +17363,9 @@ 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.'); } @@ -16977,21 +17375,19 @@ 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}/iscloneable'; 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(this.client.apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -17016,7 +17412,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); @@ -17026,12 +17422,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) { @@ -17051,7 +17448,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['SiteCloneability']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -17067,22 +17464,14 @@ 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 This is to allow calling via powershell and ARM template. * - * Terminate a process by its ID for a web site, or a deployment slot, or - * specific scaled-out instance in a web site. + * 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 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. * @@ -17095,13 +17484,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 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 _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, callback) { +function _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -17111,6 +17501,7 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17133,18 +17524,9 @@ 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.'); } @@ -17154,21 +17536,19 @@ 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}/listsyncfunctiontriggerstatus'; 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -17193,7 +17573,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); @@ -17203,12 +17583,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) { @@ -17221,28 +17602,38 @@ 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['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 Get a memory dump of 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). * - * Get a memory dump of 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} 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. * @@ -17256,12 +17647,14 @@ 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 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 _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, callback) { +function _listMetricDefinitions(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -17271,6 +17664,7 @@ function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17293,18 +17687,9 @@ 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.'); } @@ -17314,14 +17699,12 @@ 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}/metricdefinitions'; 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -17348,29 +17731,28 @@ 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}`); + 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) { @@ -17380,32 +17762,51 @@ 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['ResourceMetricDefinitionCollection']().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 performance metrics 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 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} name Name of the app. * - * @param {string} processId PID. + * @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 {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. * - * @param {object} [options] Optional Parameters. + * @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 @@ -17417,14 +17818,14 @@ 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 + * 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 _listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, callback) { +function _listMetrics(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -17434,6 +17835,9 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17456,18 +17860,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 (details !== null && details !== undefined && typeof details !== 'boolean') { + throw new Error('details must be of type boolean.'); } - 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 (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.'); } @@ -17477,14 +17878,18 @@ 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}/metrics'; 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(this.client.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(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -17516,7 +17921,7 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc 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); @@ -17526,12 +17931,13 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -17551,7 +17957,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['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -17566,25 +17972,35 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc }); } + /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary Restores a web app. * - * Get process information by its ID for a specific scaled-out instance in a - * web 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 Site name. + * @param {string} name Name of web app. * - * @param {string} processId PID. + * @param {object} migrationOptions Migration migrationOptions. * - * @param {string} baseAddress Module base address. + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. * - * @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} 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. * @@ -17598,13 +18014,189 @@ 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 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 _getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, 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') { @@ -17614,6 +18206,7 @@ function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddre if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17636,21 +18229,9 @@ function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddre if (name === 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.'); } @@ -17660,15 +18241,12 @@ 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}/migratemysql/status'; 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -17700,7 +18278,7 @@ function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddre 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); @@ -17710,12 +18288,13 @@ function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddre try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -17735,7 +18314,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['MigrateMySqlStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -17751,22 +18330,14 @@ 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 Gets a Swift Virtual Network connection. * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * Gets a Swift Virtual Network connection. * * @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. * @@ -17780,14 +18351,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. + * 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 _listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, callback) { +function _getSwiftVirtualNetworkConnection(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -17797,6 +18367,7 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17819,18 +18390,9 @@ function _listInstanceProcessThreads(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.'); } @@ -17840,14 +18402,12 @@ 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}/networkConfig/virtualNetwork'; 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -17879,7 +18439,7 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc 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); @@ -17889,12 +18449,13 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -17914,7 +18475,7 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc 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['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -17930,24 +18491,32 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc } /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. + * @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. * - * Get thread information by Thread ID for a specific process, in a specific - * scaled-out instance in a web site. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} processId PID. + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. * - * @param {string} threadId TID. + * @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} 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 {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. * @@ -17961,13 +18530,13 @@ 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. + * 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 _getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, callback) { +function _createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -17977,6 +18546,7 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17999,21 +18569,12 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, if (name === 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 (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 (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.'); } @@ -18023,22 +18584,19 @@ 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}/networkConfig/virtualNetwork'; 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(this.client.apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -18056,14 +18614,28 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, } } } - 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) { 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); @@ -18073,12 +18645,13 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -18098,7 +18671,7 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, 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['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -18114,11 +18687,10 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, } /** - * @summary Shows whether an app can be cloned to another resource group or - * subscription. + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). * - * Shows whether an app can be cloned to another resource group or - * subscription. + * 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. @@ -18136,14 +18708,13 @@ 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. + * {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 _isCloneable(resourceGroupName, name, options, callback) { +function _deleteSwiftVirtualNetwork(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -18153,6 +18724,7 @@ function _isCloneable(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -18178,9 +18750,6 @@ function _isCloneable(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.'); } @@ -18190,19 +18759,19 @@ 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}/networkConfig/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(this.client.apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -18227,7 +18796,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); @@ -18237,13 +18806,12 @@ function _isCloneable(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -18256,38 +18824,39 @@ function _isCloneable(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['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. + * @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. * - * This is to allow calling via powershell and ARM template. + * 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 @@ -18300,13 +18869,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 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 _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { +function _updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -18316,6 +18885,7 @@ function _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -18338,12 +18908,12 @@ 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 (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.'); } @@ -18353,19 +18923,19 @@ 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}/networkConfig/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(this.client.apiVersion)); + 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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -18383,7 +18953,21 @@ function _listSyncFunctionTriggers(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['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) { @@ -18426,7 +19010,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['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -18442,16 +19026,20 @@ function _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { } /** - * @summary Gets all metric definitions of an app (or deployment slot, if + * @summary 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). + * 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 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 @@ -18464,14 +19052,13 @@ 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 - * 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 _listMetricDefinitions(resourceGroupName, name, options, callback) { +function _listNetworkFeatures(resourceGroupName, name, view, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -18481,6 +19068,7 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -18503,12 +19091,12 @@ 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 (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.'); } @@ -18518,12 +19106,13 @@ 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}/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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -18555,7 +19144,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); @@ -18565,13 +19154,12 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -18591,7 +19179,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['NetworkFeatures']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -18607,25 +19195,20 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { } /** - * @summary Gets performance metrics of an app (or deployment slot, if - * specified). + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). * - * Gets performance metrics of an app (or deployment slot, if specified). + * Gets a named operation for a network trace capturing (or deployment slot, if + * specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.details] Specify "true" to include metric details - * in the response. It is "false" by default. + * @param {string} operationId GUID of the operation. * - * @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] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -18636,15 +19219,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. + * {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 _listMetrics(resourceGroupName, name, options, callback) { +function _getNetworkTraceOperation(resourceGroupName, name, operationId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -18654,8 +19235,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -18678,18 +19258,12 @@ 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter must be of type string.'); + if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string') { + throw new Error('operationId cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -18699,18 +19273,13 @@ 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}/networkTrace/operationresults/{operationId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{operationId}', encodeURIComponent(operationId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - if (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)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -18742,7 +19311,7 @@ function _listMetrics(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -18778,7 +19347,21 @@ 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -18788,218 +19371,61 @@ function _listMetrics(resourceGroupName, name, options, callback) { return callback(deserializationError); } } - - return callback(null, result, httpRequest, response); - }); -} - - -/** - * @summary Restores a web app. - * - * 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} 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. - * - * @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 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 _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 + // 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['StorageMigrationResponse']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { - 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); + 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); - }); + return callback(null, result, httpRequest, response); }); } - /** - * @summary Migrates a local (in-app) MySql database to a remote MySql - * database. + * @summary Start capturing network packets for the site (To be deprecated). * - * Migrates a local (in-app) MySql database to a remote MySql database. + * Start capturing network packets for the site (To be deprecated). * * @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 {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} 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 {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. * - * @param {string} name Name of web app. + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). * - * @param {object} [options] Optional Parameters. + * @param {string} [options.sasUrl] The Blob URL to store capture file. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -19010,14 +19436,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. + * {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 _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { +function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -19027,6 +19452,10 @@ function _getMigrateMySqlStatus(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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19049,12 +19478,18 @@ function _getMigrateMySqlStatus(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 (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.'); } @@ -19064,19 +19499,28 @@ 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}/networkTrace/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(this.client.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(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 @@ -19137,7 +19581,13 @@ 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -19152,20 +19602,117 @@ function _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { }); } + /** - * @summary Gets all network features used by the app (or deployment slot, if - * specified). + * @summary Start capturing network packets for the site. * - * Gets all network features used by the app (or deployment slot, if - * specified). + * Start capturing network packets for the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name The name of the web app. * - * @param {string} view The type of view. This can either be "summary" or - * "detailed". + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _startWebSiteNetworkTraceOperation(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.beginStartWebSiteNetworkTraceOperation(resourceGroupName, name, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. * * @param {object} [options] Optional Parameters. * @@ -19178,14 +19725,13 @@ 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. + * {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 _listNetworkFeatures(resourceGroupName, name, view, options, callback) { +function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -19195,6 +19741,7 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19217,15 +19764,9 @@ 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.'); } @@ -19235,20 +19776,19 @@ 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}/networkTrace/stop'; 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(this.client.apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -19273,7 +19813,7 @@ function _listNetworkFeatures(resourceGroupName, name, view, 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); @@ -19301,23 +19841,6 @@ function _listNetworkFeatures(resourceGroupName, name, view, 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['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); }); @@ -19348,13 +19871,13 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getNetworkTraceOperation(resourceGroupName, name, operationId, options, callback) { +function _getNetworkTraces(resourceGroupName, name, operationId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -19364,6 +19887,7 @@ function _getNetworkTraceOperation(resourceGroupName, name, operationId, options if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19392,9 +19916,6 @@ function _getNetworkTraceOperation(resourceGroupName, name, operationId, 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.'); } @@ -19404,13 +19925,13 @@ function _getNetworkTraceOperation(resourceGroupName, name, operationId, options // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{operationId}', encodeURIComponent(operationId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -19442,7 +19963,7 @@ function _getNetworkTraceOperation(resourceGroupName, name, operationId, options 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); @@ -19502,47 +20023,26 @@ function _getNetworkTraceOperation(resourceGroupName, name, operationId, options 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['Operation']().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 Start capturing network packets for the site (To be deprecated). + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). * - * Start capturing network packets for the site (To be deprecated). + * Gets a named operation for a network trace capturing (or deployment slot, if + * specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name The name of the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.durationInSeconds] The duration to keep capturing - * in seconds. + * @param {string} name Name of the app. * - * @param {number} [options.maxFrameLength] The maximum frame length in bytes - * (Optional). + * @param {string} operationId GUID of the operation. * - * @param {string} [options.sasUrl] The Blob URL to store capture file. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -19553,13 +20053,13 @@ function _getNetworkTraceOperation(resourceGroupName, name, operationId, options * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [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 _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { +function _getNetworkTraceOperationV2(resourceGroupName, name, operationId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -19569,9 +20069,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19594,21 +20092,12 @@ 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 (sasUrl !== null && sasUrl !== undefined && typeof sasUrl.valueOf() !== 'string') { - throw new Error('sasUrl must be of type string.'); + if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string') { + throw new Error('operationId cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -19618,28 +20107,20 @@ 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}/networkTraces/current/operationresults/{operationId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{operationId}', encodeURIComponent(operationId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - if (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)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -19664,7 +20145,7 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -19704,7 +20185,15 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { required: false, serializedName: 'parsedResponse', type: { - name: 'String' + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } } }; result = client.deserialize(resultMapper, parsedResponse, 'result'); @@ -19716,79 +20205,8 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { return callback(deserializationError); } } - - return callback(null, result, httpRequest, response); - }); -} - - -/** - * @summary Start capturing network packets for the site. - * - * Start capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.durationInSeconds] The duration to keep capturing - * in seconds. - * - * @param {number} [options.maxFrameLength] The maximum frame length in bytes - * (Optional). - * - * @param {string} [options.sasUrl] The Blob URL to store capture file. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {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 _startWebSiteNetworkTraceOperation(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.beginStartWebSiteNetworkTraceOperation(resourceGroupName, name, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response + // Deserialize Response + if (statusCode === 202) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -19798,32 +20216,44 @@ function _startWebSiteNetworkTraceOperation(resourceGroupName, name, options, ca required: false, serializedName: 'parsedResponse', type: { - name: 'Object' + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } } }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } 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); + 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); - }); + return callback(null, result, httpRequest, response); }); } /** - * @summary Stop ongoing capturing network packets for the site. + * @summary Gets a named operation for a network trace capturing (or deployment + * slot, if specified). * - * Stop ongoing capturing network packets for the site. + * Gets a named operation for a network trace capturing (or deployment slot, if + * specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name The name of the web app. + * @param {string} name Name of the app. + * + * @param {string} operationId GUID of the operation. * * @param {object} [options] Optional Parameters. * @@ -19836,13 +20266,13 @@ function _startWebSiteNetworkTraceOperation(resourceGroupName, name, 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. + * {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 _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { +function _getNetworkTracesV2(resourceGroupName, name, operationId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -19852,6 +20282,7 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19874,12 +20305,12 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } + if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string') { + throw new Error('operationId cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -19889,19 +20320,20 @@ 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}/networkTraces/{operationId}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{operationId}', encodeURIComponent(operationId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -19926,7 +20358,7 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { 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); @@ -19936,12 +20368,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) { @@ -19954,16 +20387,47 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * @summary Gets a named operation for a network trace capturing (or deployment - * slot, if specified). + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). * - * Gets a named operation for a network trace capturing (or deployment slot, if + * Generates a new publishing password for an app (or deployment slot, if * specified). * * @param {string} resourceGroupName Name of the resource group to which the @@ -19971,8 +20435,6 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { * * @param {string} name Name of the app. * - * @param {string} operationId GUID of the operation. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -19984,13 +20446,13 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {array} [result] - The deserialized result object if an error did not occur. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getNetworkTraces(resourceGroupName, name, operationId, options, callback) { +function _generateNewSitePublishingPassword(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20000,6 +20462,7 @@ function _getNetworkTraces(resourceGroupName, name, operationId, options, callba if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20022,15 +20485,9 @@ function _getNetworkTraces(resourceGroupName, name, operationId, options, callba if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string') { - throw new Error('operationId cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -20040,20 +20497,19 @@ function _getNetworkTraces(resourceGroupName, name, operationId, options, callba // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}'; + 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('{operationId}', encodeURIComponent(operationId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -20078,7 +20534,7 @@ function _getNetworkTraces(resourceGroupName, name, operationId, options, callba 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); @@ -20088,13 +20544,12 @@ function _getNetworkTraces(resourceGroupName, name, operationId, options, callba try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -20107,58 +20562,28 @@ function _getNetworkTraces(resourceGroupName, name, operationId, options, callba // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NetworkTraceElementType', - type: { - name: 'Composite', - className: 'NetworkTrace' - } - } - } - }; - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Gets a named operation for a network trace capturing (or deployment - * slot, if specified). + * @summary Gets perfmon counters for web app. * - * Gets a named operation for a network trace capturing (or deployment slot, if - * specified). + * Gets perfmon counters for web app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {string} operationId GUID of the operation. + * @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 * @@ -20169,12 +20594,14 @@ function _getNetworkTraces(resourceGroupName, name, operationId, 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 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 _getNetworkTraceOperationV2(resourceGroupName, name, operationId, options, callback) { +function _listPerfMonCounters(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20184,6 +20611,8 @@ function _getNetworkTraceOperationV2(resourceGroupName, name, operationId, optio if (!callback) { throw new Error('callback cannot be null.'); } + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20206,15 +20635,12 @@ function _getNetworkTraceOperationV2(resourceGroupName, name, operationId, 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 (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string') { - throw new Error('operationId cannot be null or undefined and it must be of type string.'); + if (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.'); } @@ -20224,13 +20650,15 @@ function _getNetworkTraceOperationV2(resourceGroupName, name, operationId, optio // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}'; + 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('{operationId}', encodeURIComponent(operationId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -20262,7 +20690,7 @@ function _getNetworkTraceOperationV2(resourceGroupName, name, operationId, optio 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); @@ -20298,21 +20726,7 @@ function _getNetworkTraceOperationV2(resourceGroupName, name, operationId, optio parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NetworkTraceElementType', - type: { - name: 'Composite', - className: 'NetworkTrace' - } - } - } - }; + let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -20322,41 +20736,20 @@ function _getNetworkTraceOperationV2(resourceGroupName, name, operationId, optio 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['Operation']().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 Gets a named operation for a network trace capturing (or deployment - * slot, if specified). + * @summary Gets web app's event logs. * - * Gets a named operation for a network trace capturing (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} operationId GUID of the operation. + * @param {string} name Name of web app. * * @param {object} [options] Optional Parameters. * @@ -20369,13 +20762,14 @@ function _getNetworkTraceOperationV2(resourceGroupName, name, operationId, optio * * {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 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 _getNetworkTracesV2(resourceGroupName, name, operationId, options, callback) { +function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20385,6 +20779,7 @@ function _getNetworkTracesV2(resourceGroupName, name, operationId, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20407,15 +20802,9 @@ function _getNetworkTracesV2(resourceGroupName, name, operationId, 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 (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string') { - throw new Error('operationId cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -20425,13 +20814,12 @@ function _getNetworkTracesV2(resourceGroupName, name, operationId, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}'; + 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('{operationId}', encodeURIComponent(operationId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -20499,21 +20887,7 @@ function _getNetworkTracesV2(resourceGroupName, name, operationId, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NetworkTraceElementType', - type: { - name: 'Composite', - className: 'NetworkTrace' - } - } - } - }; + let resultMapper = new client.models['SitePhpErrorLogFlag']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -20529,11 +20903,9 @@ function _getNetworkTracesV2(resourceGroupName, name, operationId, options, call } /** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). + * @summary Gets the premier add-ons of an app. * - * Generates a new publishing password for an app (or deployment slot, if - * specified). + * Gets the premier add-ons of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -20551,13 +20923,14 @@ function _getNetworkTracesV2(resourceGroupName, name, operationId, 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 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 _generateNewSitePublishingPassword(resourceGroupName, name, options, callback) { +function _listPremierAddOns(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20567,6 +20940,7 @@ function _generateNewSitePublishingPassword(resourceGroupName, name, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20592,9 +20966,6 @@ function _generateNewSitePublishingPassword(resourceGroupName, name, 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.'); } @@ -20604,19 +20975,19 @@ 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}/premieraddons'; 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)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -20641,7 +21012,7 @@ function _generateNewSitePublishingPassword(resourceGroupName, name, 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); @@ -20651,12 +21022,13 @@ function _generateNewSitePublishingPassword(resourceGroupName, name, 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) { @@ -20669,27 +21041,41 @@ 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['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 a named add-on of an app. * - * Gets perfmon counters for web 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 web app. + * @param {string} name Name of the app. * - * @param {object} [options] Optional Parameters. + * @param {string} premierAddOnName Add-on name. * - * @param {string} [options.filter] Return only usages/metrics specified in the - * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq - * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq - * duration'[Hour|Minute|Day]'. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -20701,14 +21087,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. + * 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 _listPerfMonCounters(resourceGroupName, name, options, callback) { +function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20718,7 +21103,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20741,15 +21126,12 @@ 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 (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.'); } @@ -20759,15 +21141,13 @@ 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}/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 = []; - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + filter); - } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -20835,7 +21215,7 @@ 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 = new client.models['PremierAddOn']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -20851,177 +21231,37 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { } /** - * @summary Gets web app's event logs. + * @summary Updates a named add-on of an app. * - * Gets web app's event logs. + * 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 web app. - * - * @param {object} [options] Optional Parameters. + * @param {string} name Name of the app. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} premierAddOnName Add-on name. * - * @param {function} callback - The callback. + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. * - * @returns {function} callback(err, result, request, response) + * @param {string} [premierAddOn.sku] Premier add on SKU. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} [premierAddOn.product] Premier add on Product. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SitePhpErrorLogFlag} for more information. + * @param {string} [premierAddOn.vendor] Premier add on Vendor. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _getSitePhpErrorLogFlag(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}/phplogging'; - 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['SitePhpErrorLogFlag']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary Gets the premier add-ons of an app. + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. * - * Gets the premier add-ons of an app. + * @param {string} [premierAddOn.kind] Kind of resource. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {string} premierAddOn.location Resource Location. * - * @param {string} name Name of the app. + * @param {object} [premierAddOn.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -21041,7 +21281,7 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listPremierAddOns(resourceGroupName, name, options, callback) { +function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21051,6 +21291,7 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21073,12 +21314,15 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } + if (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.'); } @@ -21088,19 +21332,20 @@ 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}/premieraddons/{premierAddOnName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21118,7 +21363,21 @@ function _listPremierAddOns(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) { @@ -21177,9 +21436,9 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { } /** - * @summary Gets a named add-on of an app. + * @summary Delete a premier add-on from an app. * - * Gets a named add-on of an app. + * Delete a premier add-on from an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -21199,14 +21458,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. + * {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 _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, callback) { +function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21216,6 +21474,7 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21244,9 +21503,6 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, 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.'); } @@ -21262,14 +21518,14 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, ca requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21304,13 +21560,12 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, ca try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -21323,23 +21578,6 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, 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['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); }); @@ -21374,10 +21612,6 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, ca * * @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 @@ -21396,7 +21630,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 _updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21406,6 +21640,7 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21437,9 +21672,6 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -21455,14 +21687,14 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21485,7 +21717,7 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO let requestModel = null; try { if (premierAddOn !== null && premierAddOn !== undefined) { - let requestModelMapper = new client.models['PremierAddOn']().mapper(); + let requestModelMapper = new client.models['PremierAddOnPatchResource']().mapper(); requestModel = client.serialize(requestModelMapper, premierAddOn, 'premierAddOn'); requestContent = JSON.stringify(requestModel); } @@ -21553,16 +21785,16 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO } /** - * @summary Delete a premier add-on from an app. + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Delete a premier add-on from 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 {object} [options] Optional Parameters. * @@ -21575,13 +21807,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 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 _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, callback) { +function _getPrivateAccess(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21591,6 +21824,7 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21613,15 +21847,9 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, 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 (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.'); } @@ -21631,20 +21859,19 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, // 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}/privateAccess/virtualNetworks'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -21679,12 +21906,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) { @@ -21697,39 +21925,48 @@ 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['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 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} name The name of the web app. * - * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * @param {object} access The information for the private access * - * @param {string} [premierAddOn.marketplacePublisher] Premier add on - * Marketplace publisher. + * @param {boolean} [access.enabled] Whether private access is enabled or not. * - * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace - * offer. + * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. * - * @param {string} [premierAddOn.kind] Kind of resource. + * @param {string} [access.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -21743,13 +21980,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 PremierAddOn} 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 _updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, callback) { +function _putPrivateAccessVnet(resourceGroupName, name, access, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21759,6 +21996,7 @@ function _updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierA if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21781,18 +22019,12 @@ function _updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierA if (name === 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 (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.'); } @@ -21802,20 +22034,19 @@ function _updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierA // 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}/privateAccess/virtualNetworks'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -21837,14 +22068,14 @@ function _updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierA 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'); + 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(premierAddOn, null, 2)}.`); + `payload - ${JSON.stringify(access, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -21890,7 +22121,7 @@ function _updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierA 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['PrivateAccess']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -21906,16 +22137,16 @@ function _updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierA } /** - * @summary Gets data around private site access enablement and authorized - * Virtual Networks that can access the site. + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. * - * Gets data around private site access enablement and authorized Virtual - * Networks that can access the site. + * 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 The name of the web app. + * @param {string} name Site name. * * @param {object} [options] Optional Parameters. * @@ -21929,13 +22160,13 @@ function _updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierA * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PrivateAccess} for more information. + * 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 _getPrivateAccess(resourceGroupName, name, options, callback) { +function _listProcesses(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21945,6 +22176,7 @@ function _getPrivateAccess(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21970,9 +22202,6 @@ function _getPrivateAccess(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.'); } @@ -21982,12 +22211,12 @@ function _getPrivateAccess(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes'; 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)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -22019,7 +22248,7 @@ function _getPrivateAccess(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); @@ -22029,13 +22258,12 @@ function _getPrivateAccess(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -22055,7 +22283,7 @@ function _getPrivateAccess(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PrivateAccess']().mapper(); + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -22071,25 +22299,18 @@ function _getPrivateAccess(resourceGroupName, name, options, callback) { } /** - * @summary Sets data around private site access enablement and authorized - * Virtual Networks that can access the site. + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. * - * Sets data around private site access enablement and authorized Virtual - * Networks that can access the site. + * 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 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} name Site name. * - * @param {string} [access.kind] Kind of resource. + * @param {string} processId PID. * * @param {object} [options] Optional Parameters. * @@ -22103,13 +22324,13 @@ function _getPrivateAccess(resourceGroupName, name, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PrivateAccess} for more information. + * See {@link 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 _putPrivateAccessVnet(resourceGroupName, name, access, options, callback) { +function _getProcess(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22119,6 +22340,7 @@ function _putPrivateAccessVnet(resourceGroupName, name, access, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22141,15 +22363,12 @@ function _putPrivateAccessVnet(resourceGroupName, name, access, options, callbac if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (access === null || access === undefined) { - throw new Error('access cannot be null or undefined.'); + if (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.'); } @@ -22159,19 +22378,20 @@ function _putPrivateAccessVnet(resourceGroupName, name, access, options, callbac // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/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(this.client.apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -22189,28 +22409,14 @@ function _putPrivateAccessVnet(resourceGroupName, name, access, options, callbac } } } - // 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; + 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); @@ -22220,13 +22426,12 @@ function _putPrivateAccessVnet(resourceGroupName, name, access, options, callbac try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -22246,7 +22451,7 @@ function _putPrivateAccessVnet(resourceGroupName, name, access, options, callbac parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PrivateAccess']().mapper(); + let resultMapper = new client.models['ProcessInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -22262,10 +22467,10 @@ function _putPrivateAccessVnet(resourceGroupName, name, access, options, callbac } /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. * - * Get list of processes for a web site, or a deployment slot, or for a + * 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 @@ -22273,6 +22478,8 @@ function _putPrivateAccessVnet(resourceGroupName, name, access, options, callbac * * @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 @@ -22284,14 +22491,13 @@ function _putPrivateAccessVnet(resourceGroupName, name, access, options, callbac * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfoCollection} for more information. + * {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 _listProcesses(resourceGroupName, name, options, callback) { +function _deleteProcess(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22301,6 +22507,7 @@ function _listProcesses(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22323,12 +22530,12 @@ 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 (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.'); } @@ -22338,19 +22545,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}/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(this.client.apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -22375,7 +22583,7 @@ function _listProcesses(resourceGroupName, name, options, callback) { 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); @@ -22403,34 +22611,17 @@ function _listProcesses(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['ProcessInfoCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Get process information by its ID for a specific scaled-out + * @summary Get a memory dump of a process by its ID for a specific scaled-out * instance in a web site. * - * Get process information by its ID for a specific scaled-out instance in a - * web site. + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -22451,13 +22642,12 @@ 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. * * {object} [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 _getProcessDump(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22467,6 +22657,7 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22495,9 +22686,6 @@ function _getProcess(resourceGroupName, name, processId, 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.'); } @@ -22507,13 +22695,13 @@ 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}/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)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -22540,20 +22728,22 @@ function _getProcess(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(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; @@ -22570,37 +22760,19 @@ function _getProcess(resourceGroupName, name, processId, 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['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); - } - } + // Create Result + let result = response; 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 List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * Terminate a process by its ID for a web site, or a deployment slot, or - * specific scaled-out instance in a web site. + * 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. @@ -22620,13 +22792,15 @@ 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 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 _deleteProcess(resourceGroupName, name, processId, options, callback) { +function _listProcessModules(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22636,6 +22810,7 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22664,9 +22839,6 @@ function _deleteProcess(resourceGroupName, name, processId, 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.'); } @@ -22676,20 +22848,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}/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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -22714,7 +22886,7 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -22742,171 +22914,35 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = 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; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; 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'); + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); } - } catch (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 = response; return callback(null, result, httpRequest, response); }); } /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. - * - * List module information for a process by its ID for a specific scaled-out + * @summary Get process information 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. * @@ -22914,6 +22950,8 @@ function _getProcessDump(resourceGroupName, name, processId, options, callback) * * @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 @@ -22926,14 +22964,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 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 _listProcessModules(resourceGroupName, name, processId, options, callback) { +function _getProcessModule(resourceGroupName, name, processId, baseAddress, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22943,6 +22980,7 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22968,12 +23006,12 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { throw new Error('processId cannot be null or undefined and it must be of type string.'); } + if (baseAddress === null || baseAddress === undefined || typeof baseAddress.valueOf() !== 'string') { + throw new Error('baseAddress cannot be null or undefined and it must be of type string.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -22983,13 +23021,14 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{baseAddress}', encodeURIComponent(baseAddress)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -23056,7 +23095,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['ProcessModuleInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -23072,11 +23111,11 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba } /** - * @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. @@ -23085,8 +23124,6 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba * * @param {string} processId PID. * - * @param {string} baseAddress Module base address. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -23099,13 +23136,14 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfo} for more information. + * See {@link 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 _getProcessModule(resourceGroupName, name, processId, baseAddress, options, callback) { +function _listProcessThreads(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -23115,6 +23153,7 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -23140,15 +23179,9 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { throw new Error('processId cannot be null or undefined and it must be of type string.'); } - if (baseAddress === null || baseAddress === undefined || typeof baseAddress.valueOf() !== 'string') { - throw new Error('baseAddress cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -23158,14 +23191,13 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); - requestUrl = requestUrl.replace('{baseAddress}', encodeURIComponent(baseAddress)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -23232,7 +23264,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['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -23248,11 +23280,11 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti } /** - * @summary List the threads in 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. * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -23261,6 +23293,8 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti * * @param {string} processId PID. * + * @param {string} threadId TID. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -23273,14 +23307,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 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 _listProcessThreads(resourceGroupName, name, processId, options, callback) { +function _getProcessThread(resourceGroupName, name, processId, threadId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -23290,6 +23323,7 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -23315,12 +23349,12 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { throw new Error('processId cannot be null or undefined and it must be of type string.'); } + if (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.'); } @@ -23330,13 +23364,14 @@ 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}/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('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -23403,7 +23438,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['ProcessThreadInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -23419,20 +23454,14 @@ 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 Get public certificates for an app or a deployment slot. * - * Get thread information by Thread ID for a specific process, in a specific - * scaled-out instance in a web site. + * 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} threadId TID. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -23446,13 +23475,14 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfo} for more information. + * See {@link 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 _getProcessThread(resourceGroupName, name, processId, threadId, options, callback) { +function _listPublicCertificates(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -23462,6 +23492,7 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -23484,18 +23515,9 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, 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 (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.'); } @@ -23505,14 +23527,12 @@ 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}/publicCertificates'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); - requestUrl = requestUrl.replace('{threadId}', encodeURIComponent(threadId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -23544,7 +23564,7 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, 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); @@ -23554,12 +23574,13 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, 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) { @@ -23579,7 +23600,7 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfo']().mapper(); + let resultMapper = new client.models['PublicCertificateCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -23595,15 +23616,19 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options } /** - * @summary Get public certificates for an app or a deployment slot. + * @summary Get the named public certificate for an app (or deployment slot, if + * specified). * - * Get public certificates for an app or a deployment slot. + * 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 @@ -23616,14 +23641,13 @@ 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 - * 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 _listPublicCertificates(resourceGroupName, name, options, callback) { +function _getPublicCertificate(resourceGroupName, name, publicCertificateName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -23633,6 +23657,7 @@ function _listPublicCertificates(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -23655,12 +23680,12 @@ 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 (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.'); } @@ -23670,12 +23695,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}/publicCertificates/{publicCertificateName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -23743,7 +23769,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['PublicCertificate']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -23759,11 +23785,9 @@ function _listPublicCertificates(resourceGroupName, name, options, callback) { } /** - * @summary Get the named public certificate for an app (or deployment slot, if - * specified). + * @summary Creates a hostname binding for an app. * - * Get the named public certificate for an app (or deployment slot, if - * specified). + * Creates a hostname binding for an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -23772,6 +23796,17 @@ function _listPublicCertificates(resourceGroupName, name, options, callback) { * * @param {string} publicCertificateName Public certificate name. * + * @param {object} publicCertificate Public certificate details. This is the + * JSON representation of a PublicCertificate object. + * + * @param {buffer} [publicCertificate.blob] Public Certificate byte array + * + * @param {string} [publicCertificate.publicCertificateLocation] Public + * Certificate Location. Possible values include: 'CurrentUserMy', + * 'LocalMachineMy', 'Unknown' + * + * @param {string} [publicCertificate.kind] Kind of resource. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -23790,7 +23825,7 @@ function _listPublicCertificates(resourceGroupName, name, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getPublicCertificate(resourceGroupName, name, publicCertificateName, options, callback) { +function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertificateName, publicCertificate, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -23800,6 +23835,7 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -23825,12 +23861,12 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o if (publicCertificateName === null || publicCertificateName === undefined || typeof publicCertificateName.valueOf() !== 'string') { throw new Error('publicCertificateName cannot be null or undefined and it must be of type string.'); } + if (publicCertificate === null || publicCertificate === undefined) { + throw new Error('publicCertificate cannot be null or undefined.'); + } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -23846,14 +23882,14 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -23871,7 +23907,21 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o } } } - 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) { @@ -23930,9 +23980,9 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o } /** - * @summary Creates a hostname binding for an app. + * @summary Deletes a hostname binding for an app. * - * Creates a hostname binding for an app. + * Deletes a hostname binding for an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -23941,17 +23991,6 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o * * @param {string} publicCertificateName Public certificate name. * - * @param {object} publicCertificate Public certificate details. This is the - * JSON representation of a PublicCertificate object. - * - * @param {buffer} [publicCertificate.blob] Public Certificate byte array - * - * @param {string} [publicCertificate.publicCertificateLocation] Public - * Certificate Location. Possible values include: 'CurrentUserMy', - * 'LocalMachineMy', 'Unknown' - * - * @param {string} [publicCertificate.kind] Kind of resource. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -23963,14 +24002,13 @@ 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. + * {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 _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertificateName, publicCertificate, options, callback) { +function _deletePublicCertificate(resourceGroupName, name, publicCertificateName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -23980,6 +24018,7 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -24005,15 +24044,9 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi if (publicCertificateName === null || publicCertificateName === undefined || typeof publicCertificateName.valueOf() !== 'string') { throw new Error('publicCertificateName cannot be null or undefined and it must be of type string.'); } - if (publicCertificate === null || publicCertificate === undefined) { - throw new Error('publicCertificate cannot be null or undefined.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -24029,14 +24062,14 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -24054,28 +24087,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 !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -24085,13 +24104,12 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -24104,39 +24122,34 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi // 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 Gets the publishing profile for an app (or deployment slot, if + * specified). * - * Deletes a hostname binding for an app. + * 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 {string} publicCertificateName Public certificate name. + * @param {object} publishingProfileOptions Specifies publishingProfileOptions + * for publishing profile. For example, use {"format": "FileZilla3"} to get a + * FileZilla publishing profile. + * + * @param {string} [publishingProfileOptions.format] Name of the format. Valid + * values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {boolean} [publishingProfileOptions.includeDisasterRecoveryEndpoints] + * Include the DisasterRecover endpoint if true * * @param {object} [options] Optional Parameters. * @@ -24149,13 +24162,13 @@ 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. * * {object} [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 _listPublishingProfileXmlWithSecrets(resourceGroupName, name, publishingProfileOptions, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -24165,6 +24178,7 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -24187,15 +24201,12 @@ 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 (publishingProfileOptions === null || publishingProfileOptions === undefined) { + throw new Error('publishingProfileOptions 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.'); } @@ -24205,20 +24216,19 @@ 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}/publishxml'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -24236,29 +24246,46 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName } } } - 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 !== 204) { - 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) { @@ -24268,38 +24295,25 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } /** - * @summary Gets the publishing profile 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. * - * Gets the publishing profile 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. * * @param {string} name Name of the app. * - * @param {object} publishingProfileOptions Specifies publishingProfileOptions - * for publishing profile. For example, use {"format": "FileZilla3"} to get a - * FileZilla publishing profile. - * - * @param {string} [publishingProfileOptions.format] Name of the format. Valid - * values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' - * - * @param {boolean} [publishingProfileOptions.includeDisasterRecoveryEndpoints] - * Include the DisasterRecover endpoint if true - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -24311,13 +24325,13 @@ 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. + * {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 _listPublishingProfileXmlWithSecrets(resourceGroupName, name, publishingProfileOptions, options, callback) { +function _resetProductionSlotConfig(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -24327,6 +24341,7 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, publishin if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -24349,15 +24364,9 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, publishin if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (publishingProfileOptions === null || publishingProfileOptions === undefined) { - throw new Error('publishingProfileOptions cannot be null or undefined.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -24367,12 +24376,12 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, publishin // 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}/resetSlotConfig'; 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)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -24397,46 +24406,29 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, publishin } } } - // 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -24446,19 +24438,18 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, publishin } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + 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 Restarts 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. + * Restarts an app (or deployment slot, if specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -24467,6 +24458,14 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, publishin * * @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 * @@ -24482,7 +24481,7 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, publishin * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _resetProductionSlotConfig(resourceGroupName, name, options, callback) { +function _restart(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -24492,160 +24491,9 @@ function _resetProductionSlotConfig(resourceGroupName, name, options, callback) 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}/resetSlotConfig'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'POST'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - 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 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} 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; + let softRestart = (options && options.softRestart !== undefined) ? options.softRestart : undefined; + let synchronous = (options && options.synchronous !== undefined) ? options.synchronous : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -24677,9 +24525,6 @@ function _restart(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.'); } @@ -24700,7 +24545,7 @@ function _restart(resourceGroupName, name, options, callback) { if (synchronous !== null && synchronous !== undefined) { queryParameters.push('synchronous=' + encodeURIComponent(synchronous.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -24895,6 +24740,9 @@ function _restoreFromBackupBlob(resourceGroupName, name, request, options, callb * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -24994,6 +24842,9 @@ function _restoreFromDeletedApp(resourceGroupName, name, restoreRequest, options * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -25090,6 +24941,7 @@ function _listSiteExtensions(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -25115,9 +24967,6 @@ function _listSiteExtensions(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.'); } @@ -25132,7 +24981,7 @@ function _listSiteExtensions(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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -25256,6 +25105,7 @@ function _getSiteExtension(resourceGroupName, name, siteExtensionId, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -25284,9 +25134,6 @@ function _getSiteExtension(resourceGroupName, name, siteExtensionId, 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.'); } @@ -25302,7 +25149,7 @@ function _getSiteExtension(resourceGroupName, name, siteExtensionId, options, ca requestUrl = requestUrl.replace('{siteExtensionId}', encodeURIComponent(siteExtensionId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -25506,6 +25353,7 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -25534,9 +25382,6 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, 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.'); } @@ -25552,7 +25397,7 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, requestUrl = requestUrl.replace('{siteExtensionId}', encodeURIComponent(siteExtensionId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -25655,6 +25500,7 @@ function _listSlots(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -25680,9 +25526,6 @@ 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.'); } @@ -25697,7 +25540,7 @@ function _listSlots(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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -25821,6 +25664,7 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -25849,9 +25693,6 @@ function _getSlot(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.'); } @@ -25867,7 +25708,7 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -26080,7 +25921,7 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -26172,6 +26013,11 @@ 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 {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -26213,7 +26059,13 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -26248,6 +26100,9 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -26308,6 +26163,12 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service @@ -26445,6 +26306,7 @@ function _deleteSlot(resourceGroupName, name, slot, options, callback) { } let deleteMetrics = (options && options.deleteMetrics !== undefined) ? options.deleteMetrics : undefined; let deleteEmptyServerFarm = (options && options.deleteEmptyServerFarm !== undefined) ? options.deleteEmptyServerFarm : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -26479,9 +26341,6 @@ function _deleteSlot(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.'); } @@ -26503,7 +26362,7 @@ function _deleteSlot(resourceGroupName, name, slot, options, callback) { if (deleteEmptyServerFarm !== null && deleteEmptyServerFarm !== undefined) { queryParameters.push('deleteEmptyServerFarm=' + encodeURIComponent(deleteEmptyServerFarm.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -26698,7 +26557,7 @@ function _deleteSlot(resourceGroupName, name, slot, options, callback) { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -26790,6 +26649,11 @@ function _deleteSlot(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 {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -26831,7 +26695,13 @@ function _deleteSlot(resourceGroupName, name, slot, options, callback) { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -26866,6 +26736,9 @@ function _deleteSlot(resourceGroupName, name, slot, options, callback) { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -26926,6 +26799,12 @@ function _deleteSlot(resourceGroupName, name, slot, options, callback) { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {string} [siteEnvelope.kind] Kind of resource. * * @param {string} slot Name of the deployment slot to create or update. By @@ -26959,6 +26838,7 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -26990,9 +26870,6 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, 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.'); } @@ -27008,7 +26885,7 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callb requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -27167,6 +27044,7 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call throw new Error('callback cannot be null.'); } let hostName = (options && options.hostName !== undefined) ? options.hostName : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -27198,9 +27076,6 @@ function _analyzeCustomHostnameSlot(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.'); } @@ -27219,756 +27094,7 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call 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 {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 _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. - * - * Creates a backup 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 Backup configuration. You can use the JSON response - * from the POST action as input here. - * - * @param {string} [request.backupName] 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.kind] Kind of resource. - * - * @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 {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 _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. - * - * 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 {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get backups 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 BackupItemCollection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _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. - * - * 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 {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 {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 _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); - } - - // 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)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -28036,7 +27162,7 @@ function _getBackupStatusSlot(resourceGroupName, name, backupId, slot, options, 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['CustomHostnameAnalysisResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -28052,19 +27178,28 @@ function _getBackupStatusSlot(resourceGroupName, name, backupId, slot, options, } /** - * @summary Deletes a backup of an app by its ID. + * @summary Applies the configuration settings from the target slot onto the + * current slot. * - * Deletes a backup of an app by its ID. + * 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 {string} backupId ID of the backup. + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. * - * @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 {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. * @@ -28083,7 +27218,7 @@ function _getBackupStatusSlot(resourceGroupName, name, backupId, slot, options, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, callback) { +function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -28093,6 +27228,7 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -28115,8 +27251,8 @@ 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 (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.'); @@ -28124,9 +27260,6 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, 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.'); } @@ -28136,21 +27269,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}/applySlotConfig'; 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)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -28168,14 +27300,28 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, cal } } } - 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); @@ -28209,24 +27355,17 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, cal } /** - * @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 Creates a backup 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. + * Creates a backup 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 {string} name Name of the app. * - * @param {object} request Information on backup request. + * @param {object} request Backup configuration. You can use the JSON response + * from the POST action as input here. * * @param {string} [request.backupName] Name of the backup. * @@ -28262,8 +27401,8 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, cal * * @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 {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a backup for the production slot. * * @param {object} [options] Optional Parameters. * @@ -28283,7 +27422,7 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, cal * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request, slot, options, callback) { +function _backupSlot(resourceGroupName, name, request, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -28293,6 +27432,7 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -28315,9 +27455,6 @@ 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.'); } @@ -28327,9 +27464,6 @@ 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.'); } @@ -28339,14 +27473,13 @@ 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}/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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -28443,123 +27576,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', '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} 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 _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 + * @summary Gets existing backups of an app. * - * List the configurations of an app + * Gets existing backups of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -28567,7 +27587,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 backups of the production slot. * * @param {object} [options] Optional Parameters. * @@ -28581,14 +27601,13 @@ 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 - * information. + * See {@link BackupItemCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listConfigurationsSlot(resourceGroupName, name, slot, options, callback) { +function _listBackupsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -28598,6 +27617,7 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -28626,9 +27646,6 @@ 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.'); } @@ -28638,13 +27655,13 @@ 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}/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)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -28712,7 +27729,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['BackupItemCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -28728,24 +27745,19 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, options, callbac } /** - * @summary Replaces the application settings of an app. + * @summary Gets a backup of an app by its ID. * - * Replaces the application settings of an app. + * 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} appSettings Application settings of the app. - * - * @param {object} [appSettings.properties] Settings. - * - * @param {string} [appSettings.kind] Kind of resource. + * @param {string} backupId ID of the backup. * * @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. + * specified, the API will get a backup of the production slot. * * @param {object} [options] Optional Parameters. * @@ -28759,13 +27771,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 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 _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, slot, options, callback) { +function _getBackupStatusSlot(resourceGroupName, name, backupId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -28775,6 +27787,7 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -28797,8 +27810,8 @@ 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 (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.'); @@ -28806,9 +27819,6 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, 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.'); } @@ -28818,20 +27828,21 @@ 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}/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)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -28849,21 +27860,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) { @@ -28906,7 +27903,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['BackupItem']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -28922,18 +27919,19 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl } /** - * @summary Gets the application settings of an app. + * @summary Deletes a backup of an app by its ID. * - * Gets the application settings of an app. + * 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 {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the application settings for the production - * slot. + * specified, the API will delete a backup of the production slot. * * @param {object} [options] Optional Parameters. * @@ -28946,14 +27944,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. + * {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 _listApplicationSettingsSlot(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') { @@ -28963,6 +27960,7 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -28985,15 +27983,15 @@ 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 (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.'); } @@ -29003,20 +28001,21 @@ 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}/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)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -29041,7 +28040,7 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, 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); @@ -29051,13 +28050,12 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -29070,183 +28068,64 @@ function _listApplicationSettingsSlot(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['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 Updates the Authentication / Authorization settings associated with - * web 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. * - * Updates the Authentication / Authorization settings associated with web 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 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} backupId ID of backup. * - * @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 {object} request Information on backup request. * - * @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 {string} [request.backupName] Name of the backup. * - * @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 {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.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} request.storageAccountUrl SAS URL to the container. * - * @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 {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. * - * @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 {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} [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} 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.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 {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} [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 {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. * - * @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 {date} [request.backupSchedule.startTime] When the schedule should + * start working. * - * @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 {array} [request.databases] Databases included in the backup. * - * @param {string} [siteAuthSettings.kind] Kind of resource. + * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will * default to production slot. @@ -29263,13 +28142,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 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 _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot, options, callback) { +function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -29279,6 +28158,7 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -29301,8 +28181,11 @@ 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 (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.'); @@ -29310,9 +28193,6 @@ 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.'); } @@ -29322,20 +28202,21 @@ 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}/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)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -29357,14 +28238,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 (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(siteAuthSettings, null, 2)}.`); + `payload - ${JSON.stringify(request, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -29410,7 +28291,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['BackupItem']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -29425,18 +28306,131 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot }); } + /** - * @summary Gets the Authentication/Authorization settings of an app. + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). * - * Gets the Authentication/Authorization settings of an app. + * 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', '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 get the settings for the production slot. + * 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. + * + * {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 _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 + * + * List the configurations of an app + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. * * @param {object} [options] Optional Parameters. * @@ -29450,13 +28444,14 @@ 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 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 _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) { +function _listConfigurationsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -29466,6 +28461,7 @@ function _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -29494,9 +28490,6 @@ 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.'); } @@ -29506,20 +28499,20 @@ 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'; 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)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -29580,7 +28573,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['SiteConfigResourceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -29596,24 +28589,24 @@ function _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) } /** - * @summary Updates the Azure storage account configurations of an app. + * @summary Replaces the application settings of an app. * - * Updates the Azure storage account configurations of an app. + * 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 the app. * - * @param {object} azureStorageAccounts Azure storage accounts of the app. + * @param {object} appSettings Application settings of the app. * - * @param {object} [azureStorageAccounts.properties] Azure storage accounts. + * @param {object} [appSettings.properties] Settings. * - * @param {string} [azureStorageAccounts.kind] Kind of resource. + * @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 Azure storage account configurations for - * the production slot. + * specified, the API will update the application settings for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -29627,14 +28620,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 AzureStoragePropertyDictionaryResource} 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 _updateAzureStorageAccountsSlot(resourceGroupName, name, azureStorageAccounts, slot, options, callback) { +function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -29644,6 +28636,7 @@ function _updateAzureStorageAccountsSlot(resourceGroupName, name, azureStorageAc if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -29666,8 +28659,8 @@ function _updateAzureStorageAccountsSlot(resourceGroupName, name, azureStorageAc if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (azureStorageAccounts === null || azureStorageAccounts === undefined) { - throw new Error('azureStorageAccounts cannot be null or undefined.'); + 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.'); @@ -29675,9 +28668,6 @@ function _updateAzureStorageAccountsSlot(resourceGroupName, name, azureStorageAc if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -29687,13 +28677,13 @@ function _updateAzureStorageAccountsSlot(resourceGroupName, name, azureStorageAc // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts'; + 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 = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -29722,14 +28712,14 @@ function _updateAzureStorageAccountsSlot(resourceGroupName, name, azureStorageAc let requestContent = null; let requestModel = null; try { - if (azureStorageAccounts !== null && azureStorageAccounts !== undefined) { - let requestModelMapper = new client.models['AzureStoragePropertyDictionaryResource']().mapper(); - requestModel = client.serialize(requestModelMapper, azureStorageAccounts, 'azureStorageAccounts'); + 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(azureStorageAccounts, null, 2)}.`); + `payload - ${JSON.stringify(appSettings, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -29775,7 +28765,7 @@ function _updateAzureStorageAccountsSlot(resourceGroupName, name, azureStorageAc parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['AzureStoragePropertyDictionaryResource']().mapper(); + let resultMapper = new client.models['StringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -29791,9 +28781,9 @@ function _updateAzureStorageAccountsSlot(resourceGroupName, name, azureStorageAc } /** - * @summary Gets the Azure storage account configurations of an app. + * @summary Gets the application settings of an app. * - * Gets the Azure storage account configurations of an app. + * Gets the application settings of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -29801,8 +28791,8 @@ function _updateAzureStorageAccountsSlot(resourceGroupName, name, azureStorageAc * @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 Azure storage account configurations for - * the production slot. + * specified, the API will get the application settings for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -29816,14 +28806,13 @@ function _updateAzureStorageAccountsSlot(resourceGroupName, name, azureStorageAc * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link AzureStoragePropertyDictionaryResource} 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 _listAzureStorageAccountsSlot(resourceGroupName, name, slot, options, callback) { +function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -29833,6 +28822,7 @@ function _listAzureStorageAccountsSlot(resourceGroupName, name, slot, options, c if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -29861,9 +28851,6 @@ function _listAzureStorageAccountsSlot(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.'); } @@ -29873,13 +28860,13 @@ function _listAzureStorageAccountsSlot(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}/config/azurestorageaccounts/list'; + 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -29947,7 +28934,7 @@ function _listAzureStorageAccountsSlot(resourceGroupName, name, slot, options, c parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['AzureStoragePropertyDictionaryResource']().mapper(); + let resultMapper = new client.models['StringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -29963,54 +28950,168 @@ function _listAzureStorageAccountsSlot(resourceGroupName, name, slot, options, c } /** - * @summary Updates the backup configuration of an app. + * @summary Updates the Authentication / Authorization settings associated with + * web app. * - * Updates the backup configuration 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 Edited backup configuration. + * @param {object} siteAuthSettings Auth settings associated with web app. * - * @param {string} [request.backupName] 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.clientSecretCertificateThumbprint] An + * alternative to the client secret, that is the thumbprint of a certificate + * used for signing purposes. This property acts as + * a replacement for the Client Secret. It is also optional. * - * @param {string} [request.kind] Kind of resource. + * @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} 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} [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. * @@ -30024,13 +29125,13 @@ function _listAzureStorageAccountsSlot(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 BackupRequest} 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 _updateBackupConfigurationSlot(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') { @@ -30040,6 +29141,7 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30062,8 +29164,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 (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.'); @@ -30071,9 +29173,6 @@ 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.'); } @@ -30083,13 +29182,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/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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -30118,14 +29217,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 (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; @@ -30171,7 +29270,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['SiteAuthSettings']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -30187,9 +29286,9 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, } /** - * @summary Deletes the backup configuration of an app. + * @summary Gets the Authentication/Authorization settings of an app. * - * Deletes the backup configuration of an app. + * Gets the Authentication/Authorization settings of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -30197,8 +29296,7 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, 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 delete the backup configuration for the production - * slot. + * specified, the API will get the settings for the production slot. * * @param {object} [options] Optional Parameters. * @@ -30211,13 +29309,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 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 _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, callback) { +function _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30227,6 +29326,7 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30255,9 +29355,6 @@ 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.'); } @@ -30267,20 +29364,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/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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -30315,12 +29412,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) { @@ -30333,24 +29431,47 @@ 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['SiteAuthSettings']().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 Updates the Azure storage account configurations of an app. * - * Gets the backup configuration of an app. + * Updates the Azure storage account configurations 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} azureStorageAccounts Azure storage accounts of the app. + * + * @param {object} [azureStorageAccounts.properties] Azure storage accounts. + * + * @param {string} [azureStorageAccounts.kind] Kind of resource. + * * @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 update the Azure storage account configurations for + * the production slot. * * @param {object} [options] Optional Parameters. * @@ -30364,13 +29485,14 @@ 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 AzureStoragePropertyDictionaryResource} for + * more information. * * {object} [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 _updateAzureStorageAccountsSlot(resourceGroupName, name, azureStorageAccounts, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30380,6 +29502,7 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30402,15 +29525,15 @@ function _getBackupConfigurationSlot(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 (azureStorageAccounts === null || azureStorageAccounts === undefined) { + throw new Error('azureStorageAccounts 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.'); } @@ -30420,20 +29543,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/azurestorageaccounts'; 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)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -30451,7 +29574,21 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, cal } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (azureStorageAccounts !== null && azureStorageAccounts !== undefined) { + let requestModelMapper = new client.models['AzureStoragePropertyDictionaryResource']().mapper(); + requestModel = client.serialize(requestModelMapper, azureStorageAccounts, 'azureStorageAccounts'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(azureStorageAccounts, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -30494,7 +29631,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['AzureStoragePropertyDictionaryResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -30510,25 +29647,18 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, cal } /** - * @summary Replaces the connection strings of an app. + * @summary Gets the Azure storage account configurations of an app. * - * Replaces the connection strings of an app. + * Gets the Azure storage account configurations 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} connectionStrings Connection strings of the app or - * deployment slot. See example. - * - * @param {object} [connectionStrings.properties] Connection strings. - * - * @param {string} [connectionStrings.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 update the Azure storage account configurations for + * the production slot. * * @param {object} [options] Optional Parameters. * @@ -30542,14 +29672,14 @@ 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 AzureStoragePropertyDictionaryResource} for + * more information. * * {object} [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 _listAzureStorageAccountsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30559,6 +29689,7 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30581,18 +29712,12 @@ 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 (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.'); } @@ -30602,20 +29727,20 @@ 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/azurestorageaccounts/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(this.client.apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -30633,21 +29758,7 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings } } } - // Serialize Request - 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'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(connectionStrings, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -30690,7 +29801,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['AzureStoragePropertyDictionaryResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -30706,17 +29817,54 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings } /** - * @summary Gets the connection strings of an app. + * @summary Updates the backup configuration of an app. * - * Gets the connection strings of an app. + * 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 Edited backup configuration. + * + * @param {string} [request.backupName] 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.kind] Kind of resource. + * * @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 update the backup configuration for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -30730,14 +29878,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. + * 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 _listConnectionStringsSlot(resourceGroupName, name, slot, options, callback) { +function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30747,6 +29894,7 @@ function _listConnectionStringsSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30769,15 +29917,15 @@ function _listConnectionStringsSlot(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 (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.'); } @@ -30787,20 +29935,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/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)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -30818,7 +29966,21 @@ function _listConnectionStringsSlot(resourceGroupName, name, slot, options, call } } } - httpRequest.body = null; + // 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) { @@ -30861,7 +30023,7 @@ function _listConnectionStringsSlot(resourceGroupName, name, slot, options, call 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['BackupRequest']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -30877,9 +30039,9 @@ function _listConnectionStringsSlot(resourceGroupName, name, slot, options, call } /** - * @summary Gets the logging configuration of an app. + * @summary Deletes the backup configuration of an app. * - * Gets the logging configuration of an app. + * Deletes the backup configuration of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -30887,7 +30049,7 @@ function _listConnectionStringsSlot(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 the logging configuration for the production + * specified, the API will delete the backup configuration for the production * slot. * * @param {object} [options] Optional Parameters. @@ -30901,14 +30063,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. + * {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 _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, options, callback) { +function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30918,6 +30079,7 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30946,9 +30108,6 @@ function _getDiagnosticLogsConfigurationSlot(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.'); } @@ -30958,20 +30117,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/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)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -31006,13 +30165,12 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, opti try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -31025,124 +30183,23 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, 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['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. + * @summary Gets the backup configuration of an app. * - * Updates the logging configuration of an app. + * 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 {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 update the logging configuration for the production + * specified, the API will get the backup configuration for the production * slot. * * @param {object} [options] Optional Parameters. @@ -31157,13 +30214,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 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 _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig, slot, options, callback) { +function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31173,6 +30230,7 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31195,18 +30253,12 @@ 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.'); } @@ -31216,20 +30268,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/backup/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(this.client.apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -31247,21 +30299,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) { @@ -31304,7 +30342,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['BackupRequest']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -31320,24 +30358,25 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig } /** - * @summary Replaces the metadata of an app. + * @summary Replaces the connection strings of an app. * - * Replaces the metadata of an app. + * 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 the app. * - * @param {object} metadata Edited metadata of the app or deployment slot. See - * example. + * @param {object} connectionStrings Connection strings of the app or + * deployment slot. See example. * - * @param {object} [metadata.properties] Settings. + * @param {object} [connectionStrings.properties] Connection strings. * - * @param {string} [metadata.kind] Kind of resource. + * @param {string} [connectionStrings.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 the connection settings for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -31351,13 +30390,14 @@ 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 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 _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, callback) { +function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31367,6 +30407,7 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31389,8 +30430,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 (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.'); @@ -31398,9 +30439,6 @@ 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.'); } @@ -31410,13 +30448,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/connectionstrings'; 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)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -31445,14 +30483,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 (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(metadata, null, 2)}.`); + `payload - ${JSON.stringify(connectionStrings, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -31498,7 +30536,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['ConnectionStringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -31514,9 +30552,9 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c } /** - * @summary Gets the metadata of an app. + * @summary Gets the connection strings of an app. * - * Gets the metadata of an app. + * Gets the connection strings of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -31524,7 +30562,7 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, 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 the metadata for the production slot. + * specified, the API will get the connection settings for the production slot. * * @param {object} [options] Optional Parameters. * @@ -31538,13 +30576,14 @@ 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 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 _listMetadataSlot(resourceGroupName, name, slot, options, callback) { +function _listConnectionStringsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31554,6 +30593,7 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31582,9 +30622,6 @@ function _listMetadataSlot(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.'); } @@ -31594,13 +30631,13 @@ 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/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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -31668,7 +30705,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['ConnectionStringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -31683,11 +30720,10 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { }); } - /** - * @summary Gets the Git/FTP publishing credentials of an app. + * @summary Gets the logging configuration of an app. * - * Gets the Git/FTP publishing credentials of an app. + * Gets the logging configuration of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -31695,7 +30731,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 + * specified, the API will get the logging configuration for the production * slot. * * @param {object} [options] Optional Parameters. @@ -31710,118 +30746,13 @@ function _listMetadataSlot(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 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. - * - * @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 PushSettings} 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 _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, callback) { +function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31831,6 +30762,7 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31853,18 +30785,12 @@ 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.'); } @@ -31874,20 +30800,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/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(this.client.apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -31905,21 +30831,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) { @@ -31962,7 +30874,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['SiteLogsConfig']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -31978,17 +30890,102 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot } /** - * @summary Gets the Push settings associated with web app. + * @summary Updates the logging configuration of an app. * - * Gets the Push settings associated with web 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 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} 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 update the logging configuration for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -32002,13 +30999,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 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 _listSitePushSettingsSlot(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') { @@ -32018,6 +31015,7 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32040,15 +31038,15 @@ 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 (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.'); } @@ -32058,20 +31056,20 @@ 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/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(this.client.apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -32089,7 +31087,21 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callb } } } - 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) { @@ -32132,7 +31144,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['SiteLogsConfig']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -32148,18 +31160,24 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callb } /** - * @summary Gets a Swift Virtual Network connection. + * @summary Replaces the metadata of an app. * - * Gets a Swift Virtual Network connection. + * Replaces the metadata 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 + * example. + * + * @param {object} [metadata.properties] Settings. + * + * @param {string} [metadata.kind] Kind of resource. + * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get a gateway for the production slot's Virtual - * Network. + * specified, the API will update the metadata for the production slot. * * @param {object} [options] Optional Parameters. * @@ -32173,13 +31191,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 SwiftVirtualNetwork} 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 _getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, callback) { +function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -32189,6 +31207,7 @@ function _getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, op if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32211,15 +31230,15 @@ function _getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, 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 (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.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -32229,20 +31248,20 @@ function _getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, 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}/config/virtualNetwork'; + 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(this.client.apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -32260,7 +31279,21 @@ function _getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, op } } } - httpRequest.body = null; + // Serialize Request + 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'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(metadata, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -32303,7 +31336,7 @@ function _getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, op parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SwiftVirtualNetwork']().mapper(); + let resultMapper = new client.models['StringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -32319,35 +31352,17 @@ function _getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, op } /** - * @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. + * @summary Gets the metadata 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. + * Gets the metadata 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} 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. + * specified, the API will get the metadata for the production slot. * * @param {object} [options] Optional Parameters. * @@ -32361,13 +31376,13 @@ function _getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, 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 SwiftVirtualNetwork} 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 _createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, callback) { +function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -32377,6 +31392,7 @@ function _createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, nam if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32399,18 +31415,12 @@ function _createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, nam if (name === 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.'); } @@ -32420,20 +31430,20 @@ function _createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, nam // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/virtualNetwork'; + 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(this.client.apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -32451,21 +31461,7 @@ function _createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, nam } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -32508,7 +31504,7 @@ function _createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, nam parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SwiftVirtualNetwork']().mapper(); + let resultMapper = new client.models['StringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -32523,11 +31519,11 @@ function _createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, nam }); } + /** - * @summary Deletes a Swift Virtual Network connection from an app (or - * deployment slot). + * @summary Gets the Git/FTP publishing credentials of an app. * - * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * Gets the Git/FTP publishing credentials of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -32535,7 +31531,8 @@ function _createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, nam * @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. + * specified, the API will get the publishing credentials for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -32548,22 +31545,129 @@ function _createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, nam * * {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 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 _deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, options, callback) { +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. + * + * @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 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 _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, 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 apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32586,15 +31690,15 @@ function _deleteSwiftVirtualNetworkSlot(resourceGroupName, name, 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 (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.'); } @@ -32604,20 +31708,20 @@ function _deleteSwiftVirtualNetworkSlot(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/virtualNetwork'; + 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -32635,14 +31739,28 @@ function _deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, options, } } } - httpRequest.body = null; + // 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; // 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); @@ -32652,12 +31770,13 @@ function _deleteSwiftVirtualNetworkSlot(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) { @@ -32670,41 +31789,40 @@ function _deleteSwiftVirtualNetworkSlot(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 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. + * @summary Gets the Push settings associated with web 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. + * 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 {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} name Name of web app. * - * @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 {string} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -32718,13 +31836,13 @@ function _deleteSwiftVirtualNetworkSlot(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 SwiftVirtualNetwork} 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 _updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, callback) { +function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -32734,6 +31852,7 @@ function _updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, conne if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32756,18 +31875,12 @@ function _updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, conne if (name === 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.'); } @@ -32777,20 +31890,20 @@ function _updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, conne // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/virtualNetwork'; + 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -32808,21 +31921,7 @@ function _updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, conne } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -32865,7 +31964,7 @@ function _updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, conne parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SwiftVirtualNetwork']().mapper(); + let resultMapper = new client.models['PushSettings']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -32923,6 +32022,7 @@ function _getConfigurationSlot(resourceGroupName, name, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32951,9 +32051,6 @@ function _getConfigurationSlot(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.'); } @@ -32969,7 +32066,7 @@ function _getConfigurationSlot(resourceGroupName, name, slot, options, callback) requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -33147,7 +32244,7 @@ function _getConfigurationSlot(resourceGroupName, name, slot, options, callback) * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' * - * @param {object} [siteConfig.experiments] This is work around for polymophic + * @param {object} [siteConfig.experiments] This is work around for polymorphic * types. * * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. @@ -33229,6 +32326,11 @@ function _getConfigurationSlot(resourceGroupName, name, slot, options, callback) * origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteConfig.push] Push endpoint settings. * * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag @@ -33268,7 +32370,14 @@ function _getConfigurationSlot(resourceGroupName, name, slot, options, callback) * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed * Service Identity Id * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions + * for main. + * + * @param {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * + * @param {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web * site to allow clients to connect over http2.0 @@ -33317,6 +32426,7 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -33348,9 +32458,6 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -33366,7 +32473,7 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -33558,7 +32665,7 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' * - * @param {object} [siteConfig.experiments] This is work around for polymophic + * @param {object} [siteConfig.experiments] This is work around for polymorphic * types. * * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. @@ -33640,6 +32747,11 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s * origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteConfig.push] Push endpoint settings. * * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag @@ -33679,7 +32791,14 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed * Service Identity Id * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions + * for main. + * + * @param {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * + * @param {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web * site to allow clients to connect over http2.0 @@ -33728,6 +32847,7 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -33759,9 +32879,6 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, 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.'); } @@ -33777,7 +32894,7 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -33918,6 +33035,351 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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 (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.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}/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)); + 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['SiteConfigurationSnapshotInfoCollection']().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 snapshot of the configuration of an app at a previous point + * in time. + * + * 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 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. + * + * @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 _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, 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 apiVersion = '2018-02-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 (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.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}/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)); + 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['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. + * + * 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. + * + * @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 _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, 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 apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -33940,15 +33402,15 @@ 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 (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.'); } @@ -33958,20 +33420,21 @@ 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}/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(this.client.apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -33996,7 +33459,7 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio 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); @@ -34006,13 +33469,12 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -34025,43 +33487,23 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().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 snapshot of the configuration of an app at a previous point - * in time. + * @summary Gets the last lines of docker logs for the given site * - * Gets a snapshot of the configuration of an app at a previous point in time. + * 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 Name of the app. - * - * @param {string} snapshotId The ID of the snapshot to read. + * @param {string} name Name of web app. * - * @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} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -34075,13 +33517,12 @@ 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. * * {object} [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 _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -34091,6 +33532,7 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34113,18 +33555,12 @@ 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 (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.'); } @@ -34134,21 +33570,20 @@ 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}/containerlogs'; 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(this.client.apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -34168,28 +33603,29 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, 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 !== 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -34199,45 +33635,25 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot } 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 Reverts the configuration of an app to a previous snapshot. + * @summary Gets the ZIP archived docker log files for the given site * - * Reverts the configuration of an app to a previous snapshot. + * 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 {string} snapshotId The ID of the snapshot to read. + * @param {string} name Name of web app. * - * @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} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -34250,13 +33666,13 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, 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. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, options, callback) { +function _getContainerLogsZipSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -34266,6 +33682,7 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34288,18 +33705,12 @@ 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 (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.'); } @@ -34309,14 +33720,13 @@ 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}/containerlogs/zip/download'; 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -34343,20 +33753,22 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot } 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 !== 204) { - 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; @@ -34373,26 +33785,25 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } /** - * @summary Gets the last lines of docker logs for the given site + * @summary List continuous web jobs for an app, or a deployment slot. * - * Gets the last lines of docker logs for the given site + * 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 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} 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. * @@ -34406,12 +33817,14 @@ 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. + * 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 _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, callback) { +function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -34421,6 +33834,7 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34449,9 +33863,6 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, 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.'); } @@ -34461,20 +33872,20 @@ 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'; 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)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -34494,29 +33905,28 @@ 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) { + 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) { @@ -34526,25 +33936,46 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, ca } 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['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 Gets the ZIP archived docker log files for the given site + * @summary Gets a continuous web job by its ID for an app, or a deployment + * slot. * - * Gets the ZIP archived docker log files for the given site + * 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 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. * @@ -34558,12 +33989,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 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 _getContainerLogsZipSlot(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') { @@ -34573,6 +34005,7 @@ function _getContainerLogsZipSlot(resourceGroupName, name, slot, options, callba if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34595,15 +34028,15 @@ function _getContainerLogsZipSlot(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 (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.'); } @@ -34613,20 +34046,21 @@ function _getContainerLogsZipSlot(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}/containerlogs/zip/download'; + 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(this.client.apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -34646,22 +34080,20 @@ function _getContainerLogsZipSlot(resourceGroupName, name, slot, options, callba } 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; @@ -34678,23 +34110,44 @@ function _getContainerLogsZipSlot(resourceGroupName, name, slot, options, callba } 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['ContinuousWebJob']().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 Delete a continuous web job by its ID for an app, or a deployment + * slot. * - * List continuous web jobs 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 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. * @@ -34709,15 +34162,13 @@ function _getContainerLogsZipSlot(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 ContinuousWebJobCollection} 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 _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, callback) { +function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -34727,6 +34178,7 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34749,15 +34201,15 @@ 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 (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.'); } @@ -34767,20 +34219,21 @@ 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}/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(this.client.apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -34805,7 +34258,7 @@ function _listContinuousWebJobsSlot(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); @@ -34815,13 +34268,12 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -34834,33 +34286,15 @@ function _listContinuousWebJobsSlot(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['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 Gets a continuous web job by its ID for an app, or a deployment - * slot. + * @summary Start a continuous web job for an app, or a deployment slot. * - * Gets a continuous web job by its ID 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. @@ -34883,14 +34317,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. + * {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 _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -34900,6 +34333,7 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34931,9 +34365,6 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, 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.'); } @@ -34943,21 +34374,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}/continuouswebjobs/{webJobName}/start'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -35010,33 +34441,15 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, 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['ContinuousWebJob']().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 continuous web job 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 continuous web job 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. @@ -35065,7 +34478,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 _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35075,6 +34488,7 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35106,9 +34520,6 @@ 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.'); } @@ -35118,21 +34529,21 @@ 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}/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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -35157,7 +34568,7 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, 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); @@ -35191,19 +34602,187 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, } /** - * @summary Start a continuous web job for an app, or a deployment slot. + * @summary List deployments for an app, or a deployment slot. * - * Start a continuous web job 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @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} 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 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 _listDeploymentsSlot(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 apiVersion = '2018-02-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 (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.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}/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)); + 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['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 Get a deployment by its ID 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 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. * @@ -35216,13 +34795,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 _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35232,6 +34812,7 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35254,8 +34835,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.'); @@ -35263,9 +34844,6 @@ 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.'); } @@ -35275,21 +34853,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}'; 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(this.client.apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -35314,7 +34892,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); @@ -35324,12 +34902,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) { @@ -35342,25 +34921,65 @@ 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 Create a deployment for an app, or a deployment slot. * - * Stop a continuous web job 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. * @@ -35373,13 +34992,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 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 _stopContinuousWebJobSlot(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') { @@ -35389,6 +35009,7 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35411,18 +35032,18 @@ 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 (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.'); } @@ -35432,21 +35053,21 @@ 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}/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(this.client.apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -35464,14 +35085,28 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op } } } - 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); @@ -35481,12 +35116,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) { @@ -35499,23 +35135,42 @@ 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['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 List deployments for an app, or a deployment slot. + * @summary Delete a deployment by its ID for an app, or a deployment slot. * - * List deployments 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 returns deployments for the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -35528,14 +35183,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. + * {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 _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) { +function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35545,6 +35199,7 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35567,15 +35222,15 @@ function _listDeploymentsSlot(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 (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.'); } @@ -35585,20 +35240,21 @@ 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}/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(this.client.apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -35623,7 +35279,7 @@ function _listDeploymentsSlot(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); @@ -35633,13 +35289,12 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -35652,42 +35307,29 @@ function _listDeploymentsSlot(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['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 Get a deployment by its ID for an app, or a deployment slot. + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. * - * Get a deployment by its ID 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 Deployment ID. + * @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 gets a deployment for the production slot. + * specified, the API returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -35707,7 +35349,7 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback) { +function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35717,6 +35359,7 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35748,9 +35391,6 @@ 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.'); } @@ -35760,14 +35400,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}/deployments/{id}/log'; 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -35851,42 +35491,61 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback } /** - * @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} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API creates a deployment for the production slot. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {object} deployment Deployment details. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @param {number} [deployment.status] Deployment status. + * @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} [deployment.message] Details about deployment status. + * @param {string} [request.siteName] Name of an app. * - * @param {string} [deployment.author] Who authored the deployment. + * @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} [deployment.deployer] Who performed the deployment. + * @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} [deployment.authorEmail] Author email. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * @param {date} [deployment.startTime] Start time. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * @param {date} [deployment.endTime] End time. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {boolean} [deployment.active] True if deployment is currently active, - * false if completed and null if not started. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} [deployment.details] Details on deployment. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @param {string} [deployment.kind] Kind of resource. + * @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. * @@ -35900,13 +35559,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 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 _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, options, callback) { +function _discoverBackupSlot(resourceGroupName, name, request, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35916,6 +35575,7 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35938,21 +35598,15 @@ 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 (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 (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.'); } @@ -35962,21 +35616,20 @@ 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}/discoverbackup'; 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(this.client.apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -35998,14 +35651,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 (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(deployment, null, 2)}.`); + `payload - ${JSON.stringify(request, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -36051,7 +35704,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['RestoreRequest']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -36067,19 +35720,17 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op } /** - * @summary Delete a deployment by its ID for an app, or a deployment slot. + * @summary Lists ownership identifiers for domain associated with web app. * - * Delete a deployment by its ID 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. * * @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 will delete the binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -36092,13 +35743,14 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op * * {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 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 _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callback) { +function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -36108,6 +35760,7 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36130,18 +35783,12 @@ 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 (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.'); } @@ -36151,21 +35798,20 @@ 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'; 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -36190,7 +35836,7 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callb 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); @@ -36200,12 +35846,13 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, 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) { @@ -36218,29 +35865,43 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, 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['IdentifierCollection']().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 deployment log for specific deployment for an app, or a - * deployment slot. + * @summary Get domain ownership identifier for web app. * - * List deployment log for specific deployment 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 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 {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. * @@ -36254,13 +35915,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 _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -36270,6 +35931,7 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36292,8 +35954,8 @@ 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 (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); @@ -36301,9 +35963,6 @@ 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.'); } @@ -36313,14 +35972,14 @@ 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -36388,7 +36047,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) { @@ -36404,61 +36063,30 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call } /** - * @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. + * @summary 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. + * 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 {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 {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. * - * @param {boolean} [request.adjustConnectionStrings] true if - * SiteConfig.ConnectionStrings should be set in new app; otherwise, - * false. + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. * - * @param {string} [request.hostingEnvironment] App Service Environment name, - * if needed (only when restoring an app to an App Service Environment). + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. * - * @param {string} [request.kind] Kind of resource. + * @param {string} [domainOwnershipIdentifier.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 delete the binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -36472,13 +36100,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 RestoreRequest} 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 _discoverBackupSlot(resourceGroupName, name, request, slot, options, callback) { +function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -36488,6 +36116,7 @@ function _discoverBackupSlot(resourceGroupName, name, request, slot, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36510,8 +36139,11 @@ function _discoverBackupSlot(resourceGroupName, name, request, 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 (request === null || request === undefined) { - throw new Error('request cannot be null or undefined.'); + 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.'); @@ -36519,9 +36151,6 @@ function _discoverBackupSlot(resourceGroupName, name, request, slot, 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.'); } @@ -36531,20 +36160,21 @@ function _discoverBackupSlot(resourceGroupName, name, request, 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}/discoverbackup'; + 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('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -36566,14 +36196,14 @@ function _discoverBackupSlot(resourceGroupName, name, request, slot, options, ca 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 (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(request, null, 2)}.`); + `payload - ${JSON.stringify(domainOwnershipIdentifier, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -36619,7 +36249,7 @@ function _discoverBackupSlot(resourceGroupName, name, request, slot, options, ca 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['Identifier']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -36635,15 +36265,18 @@ function _discoverBackupSlot(resourceGroupName, name, request, slot, options, ca } /** - * @summary Lists ownership identifiers for domain associated with web app. + * @summary Deletes a domain ownership identifier for a web app. * - * Lists ownership identifiers for domain associated with web app. + * 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} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * * @param {string} slot Name of the deployment slot. If a slot is not * specified, the API will delete the binding for the production slot. * @@ -36658,14 +36291,13 @@ function _discoverBackupSlot(resourceGroupName, name, request, 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 IdentifierCollection} 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 _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, options, callback) { +function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -36675,6 +36307,7 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36697,15 +36330,15 @@ function _listDomainOwnershipIdentifiersSlot(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 (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.'); } @@ -36715,20 +36348,21 @@ 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}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; 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(this.client.apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -36753,7 +36387,7 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti 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); @@ -36763,13 +36397,12 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -36782,32 +36415,17 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, 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['IdentifierCollection']().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 domain ownership identifier for web app. + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. * - * Get domain ownership identifier for web app. + * 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. @@ -36817,6 +36435,14 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti * @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 will delete the binding for the production slot. * @@ -36838,7 +36464,7 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, callback) { +function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -36848,6 +36474,7 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36873,15 +36500,15 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners 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.'); } @@ -36898,14 +36525,14 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -36923,7 +36550,21 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners } } } - 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) { @@ -36982,30 +36623,17 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners } /** - * @summary Creates a domain ownership identifier for web app, or updates an - * existing ownership identifier. + * @summary Get the status of the last MSDeploy operation. * - * Creates a domain ownership identifier for web app, or updates an existing - * ownership identifier. + * 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} 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 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. * @@ -37019,13 +36647,13 @@ 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 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 _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, callback) { +function _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -37035,6 +36663,7 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -37057,21 +36686,12 @@ 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.'); } @@ -37081,21 +36701,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}/extensions/MSDeploy'; 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(this.client.apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -37113,21 +36732,7 @@ 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) { @@ -37170,7 +36775,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['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -37185,21 +36790,47 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d }); } + /** - * @summary Deletes a domain ownership identifier for a web app. + * @summary Invoke the MSDeploy web app extension. * - * Deletes a domain ownership identifier for a 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. * @@ -37212,22 +36843,107 @@ 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. + * {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 _deleteDomainOwnershipIdentifierSlot(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') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -37250,18 +36966,12 @@ 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.'); } @@ -37271,21 +36981,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}/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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -37310,7 +37019,7 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn 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); @@ -37338,36 +37047,40 @@ 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 = 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 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. * @@ -37381,13 +37094,14 @@ 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 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 _updateDomainOwnershipIdentifierSlot(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') { @@ -37397,6 +37111,7 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -37419,21 +37134,12 @@ 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 (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.'); } @@ -37443,21 +37149,20 @@ 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'; 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -37475,28 +37180,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); @@ -37506,13 +37197,12 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -37532,7 +37222,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['FunctionEnvelopeCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -37548,9 +37238,9 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn } /** - * @summary Get the status of the last MSDeploy operation. + * @summary Fetch a short lived token that can be exchanged for a master key. * - * Get the status of the last MSDeploy operation. + * 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. @@ -37571,14 +37261,13 @@ 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. + * {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 _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback) { +function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -37588,6 +37277,7 @@ function _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -37616,9 +37306,6 @@ function _getMSDeployStatusSlot(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.'); } @@ -37628,13 +37315,13 @@ 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/admin/token'; 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)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -37702,7 +37389,13 @@ function _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MSDeployStatus']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -37717,130 +37410,21 @@ function _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback }); } - /** - * @summary Invoke the MSDeploy web app extension. + * @summary Get function information by its ID for web site, or a deployment + * slot. * - * Invoke the MSDeploy web app extension. + * 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 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. * @@ -37854,13 +37438,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 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 _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { +function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -37870,6 +37454,7 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -37892,15 +37477,15 @@ 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.'); } @@ -37910,13 +37495,14 @@ 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}'; 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -37983,7 +37569,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['FunctionEnvelope']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -37998,19 +37584,45 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { }); } + /** - * @summary List the functions for a web site, or a deployment slot. + * @summary Create function for web site, or a deployment slot. * - * List the functions for a web site, or a deployment slot. + * 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 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} 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. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -38023,14 +37635,97 @@ 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 - * 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 _listInstanceFunctionsSlot(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') { @@ -38040,6 +37735,7 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38062,15 +37758,15 @@ function _listInstanceFunctionsSlot(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 (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.'); } @@ -38080,20 +37776,21 @@ 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}/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(this.client.apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -38118,7 +37815,7 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call 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); @@ -38146,40 +37843,26 @@ function _listInstanceFunctionsSlot(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['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 Get function secrets for a function in a web site, or a deployment + * slot. * - * Fetch a short lived token that can be exchanged for a master key. + * 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} 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} [options] Optional Parameters. * @@ -38192,13 +37875,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 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 _getFunctionsAdminTokenSlot(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') { @@ -38208,6 +37892,7 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38230,15 +37915,15 @@ function _getFunctionsAdminTokenSlot(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 (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.'); } @@ -38248,20 +37933,21 @@ 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}/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(this.client.apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -38322,13 +38008,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['FunctionSecrets']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -38344,20 +38024,17 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, cal } /** - * @summary Get function information by its ID for web site, or a deployment - * slot. + * @summary Get hostname bindings for an app or a deployment slot. * - * Get function information by its ID for 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} 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. + * specified, the API gets hostname bindings for the production slot. * * @param {object} [options] Optional Parameters. * @@ -38371,13 +38048,14 @@ 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 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 _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, callback) { +function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -38387,6 +38065,7 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38409,18 +38088,12 @@ 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 (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.'); } @@ -38430,14 +38103,13 @@ 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'; 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -38469,7 +38141,7 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, 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); @@ -38479,12 +38151,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) { @@ -38504,7 +38177,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['HostNameBindingCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -38519,44 +38192,22 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, o }); } - /** - * @summary Create function for web site, or a deployment slot. + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). * - * Create function for web site, or a deployment slot. + * 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 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.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. + * specified, the API the named binding for the production slot. * - * @param {string} [functionEnvelope.kind] Kind of resource. + * @param {string} hostName Hostname in the hostname binding. * * @param {object} [options] Optional Parameters. * @@ -38570,97 +38221,13 @@ function _getInstanceFunctionSlot(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 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. - * - * @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. + * 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 _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, callback) { +function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -38670,6 +38237,7 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38692,18 +38260,15 @@ 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.'); } @@ -38713,21 +38278,21 @@ 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -38752,7 +38317,7 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot 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); @@ -38762,12 +38327,13 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, 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) { @@ -38780,26 +38346,68 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, 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['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 Get function secrets for a function in a web site, or a deployment - * slot. + * @summary Creates a hostname binding for an app. * - * Get function secrets for a function in a 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. * @@ -38813,13 +38421,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 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 _listFunctionSecretsSlot(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') { @@ -38829,6 +38437,7 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38851,8 +38460,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 (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.'); @@ -38860,9 +38472,6 @@ 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.'); } @@ -38872,21 +38481,21 @@ 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}/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(this.client.apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -38904,7 +38513,21 @@ function _listFunctionSecretsSlot(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) { @@ -38947,7 +38570,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['HostNameBinding']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -38963,9 +38586,9 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o } /** - * @summary Get hostname bindings for an app or a deployment slot. + * @summary Deletes a hostname binding for an app. * - * Get hostname bindings for an app or a deployment slot. + * Deletes a hostname binding for an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -38973,7 +38596,9 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o * @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 delete the binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. * * @param {object} [options] Optional Parameters. * @@ -38986,15 +38611,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. + * {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 _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callback) { +function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -39004,6 +38627,7 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -39029,12 +38653,12 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callb 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.'); } @@ -39044,20 +38668,21 @@ 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}/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(this.client.apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -39082,7 +38707,7 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callb 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); @@ -39092,13 +38717,12 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -39111,44 +38735,27 @@ function _listHostNameBindingsSlot(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['HostNameBindingCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Get the named hostname binding for an app (or deployment slot, if - * specified). + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. * - * Get the named hostname binding for an app (or deployment slot, if - * specified). + * 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 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. * @@ -39162,13 +38769,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. + * 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 _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, callback) { +function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -39178,6 +38785,7 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, option if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -39200,18 +38808,18 @@ 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.'); } @@ -39221,14 +38829,15 @@ 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -39296,7 +38905,7 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, option 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) { @@ -39312,45 +38921,48 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, option } /** - * @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. * @@ -39364,13 +38976,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 _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -39380,6 +38992,7 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -39402,11 +39015,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.'); @@ -39414,9 +39030,6 @@ 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.'); } @@ -39426,14 +39039,15 @@ 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -39462,14 +39076,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; @@ -39515,7 +39129,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) { @@ -39531,19 +39145,20 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h } /** - * @summary Deletes a hostname binding for an app. + * @summary Removes a Hybrid Connection from this site. * - * Deletes a hostname binding for an app. + * 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 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. * @@ -39562,7 +39177,7 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteHostNameBindingSlot(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') { @@ -39572,6 +39187,7 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -39594,18 +39210,18 @@ 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.'); } @@ -39615,14 +39231,15 @@ 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}'; 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -39654,7 +39271,7 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt 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); @@ -39688,10 +39305,9 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt } /** - * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web - * App. + * @summary Creates a new Hybrid Connection using a Service Bus relay. * - * Retrieves a specific Service Bus Hybrid Connection 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. @@ -39702,6 +39318,34 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt * * @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. @@ -39722,7 +39366,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 _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -39732,6 +39376,7 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -39760,15 +39405,15 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN 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.'); } @@ -39786,14 +39431,14 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -39811,7 +39456,21 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN } } } - 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) { @@ -39870,9 +39529,9 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN } /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. + * @summary Gets the send key name and value for a Hybrid Connection. * - * Creates a new Hybrid Connection using a Service Bus relay. + * Gets the send key name and value for a Hybrid Connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -39883,34 +39542,6 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN * * @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. @@ -39925,13 +39556,13 @@ 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 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 _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, callback) { +function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -39941,6 +39572,7 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -39969,18 +39601,12 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN 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.'); } @@ -39990,7 +39616,7 @@ 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}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); @@ -39998,14 +39624,14 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -40023,21 +39649,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) { @@ -40080,7 +39692,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['HybridConnectionKey']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -40096,19 +39708,15 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN } /** - * @summary Removes a Hybrid Connection from this site. + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. * - * Removes a Hybrid Connection from this site. + * 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. @@ -40122,13 +39730,14 @@ 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 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 _deleteHybridConnectionSlot(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') { @@ -40138,6 +39747,7 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40160,21 +39770,12 @@ 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 (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.'); } @@ -40184,22 +39785,20 @@ 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}/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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -40224,7 +39823,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); @@ -40234,12 +39833,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) { @@ -40252,54 +39852,42 @@ 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['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 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. * @@ -40313,13 +39901,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 _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -40329,6 +39918,7 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40351,24 +39941,12 @@ 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 (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.'); } @@ -40378,22 +39956,20 @@ 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'; 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -40411,21 +39987,7 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel } } } - // 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) { @@ -40468,7 +40030,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) { @@ -40484,20 +40046,19 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel } /** - * @summary Gets the send key name and value for a Hybrid Connection. + * @summary Gets a hybrid connection configuration by its name. * - * Gets the send key name and value for a Hybrid Connection. + * 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. * @@ -40511,13 +40072,14 @@ 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. + * 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 _listHybridConnectionKeysSlot(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') { @@ -40527,6 +40089,7 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40549,11 +40112,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.'); @@ -40561,9 +40121,6 @@ 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.'); } @@ -40573,22 +40130,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(this.client.apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -40649,7 +40205,7 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r 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['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -40665,16 +40221,41 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r } /** - * @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. * @@ -40688,13 +40269,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 _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -40704,6 +40286,7 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40726,15 +40309,18 @@ 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.'); } @@ -40744,20 +40330,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(this.client.apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -40775,7 +40362,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) { @@ -40818,7 +40419,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) { @@ -40834,19 +40435,19 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call } /** - * @summary Gets hybrid connections configured for an app (or deployment slot, - * if specified). + * @summary Deletes a relay service connection by its name. * - * Gets hybrid connections configured for an app (or deployment slot, if - * specified). + * 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 the app. * + * @param {string} entityName Name of the hybrid connection configuration. + * * @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 will delete a hybrid connection for the production slot. * * @param {object} [options] Optional Parameters. * @@ -40859,15 +40460,13 @@ 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 - * 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 _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, callback) { +function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -40877,6 +40476,7 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40899,15 +40499,15 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, 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 (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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -40917,20 +40517,21 @@ 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}/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(this.client.apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -40955,7 +40556,7 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options 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); @@ -40965,13 +40566,12 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -40984,42 +40584,47 @@ function _listRelayServiceConnectionsSlot(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['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 configuration (PUT), or updates an + * existing one (PATCH). * - * Gets a hybrid connection configuration by its name. + * 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 the app. * - * @param {string} entityName Name of the hybrid connection. + * @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 get a hybrid connection for the production slot. + * specified, the API will create or update a hybrid connection for the + * production slot. * * @param {object} [options] Optional Parameters. * @@ -41040,7 +40645,7 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, callback) { +function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41050,6 +40655,7 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -41075,15 +40681,15 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo 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.'); } @@ -41100,14 +40706,14 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -41125,7 +40731,21 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo } } } - 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) { @@ -41184,41 +40804,17 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo } /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). + * @summary Gets all scale-out instances of an app. * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). + * Gets all scale-out instances 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} 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. + * specified, the API gets the production slot instances. * * @param {object} [options] Optional Parameters. * @@ -41232,14 +40828,14 @@ 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 + * 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 _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, callback) { +function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41249,6 +40845,7 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -41271,21 +40868,12 @@ 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -41295,21 +40883,20 @@ 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'; 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(this.client.apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -41327,21 +40914,7 @@ 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) { @@ -41384,7 +40957,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['WebAppInstanceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -41400,19 +40973,19 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti } /** - * @summary Deletes a relay service connection by its name. + * @summary Get the status of the last MSDeploy operation. * - * Deletes a relay service connection 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 configuration. + * @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 a hybrid connection for the production slot. + * @param {string} instanceId ID of web app instance. * * @param {object} [options] Optional Parameters. * @@ -41425,13 +40998,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 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 _deleteRelayServiceConnectionSlot(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') { @@ -41441,6 +41015,7 @@ function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -41463,18 +41038,15 @@ 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.'); } @@ -41484,21 +41056,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}/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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -41523,7 +41095,7 @@ function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, 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); @@ -41533,12 +41105,13 @@ function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -41551,47 +41124,71 @@ 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['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 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. * @@ -41605,14 +41202,98 @@ 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 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 _updateRelayServiceConnectionSlot(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') { @@ -41622,6 +41303,7 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -41644,21 +41326,15 @@ 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 (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.'); } @@ -41668,21 +41344,21 @@ 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}/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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -41700,28 +41376,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); @@ -41731,13 +41393,12 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -41757,7 +41418,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['MSDeployLog']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -41773,17 +41434,23 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, } /** - * @summary Gets all scale-out instances 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 all scale-out instances of an app. + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. * * @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 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. * @@ -41797,14 +41464,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. + * 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 _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, callback) { +function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41814,6 +41480,7 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -41839,12 +41506,12 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, ca 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.'); } @@ -41854,13 +41521,14 @@ 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'; 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)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -41892,7 +41560,7 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, 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); @@ -41902,13 +41570,12 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, ca try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -41928,7 +41595,7 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, ca 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['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -41944,19 +41611,25 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, ca } /** - * @summary Get the status of the last MSDeploy operation. + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. * - * Get the status of the last MSDeploy operation. + * 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 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. * @@ -41970,13 +41643,13 @@ 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. + * 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 _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, callback) { +function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41986,6 +41659,7 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42008,6 +41682,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.'); } @@ -42017,9 +41694,6 @@ 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.'); } @@ -42029,14 +41703,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}'; 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -42068,7 +41743,7 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI 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); @@ -42078,13 +41753,12 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -42104,7 +41778,7 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI 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['ProcessInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -42119,134 +41793,26 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI }); } - /** - * @summary Invoke the MSDeploy web app extension. + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. * - * Invoke the MSDeploy web app extension. + * 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 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. * @@ -42259,14 +41825,13 @@ 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. + * {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 _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, callback) { +function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -42276,6 +41841,7 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42298,6 +41864,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.'); } @@ -42307,9 +41876,6 @@ 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.'); } @@ -42319,21 +41885,22 @@ 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}'; 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(this.client.apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -42358,7 +41925,7 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, 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); @@ -42386,40 +41953,191 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, // 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 {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. + * + * @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 _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, 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 = '2018-02-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 (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.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}/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)); + 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['MSDeployLog']().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 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. * @@ -42439,13 +42157,14 @@ 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 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 _listInstanceProcessesSlot(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') { @@ -42455,6 +42174,7 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42477,6 +42197,9 @@ 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 (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } @@ -42486,9 +42209,6 @@ 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.'); } @@ -42498,14 +42218,15 @@ 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'; 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -42572,7 +42293,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['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -42601,6 +42322,8 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, o * * @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. * @@ -42620,13 +42343,13 @@ 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 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 _getInstanceProcessSlot(resourceGroupName, name, processId, 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') { @@ -42636,6 +42359,7 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42661,6 +42385,9 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta 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.'); } @@ -42670,9 +42397,6 @@ 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.'); } @@ -42682,15 +42406,16 @@ 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}/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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -42757,7 +42482,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['ProcessModuleInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -42773,11 +42498,11 @@ 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. + * @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. @@ -42804,13 +42529,15 @@ 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 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 _deleteInstanceProcessSlot(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') { @@ -42820,6 +42547,7 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42854,9 +42582,6 @@ 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.'); } @@ -42866,7 +42591,7 @@ 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'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); @@ -42874,14 +42599,14 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -42906,7 +42631,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); @@ -42934,17 +42659,34 @@ 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['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. @@ -42953,6 +42695,8 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in * * @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. * @@ -42972,12 +42716,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 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 _getInstanceProcessDumpSlot(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') { @@ -42987,6 +42732,7 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43012,6 +42758,9 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i 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.'); } @@ -43021,9 +42770,6 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -43033,15 +42779,16 @@ 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}/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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -43068,22 +42815,20 @@ 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}`); + 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; @@ -43100,33 +42845,45 @@ 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['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 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. + * 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} 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 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} slot Name of the deployment slot. By default, this API + * returns information on the production slot. * * @param {object} [options] Optional Parameters. * @@ -43140,14 +42897,13 @@ 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 - * 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 _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { +function _isCloneableSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -43157,6 +42913,7 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43179,21 +42936,12 @@ 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.'); } @@ -43203,22 +42951,20 @@ 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}/iscloneable'; 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(this.client.apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -43243,7 +42989,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); @@ -43253,12 +42999,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) { @@ -43278,7 +43025,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['SiteCloneability']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -43294,27 +43041,17 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary 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. + * 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 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 restore a backup of the production slot. * * @param {object} [options] Optional Parameters. * @@ -43328,13 +43065,13 @@ 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 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 _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, callback) { +function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -43344,6 +43081,7 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43366,24 +43104,12 @@ 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -43393,23 +43119,20 @@ 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}/listsyncfunctiontriggerstatus'; 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(this.client.apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -43434,7 +43157,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); @@ -43444,12 +43167,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) { @@ -43469,7 +43193,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['FunctionSecrets']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -43485,25 +43209,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 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. + * 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. * @@ -43517,14 +43234,14 @@ 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 + * 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 _listInstanceProcessThreadsSlot(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') { @@ -43534,6 +43251,7 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43556,21 +43274,12 @@ 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.'); } @@ -43580,15 +43289,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}/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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -43620,7 +43327,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); @@ -43630,12 +43337,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) { @@ -43655,7 +43363,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['ResourceMetricDefinitionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -43671,30 +43379,29 @@ 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 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. + * 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} 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. - * - * @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 * @@ -43705,13 +43412,14 @@ 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 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 _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, callback) { +function _listMetricsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -43721,6 +43429,9 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43743,24 +43454,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 (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.'); } @@ -43770,16 +43475,19 @@ 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}/metrics'; 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(this.client.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(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -43811,7 +43519,7 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa 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); @@ -43821,12 +43529,13 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -43846,7 +43555,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['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -43862,19 +43571,18 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa } /** - * @summary Shows whether an app can be cloned to another resource group or - * subscription. + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled * - * Shows whether an app can be cloned to another resource group or - * subscription. + * 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 the app. + * @param {string} name Name of web app. * - * @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. * * @param {object} [options] Optional Parameters. * @@ -43888,13 +43596,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. + * 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 _isCloneableSlot(resourceGroupName, name, slot, options, callback) { +function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -43904,6 +43612,7 @@ function _isCloneableSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43932,9 +43641,6 @@ function _isCloneableSlot(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.'); } @@ -43944,20 +43650,20 @@ 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}/migratemysql/status'; 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)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -44018,7 +43724,7 @@ 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 = new client.models['MigrateMySqlStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -44034,9 +43740,9 @@ function _isCloneableSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary This is to allow calling via powershell and ARM template. + * @summary Gets a Swift Virtual Network connection. * - * This is to allow calling via powershell and ARM template. + * Gets a Swift Virtual Network connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -44044,7 +43750,8 @@ function _isCloneableSlot(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 restore a backup of the production slot. + * specified, the API will get a gateway for the production slot's Virtual + * Network. * * @param {object} [options] Optional Parameters. * @@ -44058,13 +43765,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. + * 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 _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, callback) { +function _getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -44074,6 +43781,7 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -44102,9 +43810,6 @@ 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.'); } @@ -44114,20 +43819,20 @@ 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}/networkConfig/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(this.client.apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -44188,7 +43893,7 @@ 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 = new client.models['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -44204,18 +43909,35 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c } /** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). + * @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 all metric definitions of an app (or deployment slot, if specified). + * 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 metric definitions of the production slot. + * specified, the API will add or update connections for the production slot. * * @param {object} [options] Optional Parameters. * @@ -44229,14 +43951,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. + * 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 _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, callback) { +function _createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -44246,6 +43967,7 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -44268,15 +43990,15 @@ function _listMetricDefinitionsSlot(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 (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.'); } @@ -44286,20 +44008,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}/networkConfig/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(this.client.apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -44317,7 +44039,21 @@ function _listMetricDefinitionsSlot(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['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) { @@ -44360,7 +44096,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['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -44376,10 +44112,10 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, call } /** - * @summary Gets performance metrics of an app (or deployment slot, if - * specified). + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). * - * Gets performance metrics of an app (or deployment slot, if specified). + * 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. @@ -44387,18 +44123,10 @@ function _listMetricDefinitionsSlot(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 metrics of the production slot. + * specified, the API will delete the connection for 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 * @@ -44408,15 +44136,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. + * {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 _listMetricsSlot(resourceGroupName, name, slot, options, callback) { +function _deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -44426,8 +44152,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -44453,18 +44178,9 @@ 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.'); } @@ -44474,26 +44190,20 @@ 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}/networkConfig/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 = []; - 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)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -44518,7 +44228,7 @@ function _listMetricsSlot(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); @@ -44528,13 +44238,12 @@ function _listMetricsSlot(resourceGroupName, name, slot, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -44547,41 +44256,41 @@ function _listMetricsSlot(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['ResourceMetricCollection']().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 + * @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. * - * Returns the status of MySql in app migration, if one is active, and whether - * or not MySql in app is enabled + * 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 web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of the deployment slot. + * @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. * @@ -44595,13 +44304,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 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 _getMigrateMySqlStatusSlot(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') { @@ -44611,6 +44320,7 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -44633,15 +44343,15 @@ function _getMigrateMySqlStatusSlot(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 (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.'); } @@ -44651,20 +44361,20 @@ 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}/networkConfig/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(this.client.apiVersion)); + 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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -44682,7 +44392,21 @@ function _getMigrateMySqlStatusSlot(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['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) { @@ -44725,7 +44449,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['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -44786,6 +44510,7 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -44817,9 +44542,6 @@ 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.'); } @@ -44836,7 +44558,7 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -44946,7 +44668,7 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -44962,6 +44684,7 @@ function _getNetworkTraceOperationSlot(resourceGroupName, name, operationId, slo if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -44993,9 +44716,6 @@ function _getNetworkTraceOperationSlot(resourceGroupName, name, operationId, slo if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -45012,7 +44732,7 @@ function _getNetworkTraceOperationSlot(resourceGroupName, name, operationId, slo requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -45111,7 +44831,21 @@ function _getNetworkTraceOperationSlot(resourceGroupName, name, operationId, slo parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Operation']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -45176,6 +44910,7 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -45213,9 +44948,6 @@ function _startWebSiteNetworkTraceSlot(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.'); } @@ -45240,7 +44972,7 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c if (sasUrl !== null && sasUrl !== undefined) { queryParameters.push('sasUrl=' + encodeURIComponent(sasUrl)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -45361,7 +45093,7 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -45408,7 +45140,15 @@ function _startWebSiteNetworkTraceOperationSlot(resourceGroupName, name, slot, o required: false, serializedName: 'parsedResponse', type: { - name: 'Object' + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } } }; result = client.deserialize(resultMapper, parsedResponse, 'result'); @@ -45464,6 +45204,7 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -45492,9 +45233,6 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, 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.'); } @@ -45510,7 +45248,7 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, ca requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -45619,6 +45357,7 @@ function _getNetworkTracesSlot(resourceGroupName, name, operationId, slot, optio if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -45650,9 +45389,6 @@ function _getNetworkTracesSlot(resourceGroupName, name, operationId, 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.'); } @@ -45669,7 +45405,7 @@ function _getNetworkTracesSlot(resourceGroupName, name, operationId, slot, optio requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -45794,7 +45530,7 @@ function _getNetworkTracesSlot(resourceGroupName, name, operationId, 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. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -45810,6 +45546,7 @@ function _getNetworkTraceOperationSlotV2(resourceGroupName, name, operationId, s if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -45841,9 +45578,6 @@ function _getNetworkTraceOperationSlotV2(resourceGroupName, name, operationId, s if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -45860,7 +45594,7 @@ function _getNetworkTraceOperationSlotV2(resourceGroupName, name, operationId, s requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -45959,7 +45693,21 @@ function _getNetworkTraceOperationSlotV2(resourceGroupName, name, operationId, s parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Operation']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -46018,6 +45766,7 @@ function _getNetworkTracesSlotV2(resourceGroupName, name, operationId, slot, opt if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46049,9 +45798,6 @@ function _getNetworkTracesSlotV2(resourceGroupName, name, operationId, 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.'); } @@ -46068,7 +45814,7 @@ function _getNetworkTracesSlotV2(resourceGroupName, name, operationId, slot, opt requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -46208,6 +45954,7 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46236,9 +45983,6 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, 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.'); } @@ -46254,7 +45998,7 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -46367,6 +46111,7 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46398,9 +46143,6 @@ function _listPerfMonCountersSlot(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.'); } @@ -46419,7 +46161,7 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -46543,6 +46285,7 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46571,9 +46314,6 @@ function _getSitePhpErrorLogFlagSlot(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.'); } @@ -46589,7 +46329,7 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -46713,6 +46453,7 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46741,9 +46482,6 @@ 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.'); } @@ -46759,7 +46497,7 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -46885,6 +46623,7 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46916,9 +46655,6 @@ 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.'); } @@ -46935,7 +46671,7 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -47082,6 +46818,7 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47116,9 +46853,6 @@ 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.'); } @@ -47135,7 +46869,7 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -47274,6 +47008,7 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47305,9 +47040,6 @@ 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.'); } @@ -47324,7 +47056,7 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -47449,6 +47181,7 @@ function _updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, prem if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47483,9 +47216,6 @@ function _updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, prem if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -47502,7 +47232,7 @@ function _updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, prem requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -47641,6 +47371,7 @@ function _getPrivateAccessSlot(resourceGroupName, name, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47669,9 +47400,6 @@ function _getPrivateAccessSlot(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.'); } @@ -47687,7 +47415,7 @@ function _getPrivateAccessSlot(resourceGroupName, name, slot, options, callback) requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -47821,6 +47549,7 @@ function _putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, option if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47852,9 +47581,6 @@ function _putPrivateAccessVnetSlot(resourceGroupName, name, access, 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.'); } @@ -47870,7 +47596,7 @@ function _putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, option requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -48010,6 +47736,7 @@ function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48038,9 +47765,6 @@ function _listProcessesSlot(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.'); } @@ -48056,7 +47780,7 @@ function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -48183,6 +47907,7 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48214,9 +47939,6 @@ function _getProcessSlot(resourceGroupName, name, processId, 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.'); } @@ -48233,7 +47955,7 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -48359,6 +48081,7 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48390,9 +48113,6 @@ 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.'); } @@ -48409,7 +48129,7 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -48518,6 +48238,7 @@ function _getProcessDumpSlot(resourceGroupName, name, processId, slot, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48549,9 +48270,6 @@ function _getProcessDumpSlot(resourceGroupName, name, processId, 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.'); } @@ -48568,7 +48286,7 @@ function _getProcessDumpSlot(resourceGroupName, name, processId, slot, options, requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -48680,6 +48398,7 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48711,9 +48430,6 @@ function _listProcessModulesSlot(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.'); } @@ -48730,7 +48446,7 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -48859,6 +48575,7 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48893,9 +48610,6 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -48913,7 +48627,7 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -49041,6 +48755,7 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49072,9 +48787,6 @@ 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.'); } @@ -49091,7 +48803,7 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -49220,6 +48932,7 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49254,9 +48967,6 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -49274,7 +48984,7 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -49398,6 +49108,7 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49426,9 +49137,6 @@ 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 (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -49444,7 +49152,7 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -49572,6 +49280,7 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49603,9 +49312,6 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -49622,7 +49328,7 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -49759,6 +49465,7 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49793,9 +49500,6 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -49812,7 +49516,7 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -49951,6 +49655,7 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49982,9 +49687,6 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -50001,7 +49703,7 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -50120,6 +49822,7 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, publi if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -50151,9 +49854,6 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, publi if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -50169,7 +49869,7 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, publi requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -50292,6 +49992,7 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -50320,9 +50021,6 @@ function _resetSlotConfigurationSlot(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.'); } @@ -50338,7 +50036,7 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -50453,6 +50151,7 @@ function _restartSlot(resourceGroupName, name, slot, options, callback) { } let softRestart = (options && options.softRestart !== undefined) ? options.softRestart : undefined; let synchronous = (options && options.synchronous !== undefined) ? options.synchronous : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -50487,9 +50186,6 @@ function _restartSlot(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.'); } @@ -50511,7 +50207,7 @@ function _restartSlot(resourceGroupName, name, slot, options, callback) { if (synchronous !== null && synchronous !== undefined) { queryParameters.push('synchronous=' + encodeURIComponent(synchronous.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -50709,6 +50405,9 @@ function _restoreFromBackupBlobSlot(resourceGroupName, name, request, slot, opti * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -50811,6 +50510,9 @@ function _restoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slo * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -50913,6 +50615,7 @@ function _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -50941,9 +50644,6 @@ 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.'); } @@ -50959,7 +50659,7 @@ function _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callbac requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -51086,6 +50786,7 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51117,9 +50818,6 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, 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.'); } @@ -51136,7 +50834,7 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, o requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -51346,6 +51044,7 @@ function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51377,9 +51076,6 @@ function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, 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.'); } @@ -51396,7 +51092,7 @@ function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -51513,6 +51209,269 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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 (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.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}/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 = []; + 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]; + } + } + } + // 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + 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['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. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} 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. + * + * @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) { + /* 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51535,18 +51494,12 @@ 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 (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.'); } @@ -51556,20 +51509,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}/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(this.client.apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -51587,21 +51540,7 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, } } } - // 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) { @@ -51644,7 +51583,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['SnapshotCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -51659,88 +51598,10 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, }); } - /** - * @summary Swaps two deployment slots of an app. + * @summary Returns all Snapshots to the user from DRSecondary endpoint. * - * Swaps two deployment slots of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} slotSwapEntity JSON object that contains the target slot - * name. See example. - * - * @param {string} slotSwapEntity.targetSlot Destination deployment slot during - * swap operation. - * - * @param {boolean} slotSwapEntity.preserveVnet true to preserve - * Virtual Network to the slot during swap; otherwise, false. - * - * @param {string} slot Name of the source slot. If a slot is not specified, - * the production slot is used as the source slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} 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. + * Returns all Snapshots to the user from DRSecondary endpoint. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -51767,7 +51628,7 @@ function _swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, c * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listSnapshotsSlot(resourceGroupName, name, slot, options, callback) { +function _listSnapshotsFromDRSecondarySlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -51777,6 +51638,7 @@ function _listSnapshotsSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51805,9 +51667,6 @@ 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.'); } @@ -51817,13 +51676,13 @@ 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}/snapshotsdr'; 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)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -51948,6 +51807,7 @@ function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51976,9 +51836,6 @@ 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.'); } @@ -51994,7 +51851,7 @@ function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -52259,6 +52116,7 @@ function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callba if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52287,9 +52145,6 @@ 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.'); } @@ -52305,7 +52160,7 @@ function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callba requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -52434,6 +52289,7 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52465,9 +52321,6 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, 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.'); } @@ -52483,7 +52336,7 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -52654,6 +52507,7 @@ function _startSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52682,9 +52536,6 @@ function _startSlot(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.'); } @@ -52700,7 +52551,7 @@ function _startSlot(resourceGroupName, name, slot, options, callback) { requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -52797,7 +52648,7 @@ function _startSlot(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. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -52844,7 +52695,15 @@ function _startNetworkTraceSlot(resourceGroupName, name, slot, options, callback required: false, serializedName: 'parsedResponse', type: { - name: 'Object' + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } } }; result = client.deserialize(resultMapper, parsedResponse, 'result'); @@ -52901,6 +52760,7 @@ function _stopSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52929,9 +52789,6 @@ function _stopSlot(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.'); } @@ -52947,7 +52804,7 @@ function _stopSlot(resourceGroupName, name, slot, options, callback) { requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -53051,6 +52908,7 @@ function _stopNetworkTraceSlot(resourceGroupName, name, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53079,9 +52937,6 @@ function _stopNetworkTraceSlot(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.'); } @@ -53097,7 +52952,7 @@ function _stopNetworkTraceSlot(resourceGroupName, name, slot, options, callback) requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -53163,17 +53018,166 @@ function _stopNetworkTraceSlot(resourceGroupName, name, slot, options, callback) } /** - * @summary Sync web app repository. + * @summary Sync web app repository. + * + * Sync web app repository. + * + * @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. + * + * {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 _syncRepositorySlot(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 apiVersion = '2018-02-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 (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.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}/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)); + 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 Syncs function trigger metadata to the scale controller * - * Sync web app repository. + * 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 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 restore a backup of the production slot. * * @param {object} [options] Optional Parameters. * @@ -53192,7 +53196,7 @@ function _stopNetworkTraceSlot(resourceGroupName, name, slot, options, callback) * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { +function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53202,6 +53206,7 @@ function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53230,9 +53235,6 @@ function _syncRepositorySlot(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.'); } @@ -53242,13 +53244,13 @@ 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}/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)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -53280,7 +53282,7 @@ function _syncRepositorySlot(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); @@ -53314,17 +53316,17 @@ function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Syncs function trigger metadata to the scale controller + * @summary List triggered web jobs for an app, or a deployment slot. * - * Syncs function trigger metadata to the scale controller + * 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 {string} name Site name. * * @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. * @@ -53337,13 +53339,15 @@ 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 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 _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callback) { +function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53353,6 +53357,7 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53381,9 +53386,6 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, 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.'); } @@ -53393,20 +53395,20 @@ 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'; 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)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -53431,7 +53433,7 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callb return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -53441,12 +53443,13 @@ function _syncFunctionTriggersSlot(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) { @@ -53459,21 +53462,41 @@ 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['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 List triggered web jobs for an app, or a deployment slot. + * @summary Gets a triggered web job by its ID for an app, or a deployment + * slot. * - * List triggered web jobs for an app, or a deployment slot. + * 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 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. * @@ -53489,14 +53512,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. + * 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 _listTriggeredWebJobsSlot(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') { @@ -53506,6 +53528,7 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53528,15 +53551,15 @@ 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.'); } @@ -53546,13 +53569,14 @@ 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}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -53584,7 +53608,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); @@ -53594,13 +53618,12 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -53620,7 +53643,7 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb 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['TriggeredWebJob']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -53636,10 +53659,10 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb } /** - * @summary Gets a triggered web job by its ID for an app, or a deployment + * @summary Delete a triggered web job by its ID for an app, or a deployment * slot. * - * Gets a triggered web job by its ID for an app, or a deployment slot. + * Delete a triggered web job by its ID for an app, or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -53662,14 +53685,13 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TriggeredWebJob} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53679,6 +53701,7 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53710,9 +53733,6 @@ function _getTriggeredWebJobSlot(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.'); } @@ -53729,7 +53749,165 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {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 _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-02-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 (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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/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)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -53796,7 +53974,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['TriggeredJobHistoryCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -53812,169 +53990,12 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti } /** - * @summary Delete a triggered web job by its ID for an app, or a deployment - * slot. - * - * Delete a triggered web job by its ID for an app, or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} webJobName Name of Web Job. - * - * @param {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. + * @summary Gets a triggered web job's history by its ID for an app, , or a + * deployment slot. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === null || name === undefined || typeof name.valueOf() !== 'string') { - throw new Error('name cannot be null or undefined and it must be of type string.'); - } - if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { - throw new Error('webJobName cannot be null or undefined and it must be of type string.'); - } - if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { - throw new Error('slot cannot be null or undefined and it must be of type string.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); - requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary List a triggered web job's history for an app, or a deployment + * Gets a triggered web job's history by its ID for an app, , or a deployment * slot. * - * List a triggered web job's history for an app, or a deployment slot. - * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * @@ -53982,6 +54003,8 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, o * * @param {string} webJobName Name of Web Job. * + * @param {string} id History ID. + * * @param {string} slot Name of the deployment slot. If a slot is not * specified, the API deletes a deployment for the production slot. * @@ -53997,14 +54020,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 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 _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -54014,6 +54036,7 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -54039,15 +54062,15 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl 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.'); } @@ -54057,14 +54080,15 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -54131,7 +54155,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['TriggeredJobHistory']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -54147,11 +54171,9 @@ 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 Run a triggered web job for an app, or a deployment slot. * - * Gets a triggered web job's history by its ID for an app, , or a deployment - * slot. + * 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. @@ -54160,8 +54182,6 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl * * @param {string} webJobName Name of Web Job. * - * @param {string} id History ID. - * * @param {string} slot Name of the deployment slot. If a slot is not * specified, the API deletes a deployment for the production slot. * @@ -54176,14 +54196,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. + * {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 _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, slot, options, callback) { +function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -54193,6 +54212,7 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -54218,18 +54238,12 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { throw new Error('webJobName cannot be null or undefined and it must be of type string.'); } - if (id === null || id === undefined || typeof id.valueOf() !== 'string') { - throw new Error('id cannot be null or undefined and it must be of type string.'); - } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -54239,22 +54253,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}/triggeredwebjobs/{webJobName}/run'; 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(this.client.apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -54307,45 +54320,34 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredJobHistory']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Run a triggered web job for an app, or a deployment slot. + * @summary Gets the quota usage information of an app (or deployment slot, if + * specified). * - * Run a triggered web job for an app, or a deployment slot. + * 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 * @@ -54355,13 +54357,15 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link 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 _runTriggeredWebJobSlot(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') { @@ -54371,6 +54375,8 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -54393,18 +54399,15 @@ 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 (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.'); } @@ -54414,21 +54417,23 @@ 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}/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(this.client.apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -54453,7 +54458,7 @@ function _runTriggeredWebJobSlot(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); @@ -54463,12 +54468,13 @@ function _runTriggeredWebJobSlot(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) { @@ -54481,17 +54487,33 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CsmUsageQuotaCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * @summary Gets the quota usage information of an app (or deployment slot, if - * specified). + * @summary Gets the virtual networks the app (or deployment slot) is connected + * to. * - * Gets the quota usage information of an app (or deployment slot, if - * specified). + * 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. @@ -54499,16 +54521,11 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti * @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 quota information of the production slot. + * specified, the API will get virtual network 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 * @@ -54518,15 +54535,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. + * {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 _listUsagesSlot(resourceGroupName, name, slot, options, callback) { +function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -54536,7 +54551,7 @@ 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -54562,15 +54577,9 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } - if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -54580,16 +54589,13 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections'; 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)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -54657,7 +54663,21 @@ 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 = { + 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) { @@ -54673,18 +54693,20 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Gets the virtual networks the app (or deployment slot) is connected - * to. + * @summary Gets a virtual network the app (or deployment slot) is connected to + * by name. * - * Gets the virtual networks the app (or deployment slot) is connected to. + * Gets a virtual network the app (or deployment slot) is connected to by name. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * + * @param {string} vnetName Name of the virtual network. + * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get virtual network connections for the production + * specified, the API will get the named virtual network for the production * slot. * * @param {object} [options] Optional Parameters. @@ -54698,13 +54720,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 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 _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callback) { +function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -54714,6 +54737,7 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -54736,15 +54760,15 @@ 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 (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.'); } @@ -54754,13 +54778,14 @@ 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}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -54828,21 +54853,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['VnetInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -54858,21 +54869,39 @@ 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 Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). * - * Gets a virtual network the app (or deployment slot) is connected to by name. + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} vnetName Name of the virtual network. + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {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 {boolean} [connectionEnvelope.isSwift] Flag that is used to denote if + * this is VNET injection + * + * @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 connections for the production slot. * * @param {object} [options] Optional Parameters. * @@ -54892,7 +54921,7 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, callback) { +function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -54902,6 +54931,7 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -54927,15 +54957,15 @@ 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 (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.'); } @@ -54952,14 +54982,14 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -54977,7 +55007,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['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) { @@ -55036,36 +55080,21 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options } /** - * @summary Adds a Virtual Network connection to an app or slot (PUT) or - * updates the connection properties (PATCH). + * @summary Deletes a connection from an app (or deployment slot to a named + * virtual network. * - * Adds a Virtual Network connection to an app or slot (PUT) or updates the - * connection properties (PATCH). + * Deletes a connection from an app (or deployment slot to a named virtual + * network. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} vnetName Name of an existing Virtual Network. - * - * @param {object} connectionEnvelope Properties of the Virtual Network - * connection. See example. - * - * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's - * resource ID. - * - * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob - * containing the public key of the private key used to authenticate a - * Point-To-Site VPN connection. - * - * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by - * this Virtual Network. This should be a comma-separated list of IP addresses. - * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} vnetName Name of the virtual network. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will add or update connections for the production slot. + * specified, the API will delete the connection for the production slot. * * @param {object} [options] Optional Parameters. * @@ -55078,14 +55107,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. + * {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 _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, callback) { +function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -55095,6 +55123,7 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -55120,18 +55149,12 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { throw new Error('vnetName cannot be null or undefined and it must be of type string.'); } - if (connectionEnvelope === null || connectionEnvelope === undefined) { - throw new Error('connectionEnvelope cannot be null or undefined.'); - } if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -55148,14 +55171,14 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -55173,28 +55196,14 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (connectionEnvelope !== null && connectionEnvelope !== undefined) { - let requestModelMapper = new client.models['VnetInfo']().mapper(); - requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(connectionEnvelope, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { 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); @@ -55204,13 +55213,12 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -55223,44 +55231,45 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VnetInfo']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Deletes a connection from an app (or deployment slot to a named - * virtual network. + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). * - * Deletes a connection from an app (or deployment slot to a named virtual - * network. + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Name of the app. * - * @param {string} vnetName Name of the virtual network. + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {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 {boolean} [connectionEnvelope.isSwift] Flag that is used to denote if + * this is VNET injection + * + * @param {string} [connectionEnvelope.kind] Kind of resource. * * @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 will add or update connections for the production slot. * * @param {object} [options] Optional Parameters. * @@ -55273,13 +55282,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 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 _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, callback) { +function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -55289,6 +55299,7 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -55314,15 +55325,15 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, opti 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -55339,14 +55350,14 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, opti requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -55364,14 +55375,28 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, opti } } } - 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); @@ -55381,12 +55406,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) { @@ -55399,42 +55425,46 @@ 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['VnetInfo']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * @summary Adds a Virtual Network connection to an app or slot (PUT) or - * updates the connection properties (PATCH). + * @summary Gets an app's Virtual Network gateway. * - * Adds a Virtual Network connection to an app or slot (PUT) or updates the - * connection properties (PATCH). + * 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 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} vnetName Name of the Virtual Network. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @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 add or update connections for the production slot. + * specified, the API will get a gateway for the production slot's Virtual + * Network. * * @param {object} [options] Optional Parameters. * @@ -55448,13 +55478,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 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 _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, callback) { +function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -55464,6 +55494,7 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -55489,8 +55520,8 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection 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 (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.'); @@ -55498,9 +55529,6 @@ 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.'); } @@ -55510,21 +55538,22 @@ 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}/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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -55542,28 +55571,14 @@ 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) { 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); @@ -55573,13 +55588,12 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -55599,7 +55613,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['VnetGateway']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -55615,9 +55629,10 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection } /** - * @summary Gets an app's Virtual Network gateway. + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). * - * Gets an app's Virtual Network gateway. + * 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. @@ -55629,9 +55644,19 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection * @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 a gateway for the production slot's Virtual - * Network. + * specified, the API will add or update a gateway for the production slot's + * Virtual Network. * * @param {object} [options] Optional Parameters. * @@ -55651,7 +55676,7 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, 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') { @@ -55661,6 +55686,7 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -55689,15 +55715,15 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa 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.'); } @@ -55715,14 +55741,14 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -55740,14 +55766,28 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa } } } - 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) { 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); @@ -55757,12 +55797,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) { @@ -55845,7 +55886,7 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, 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') { @@ -55855,6 +55896,7 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -55892,9 +55934,6 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -55912,14 +55951,14 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -56010,34 +56049,17 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN } /** - * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it - * (PATCH). + * @summary List webjobs for an app, or a deployment slot. * - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * 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} 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} name Site name. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will add or update a gateway for the production slot's - * Virtual Network. + * specified, the API returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -56051,13 +56073,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 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 _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options, callback) { +function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -56067,6 +56089,7 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -56089,24 +56112,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.'); } @@ -56116,22 +56127,20 @@ 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}/slots/{slot}/webjobs'; 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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(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 @@ -56149,21 +56158,7 @@ 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) { @@ -56206,7 +56201,7 @@ 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['WebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -56222,15 +56217,17 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat } /** - * @summary List webjobs for an app, or a deployment slot. + * @summary Get webjob information for an app, or a deployment slot. * - * List webjobs for an app, or a deployment slot. + * Get webjob information for an app, or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} name Site name. * + * @param {string} webJobName Name of the web job. + * * @param {string} slot Name of the deployment slot. If a slot is not * specified, the API returns deployments for the production slot. * @@ -56246,13 +56243,13 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link WebJobCollection} for more information. + * See {@link 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 _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { +function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -56262,6 +56259,7 @@ function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -56284,15 +56282,15 @@ function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } + if (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.'); } @@ -56302,13 +56300,14 @@ function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -56376,7 +56375,7 @@ function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebJobCollection']().mapper(); + let resultMapper = new client.models['WebJob']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -56392,19 +56391,24 @@ function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Get webjob information for an app, or a deployment slot. + * @summary Get the difference in configuration settings between two web app + * slots. * - * Get webjob information for an app, or a deployment slot. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of the web job. + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. 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} 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. * @@ -56418,13 +56422,14 @@ 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 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 _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -56434,6 +56439,7 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -56456,18 +56462,12 @@ 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 (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.'); } @@ -56477,21 +56477,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}/slotsdiffs'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); - requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); - requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -56509,7 +56507,21 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call } } } - 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) { @@ -56552,7 +56564,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['SlotDifferenceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -56567,11 +56579,11 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call }); } + /** - * @summary Get the difference in configuration settings between two web app - * slots. + * @summary Swaps two deployment slots of an app. * - * Get the difference in configuration settings between two web app slots. + * Swaps two deployment slots of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -56598,15 +56610,79 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, 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} [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. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SlotDifferenceCollection} for more - * information. + * 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 _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, options, callback) { +function _listSnapshots(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -56616,6 +56692,7 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -56638,15 +56715,9 @@ 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.'); } @@ -56656,19 +56727,19 @@ 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}/snapshots'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + 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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -56686,21 +56757,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) { @@ -56743,7 +56800,7 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SlotDifferenceCollection']().mapper(); + let resultMapper = new client.models['SnapshotCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -56758,85 +56815,10 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt }); } - -/** - * @summary Swaps two deployment slots of an app. - * - * Swaps two deployment slots of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} slotSwapEntity JSON object that contains the target slot - * name. See example. - * - * @param {string} slotSwapEntity.targetSlot Destination deployment slot during - * swap operation. - * - * @param {boolean} slotSwapEntity.preserveVnet true to preserve - * Virtual Network to the slot during swap; otherwise, false. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _swapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - - if (!callback) { - throw new Error('callback cannot be null.'); - } - - // Send request - this.beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - /** - * @summary Returns all Snapshots to the user. + * @summary Returns all Snapshots to the user from DRSecondary endpoint. * - * Returns all Snapshots to the user. + * Returns all Snapshots to the user from DRSecondary endpoint. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -56861,7 +56843,7 @@ function _swapSlotWithProduction(resourceGroupName, name, slotSwapEntity, option * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listSnapshots(resourceGroupName, name, options, callback) { +function _listSnapshotsFromDRSecondary(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -56871,6 +56853,7 @@ function _listSnapshots(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -56896,9 +56879,6 @@ 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.'); } @@ -56908,12 +56888,12 @@ 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}/snapshotsdr'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -57034,6 +57014,7 @@ function _getSourceControl(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -57059,9 +57040,6 @@ 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.'); } @@ -57076,7 +57054,7 @@ function _getSourceControl(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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -57333,6 +57311,7 @@ function _deleteSourceControl(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -57358,9 +57337,6 @@ 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.'); } @@ -57375,7 +57351,7 @@ function _deleteSourceControl(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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -57500,6 +57476,7 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -57528,9 +57505,6 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, 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.'); } @@ -57545,7 +57519,7 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -57713,6 +57687,7 @@ function _start(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -57738,9 +57713,6 @@ function _start(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.'); } @@ -57755,7 +57727,7 @@ function _start(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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -57850,7 +57822,7 @@ function _start(resourceGroupName, name, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -57897,7 +57869,15 @@ function _startNetworkTrace(resourceGroupName, name, options, callback) { required: false, serializedName: 'parsedResponse', type: { - name: 'Object' + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } } }; result = client.deserialize(resultMapper, parsedResponse, 'result'); @@ -57951,6 +57931,7 @@ function _stop(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -57976,9 +57957,6 @@ function _stop(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.'); } @@ -57993,7 +57971,7 @@ function _stop(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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -58095,6 +58073,7 @@ function _stopNetworkTrace(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58120,9 +58099,6 @@ function _stopNetworkTrace(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.'); } @@ -58137,7 +58113,7 @@ function _stopNetworkTrace(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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -58239,6 +58215,7 @@ function _syncRepository(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58264,9 +58241,6 @@ function _syncRepository(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.'); } @@ -58281,7 +58255,7 @@ function _syncRepository(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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -58383,6 +58357,7 @@ function _syncFunctionTriggers(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58408,9 +58383,6 @@ function _syncFunctionTriggers(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.'); } @@ -58425,7 +58397,7 @@ function _syncFunctionTriggers(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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -58529,6 +58501,7 @@ function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58554,9 +58527,6 @@ function _listTriggeredWebJobs(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.'); } @@ -58571,7 +58541,7 @@ function _listTriggeredWebJobs(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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -58695,6 +58665,7 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58723,9 +58694,6 @@ 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.'); } @@ -58741,7 +58709,7 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -58863,6 +58831,7 @@ function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58891,9 +58860,6 @@ function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, 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.'); } @@ -58909,7 +58875,7 @@ function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, ca requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -59016,6 +58982,7 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59044,9 +59011,6 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, 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.'); } @@ -59062,7 +59026,7 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -59188,6 +59152,7 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59219,9 +59184,6 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, 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.'); } @@ -59238,7 +59200,7 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -59359,6 +59321,7 @@ function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callb if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59387,9 +59350,6 @@ function _runTriggeredWebJob(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.'); } @@ -59405,7 +59365,7 @@ function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callb requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -59518,6 +59478,7 @@ function _listUsages(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59546,9 +59507,6 @@ 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.'); } @@ -59566,7 +59524,7 @@ function _listUsages(resourceGroupName, name, options, callback) { if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + filter); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -59687,6 +59645,7 @@ function _listVnetConnections(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59712,9 +59671,6 @@ function _listVnetConnections(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.'); } @@ -59729,7 +59685,7 @@ function _listVnetConnections(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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -59867,6 +59823,7 @@ function _getVnetConnection(resourceGroupName, name, vnetName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59895,9 +59852,6 @@ function _getVnetConnection(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.'); } @@ -59913,7 +59867,7 @@ function _getVnetConnection(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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -60023,6 +59977,9 @@ function _getVnetConnection(resourceGroupName, name, vnetName, options, callback * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by * this Virtual Network. This should be a comma-separated list of IP addresses. * + * @param {boolean} [connectionEnvelope.isSwift] Flag that is used to denote if + * this is VNET injection + * * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -60053,6 +60010,7 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -60084,9 +60042,6 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -60102,7 +60057,7 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -60240,6 +60195,7 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callb if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -60268,9 +60224,6 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, 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.'); } @@ -60286,7 +60239,7 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callb requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -60378,6 +60331,9 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callb * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by * this Virtual Network. This should be a comma-separated list of IP addresses. * + * @param {boolean} [connectionEnvelope.isSwift] Flag that is used to denote if + * this is VNET injection + * * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -60408,6 +60364,7 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -60439,9 +60396,6 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -60457,7 +60411,7 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -60597,6 +60551,7 @@ function _getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayNam if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -60628,9 +60583,6 @@ function _getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayNam if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -60647,7 +60599,7 @@ function _getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayNam requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -60783,6 +60735,7 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -60817,9 +60770,6 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -60836,7 +60786,7 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -60987,6 +60937,7 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -61021,9 +60972,6 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -61040,7 +60988,7 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -61175,6 +61123,7 @@ function _listWebJobs(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -61200,9 +61149,6 @@ function _listWebJobs(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.'); } @@ -61217,7 +61163,7 @@ function _listWebJobs(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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -61340,6 +61286,7 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -61368,9 +61315,6 @@ function _getWebJob(resourceGroupName, name, webJobName, 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.'); } @@ -61386,7 +61330,7 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -61599,7 +61543,7 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -61691,6 +61635,11 @@ function _getWebJob(resourceGroupName, name, webJobName, 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 {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -61732,7 +61681,13 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -61767,6 +61722,9 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -61827,6 +61785,12 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service @@ -61869,6 +61833,7 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -61897,9 +61862,6 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, 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.'); } @@ -61914,7 +61876,7 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -62109,6 +62071,7 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -62140,9 +62103,6 @@ function _beginRestore(resourceGroupName, name, backupId, request, 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.'); } @@ -62158,7 +62118,7 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -62275,6 +62235,7 @@ function _beginListPublishingCredentials(resourceGroupName, name, options, callb if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -62300,9 +62261,6 @@ function _beginListPublishingCredentials(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.'); } @@ -62317,7 +62275,7 @@ function _beginListPublishingCredentials(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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -62466,6 +62424,7 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -62494,9 +62453,6 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, 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.'); } @@ -62511,7 +62467,7 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -62670,6 +62626,7 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -62701,9 +62658,6 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -62719,7 +62673,7 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -62884,6 +62838,7 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -62915,9 +62870,6 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -62933,7 +62885,7 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -63087,6 +63039,7 @@ function _beginMigrateStorage(subscriptionName, resourceGroupName, name, migrati if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (subscriptionName === null || subscriptionName === undefined || typeof subscriptionName.valueOf() !== 'string') { @@ -63118,9 +63071,6 @@ function _beginMigrateStorage(subscriptionName, resourceGroupName, name, migrati if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -63136,7 +63086,7 @@ function _beginMigrateStorage(subscriptionName, resourceGroupName, name, migrati requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('subscriptionName=' + encodeURIComponent(subscriptionName)); - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -63283,6 +63233,7 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -63311,9 +63262,6 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, 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.'); } @@ -63328,7 +63276,7 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, o requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -63454,7 +63402,7 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, o * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -63473,6 +63421,7 @@ function _beginStartWebSiteNetworkTraceOperation(resourceGroupName, name, option 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -63507,9 +63456,6 @@ function _beginStartWebSiteNetworkTraceOperation(resourceGroupName, 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.'); } @@ -63533,7 +63479,7 @@ function _beginStartWebSiteNetworkTraceOperation(resourceGroupName, name, option if (sasUrl !== null && sasUrl !== undefined) { queryParameters.push('sasUrl=' + encodeURIComponent(sasUrl)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -63632,7 +63578,21 @@ function _beginStartWebSiteNetworkTraceOperation(resourceGroupName, name, option parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Operation']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -63724,6 +63684,7 @@ function _beginRestoreFromBackupBlob(resourceGroupName, name, request, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -63752,9 +63713,6 @@ function _beginRestoreFromBackupBlob(resourceGroupName, name, request, 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.'); } @@ -63769,7 +63727,7 @@ function _beginRestoreFromBackupBlob(resourceGroupName, name, request, options, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -63871,6 +63829,9 @@ function _beginRestoreFromBackupBlob(resourceGroupName, name, request, options, * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -63900,6 +63861,7 @@ function _beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, op if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -63928,9 +63890,6 @@ function _beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, 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.'); } @@ -63945,7 +63904,7 @@ function _beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, op requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -64065,6 +64024,9 @@ function _beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, op * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -64094,6 +64056,7 @@ function _beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -64122,9 +64085,6 @@ function _beginRestoreSnapshot(resourceGroupName, name, restoreRequest, 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.'); } @@ -64139,7 +64099,7 @@ function _beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -64258,6 +64218,7 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -64286,9 +64247,6 @@ 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.'); } @@ -64304,7 +64262,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -64533,7 +64491,7 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -64625,6 +64583,11 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -64666,7 +64629,13 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -64701,6 +64670,9 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -64761,6 +64733,12 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service @@ -64806,6 +64784,7 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -64837,9 +64816,6 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, 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.'); } @@ -64855,7 +64831,7 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, o requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -65053,6 +65029,7 @@ function _beginRestoreSlot(resourceGroupName, name, backupId, request, slot, opt if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -65087,9 +65064,6 @@ 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.'); } @@ -65106,7 +65080,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -65227,6 +65201,7 @@ function _beginListPublishingCredentialsSlot(resourceGroupName, name, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -65255,9 +65230,6 @@ 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.'); } @@ -65273,7 +65245,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -65425,6 +65397,7 @@ function _beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDepl if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -65456,9 +65429,6 @@ 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.'); } @@ -65474,7 +65444,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -65636,6 +65606,7 @@ function _beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -65670,9 +65641,6 @@ 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.'); } @@ -65689,7 +65657,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -65857,6 +65825,7 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -65891,9 +65860,6 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, 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.'); } @@ -65910,7 +65876,7 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, 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)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -66037,7 +66003,7 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -66056,6 +66022,7 @@ function _beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName, name, sl 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -66093,9 +66060,6 @@ function _beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName, name, 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.'); } @@ -66120,7 +66084,7 @@ function _beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName, name, sl if (sasUrl !== null && sasUrl !== undefined) { queryParameters.push('sasUrl=' + encodeURIComponent(sasUrl)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -66219,7 +66183,21 @@ function _beginStartWebSiteNetworkTraceOperationSlot(resourceGroupName, name, sl parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Operation']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -66314,6 +66292,7 @@ function _beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, slot, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -66345,9 +66324,6 @@ function _beginRestoreFromBackupBlobSlot(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.'); } @@ -66363,7 +66339,7 @@ function _beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, slot, requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -66465,6 +66441,9 @@ function _beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, slot, * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -66497,6 +66476,7 @@ function _beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -66528,9 +66508,6 @@ function _beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -66546,7 +66523,7 @@ function _beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -66666,6 +66643,9 @@ function _beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -66698,6 +66678,7 @@ function _beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -66729,9 +66710,6 @@ function _beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, 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.'); } @@ -66747,7 +66725,7 @@ function _beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -66869,6 +66847,7 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -66900,9 +66879,6 @@ 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.'); } @@ -66919,7 +66895,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -67067,6 +67043,7 @@ function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, optio if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -67098,9 +67075,6 @@ 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.'); } @@ -67116,7 +67090,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -67259,6 +67233,7 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -67290,9 +67265,6 @@ 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.'); } @@ -67308,7 +67280,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -67470,7 +67442,7 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -67489,6 +67461,7 @@ function _beginStartNetworkTraceSlot(resourceGroupName, name, slot, options, cal 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -67526,9 +67499,6 @@ function _beginStartNetworkTraceSlot(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.'); } @@ -67553,7 +67523,7 @@ function _beginStartNetworkTraceSlot(resourceGroupName, name, slot, options, cal if (sasUrl !== null && sasUrl !== undefined) { queryParameters.push('sasUrl=' + encodeURIComponent(sasUrl)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -67652,7 +67622,21 @@ function _beginStartNetworkTraceSlot(resourceGroupName, name, slot, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Operation']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -67713,6 +67697,7 @@ function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -67741,9 +67726,6 @@ 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.'); } @@ -67758,7 +67740,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -67897,6 +67879,7 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -67925,9 +67908,6 @@ 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.'); } @@ -67942,7 +67922,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(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -68102,7 +68082,7 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -68121,6 +68101,7 @@ function _beginStartNetworkTrace(resourceGroupName, name, options, callback) { 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 = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -68155,9 +68136,6 @@ function _beginStartNetworkTrace(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.'); } @@ -68181,7 +68159,7 @@ function _beginStartNetworkTrace(resourceGroupName, name, options, callback) { if (sasUrl !== null && sasUrl !== undefined) { queryParameters.push('sasUrl=' + encodeURIComponent(sasUrl)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -68280,7 +68258,21 @@ function _beginStartNetworkTrace(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Operation']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkTraceElementType', + type: { + name: 'Composite', + className: 'NetworkTrace' + } + } + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -73391,7 +73383,139 @@ function _listProcessesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfoCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listProcessModulesSlotNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -73407,12 +73531,12 @@ function _listProcessesSlotNext(nextPageLink, options, callback) { } /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. - * - * List module information for a process 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. * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * @@ -73428,14 +73552,14 @@ function _listProcessesSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfoCollection} for more + * See {@link 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 _listProcessModulesSlotNext(nextPageLink, options, callback) { +function _listProcessThreadsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -73523,7 +73647,7 @@ function _listProcessModulesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -73539,11 +73663,9 @@ function _listProcessModulesSlotNext(nextPageLink, options, callback) { } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Get public certificates for an app or a deployment slot. * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * Get public certificates for an app or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -73560,14 +73682,14 @@ function _listProcessModulesSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfoCollection} for more + * See {@link 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 _listProcessThreadsSlotNext(nextPageLink, options, callback) { +function _listPublicCertificatesSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -73620,7 +73742,7 @@ function _listProcessThreadsSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -73630,12 +73752,13 @@ function _listProcessThreadsSlotNext(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) { @@ -73655,7 +73778,7 @@ function _listProcessThreadsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); + let resultMapper = new client.models['PublicCertificateCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -73671,9 +73794,9 @@ function _listProcessThreadsSlotNext(nextPageLink, options, callback) { } /** - * @summary Get public certificates for an app or a deployment slot. + * @summary Get list of siteextensions for a web site, or a deployment slot. * - * Get public certificates for an app or a deployment slot. + * Get list of siteextensions for a web site, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -73690,14 +73813,14 @@ function _listProcessThreadsSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PublicCertificateCollection} for more + * See {@link 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 _listPublicCertificatesSlotNext(nextPageLink, options, callback) { +function _listSiteExtensionsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -73750,7 +73873,7 @@ function _listPublicCertificatesSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -73760,13 +73883,12 @@ function _listPublicCertificatesSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -73786,7 +73908,7 @@ function _listPublicCertificatesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicCertificateCollection']().mapper(); + let resultMapper = new client.models['SiteExtensionInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -73802,9 +73924,10 @@ function _listPublicCertificatesSlotNext(nextPageLink, options, callback) { } /** - * @summary Get list of siteextensions for a web site, or a deployment slot. + * @summary Get the difference in configuration settings between two web app + * slots. * - * Get list of siteextensions for a web site, or a deployment slot. + * Get the difference in configuration settings between two web app slots. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -73821,14 +73944,14 @@ function _listPublicCertificatesSlotNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteExtensionInfoCollection} for more + * 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 _listSiteExtensionsSlotNext(nextPageLink, options, callback) { +function _listSlotDifferencesSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -73856,7 +73979,7 @@ function _listSiteExtensionsSlotNext(nextPageLink, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -73881,7 +74004,7 @@ function _listSiteExtensionsSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -73891,12 +74014,13 @@ function _listSiteExtensionsSlotNext(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) { @@ -73916,7 +74040,7 @@ function _listSiteExtensionsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteExtensionInfoCollection']().mapper(); + let resultMapper = new client.models['SlotDifferenceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -73932,10 +74056,9 @@ function _listSiteExtensionsSlotNext(nextPageLink, options, callback) { } /** - * @summary Get the difference in configuration settings between two web app - * slots. + * @summary Returns all Snapshots to the user. * - * Get the difference in configuration settings between two web app slots. + * Returns all Snapshots to the user. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -73952,14 +74075,13 @@ function _listSiteExtensionsSlotNext(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 SlotDifferenceCollection} for more - * information. + * See {@link SnapshotCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listSlotDifferencesSlotNext(nextPageLink, options, callback) { +function _listSnapshotsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -73987,7 +74109,7 @@ function _listSlotDifferencesSlotNext(nextPageLink, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -74048,7 +74170,7 @@ function _listSlotDifferencesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SlotDifferenceCollection']().mapper(); + let resultMapper = new client.models['SnapshotCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -74064,9 +74186,9 @@ function _listSlotDifferencesSlotNext(nextPageLink, options, callback) { } /** - * @summary Returns all Snapshots to the user. + * @summary Returns all Snapshots to the user from DRSecondary endpoint. * - * Returns all Snapshots to the user. + * Returns all Snapshots to the user from DRSecondary endpoint. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -74089,7 +74211,7 @@ function _listSlotDifferencesSlotNext(nextPageLink, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listSnapshotsSlotNext(nextPageLink, options, callback) { +function _listSnapshotsFromDRSecondarySlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -74980,6 +75102,136 @@ function _listSnapshotsNext(nextPageLink, options, callback) { }); } +/** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listSnapshotsFromDRSecondaryNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SnapshotCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + /** * @summary List triggered web jobs for an app, or a deployment slot. * @@ -75548,10 +75800,6 @@ 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; @@ -75619,6 +75867,10 @@ class WebApps { this._migrateStorage = _migrateStorage; this._migrateMySql = _migrateMySql; this._getMigrateMySqlStatus = _getMigrateMySqlStatus; + this._getSwiftVirtualNetworkConnection = _getSwiftVirtualNetworkConnection; + this._createOrUpdateSwiftVirtualNetworkConnection = _createOrUpdateSwiftVirtualNetworkConnection; + this._deleteSwiftVirtualNetwork = _deleteSwiftVirtualNetwork; + this._updateSwiftVirtualNetworkConnection = _updateSwiftVirtualNetworkConnection; this._listNetworkFeatures = _listNetworkFeatures; this._getNetworkTraceOperation = _getNetworkTraceOperation; this._startWebSiteNetworkTrace = _startWebSiteNetworkTrace; @@ -75691,10 +75943,6 @@ 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; @@ -75760,6 +76008,10 @@ class WebApps { this._listMetricDefinitionsSlot = _listMetricDefinitionsSlot; this._listMetricsSlot = _listMetricsSlot; this._getMigrateMySqlStatusSlot = _getMigrateMySqlStatusSlot; + this._getSwiftVirtualNetworkConnectionSlot = _getSwiftVirtualNetworkConnectionSlot; + this._createOrUpdateSwiftVirtualNetworkConnectionSlot = _createOrUpdateSwiftVirtualNetworkConnectionSlot; + this._deleteSwiftVirtualNetworkSlot = _deleteSwiftVirtualNetworkSlot; + this._updateSwiftVirtualNetworkConnectionSlot = _updateSwiftVirtualNetworkConnectionSlot; this._listNetworkFeaturesSlot = _listNetworkFeaturesSlot; this._getNetworkTraceOperationSlot = _getNetworkTraceOperationSlot; this._startWebSiteNetworkTraceSlot = _startWebSiteNetworkTraceSlot; @@ -75803,6 +76055,7 @@ class WebApps { this._listSlotDifferencesSlot = _listSlotDifferencesSlot; this._swapSlotSlot = _swapSlotSlot; this._listSnapshotsSlot = _listSnapshotsSlot; + this._listSnapshotsFromDRSecondarySlot = _listSnapshotsFromDRSecondarySlot; this._getSourceControlSlot = _getSourceControlSlot; this._createOrUpdateSourceControlSlot = _createOrUpdateSourceControlSlot; this._deleteSourceControlSlot = _deleteSourceControlSlot; @@ -75833,6 +76086,7 @@ class WebApps { this._listSlotDifferencesFromProduction = _listSlotDifferencesFromProduction; this._swapSlotWithProduction = _swapSlotWithProduction; this._listSnapshots = _listSnapshots; + this._listSnapshotsFromDRSecondary = _listSnapshotsFromDRSecondary; this._getSourceControl = _getSourceControl; this._createOrUpdateSourceControl = _createOrUpdateSourceControl; this._deleteSourceControl = _deleteSourceControl; @@ -75935,12 +76189,14 @@ class WebApps { this._listSiteExtensionsSlotNext = _listSiteExtensionsSlotNext; this._listSlotDifferencesSlotNext = _listSlotDifferencesSlotNext; this._listSnapshotsSlotNext = _listSnapshotsSlotNext; + this._listSnapshotsFromDRSecondarySlotNext = _listSnapshotsFromDRSecondarySlotNext; this._listTriggeredWebJobsSlotNext = _listTriggeredWebJobsSlotNext; this._listTriggeredWebJobHistorySlotNext = _listTriggeredWebJobHistorySlotNext; this._listUsagesSlotNext = _listUsagesSlotNext; this._listWebJobsSlotNext = _listWebJobsSlotNext; this._listSlotDifferencesFromProductionNext = _listSlotDifferencesFromProductionNext; this._listSnapshotsNext = _listSnapshotsNext; + this._listSnapshotsFromDRSecondaryNext = _listSnapshotsFromDRSecondaryNext; this._listTriggeredWebJobsNext = _listTriggeredWebJobsNext; this._listTriggeredWebJobHistoryNext = _listTriggeredWebJobHistoryNext; this._listUsagesNext = _listUsagesNext; @@ -76347,7 +76603,7 @@ class WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -76439,6 +76695,11 @@ class WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -76480,7 +76741,13 @@ class WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -76515,6 +76782,9 @@ class WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -76575,6 +76845,12 @@ class WebApps { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service @@ -76744,7 +77020,7 @@ class WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -76836,6 +77112,11 @@ class WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -76877,7 +77158,13 @@ class WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -76912,6 +77199,9 @@ class WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -76972,6 +77262,12 @@ class WebApps { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service @@ -77270,7 +77566,7 @@ class WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -77362,6 +77658,11 @@ class WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -77403,7 +77704,13 @@ class WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -77438,6 +77745,9 @@ class WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -77498,6 +77808,12 @@ class WebApps { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {string} [siteEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -77655,7 +77971,7 @@ class WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -77747,6 +78063,11 @@ class WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -77788,7 +78109,13 @@ class WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -77823,6 +78150,9 @@ class WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -77883,6 +78213,12 @@ class WebApps { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {string} [siteEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -79306,6 +79642,11 @@ class WebApps { * More information on OpenID Connect: * http://openid.net/specs/openid-connect-core-1_0.html * + * @param {string} [siteAuthSettings.clientSecretCertificateThumbprint] An + * alternative to the client secret, that is the thumbprint of a certificate + * used for signing purposes. This property acts as + * a replacement for the Client Secret. It is also optional. + * * @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 @@ -79487,6 +79828,11 @@ class WebApps { * More information on OpenID Connect: * http://openid.net/specs/openid-connect-core-1_0.html * + * @param {string} [siteAuthSettings.clientSecretCertificateThumbprint] An + * alternative to the client secret, that is the thumbprint of a certificate + * used for signing purposes. This property acts as + * a replacement for the Client Secret. It is also optional. + * * @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 @@ -81553,9 +81899,11 @@ class WebApps { } /** - * @summary Gets a Swift Virtual Network connection. + * @summary 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. + * 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. @@ -81569,15 +81917,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. */ - getSwiftVirtualNetworkConnectionWithHttpOperationResponse(resourceGroupName, name, options) { + getConfigurationWithHttpOperationResponse(resourceGroupName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getSwiftVirtualNetworkConnection(resourceGroupName, name, options, (err, result, request, response) => { + self._getConfiguration(resourceGroupName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -81588,9 +81936,11 @@ class WebApps { } /** - * @summary Gets a Swift Virtual Network connection. + * @summary 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. + * 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. @@ -81609,7 +81959,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {SwiftVirtualNetwork} - The deserialized result object. + * @resolve {SiteConfigResource} - The deserialized result object. * * @reject {Error} - The error object. * @@ -81618,13 +81968,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 SwiftVirtualNetwork} 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. */ - getSwiftVirtualNetworkConnection(resourceGroupName, name, options, optionalCallback) { + getConfiguration(resourceGroupName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -81633,377 +81983,262 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getSwiftVirtualNetworkConnection(resourceGroupName, name, options, (err, result, request, response) => { + self._getConfiguration(resourceGroupName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getSwiftVirtualNetworkConnection(resourceGroupName, name, options, optionalCallback); + return self._getConfiguration(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. + * @summary 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. + * 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} 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} 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. * - * @returns {Promise} A promise is returned + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [siteConfig.phpVersion] Version of PHP. * - * @reject {Error} - The error object. - */ - createOrUpdateSwiftVirtualNetworkConnectionWithHttpOperationResponse(resourceGroupName, name, connectionEnvelope, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdateSwiftVirtualNetworkConnection(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. + * @param {string} [siteConfig.pythonVersion] Version of Python. * - * 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} [siteConfig.nodeVersion] Version of Node.js. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version * - * @param {string} name Name of the app. + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version * - * @param {object} connectionEnvelope Properties of the Virtual Network - * connection. See example. + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. * - * @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 {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. * - * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies - * if the scale unit this Web App is on supports Swift integration. + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. * - * @param {object} [options] Optional Parameters. + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. * - * @param {function} [optionalCallback] - The optional callback. + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. + * @param {string} [siteConfig.publishingUsername] Publishing user name. * - * {Promise} A promise is returned + * @param {array} [siteConfig.appSettings] Application settings. * - * @resolve {SwiftVirtualNetwork} - The deserialized result object. + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. * - * @reject {Error} - The error object. + * @param {array} [siteConfig.connectionStrings] Connection strings. * - * {function} optionalCallback(err, result, request, response) + * @param {array} [siteConfig.handlerMappings] Handler mappings. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} [siteConfig.documentRoot] Document root. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SwiftVirtualNetwork} for more information. + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdateSwiftVirtualNetworkConnection(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._createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, optionalCallback); - } - } - - /** - * @summary Deletes a Swift Virtual Network connection from an app (or - * deployment slot). + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. * - * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {string} [siteConfig.javaVersion] Java version. * - * @param {string} name Name of the app. + * @param {string} [siteConfig.javaContainer] Java container. * - * @param {object} [options] Optional Parameters. + * @param {string} [siteConfig.javaContainerVersion] Java container version. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [siteConfig.appCommandLine] App command line to launch. * - * @returns {Promise} A promise is returned + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {array} [siteConfig.virtualApplications] Virtual applications. * - * @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). + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' * - * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * @param {object} [siteConfig.experiments] This is work around for polymorphic + * types. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. * - * @param {string} name Name of the app. + * @param {object} [siteConfig.limits] Site limits. * - * @param {object} [options] Optional Parameters. + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. * - * @param {function} [optionalCallback] - The optional callback. + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. * - * {Promise} A promise is returned + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. * - * @resolve {null} - The deserialized result object. + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. * - * @reject {Error} - The error object. + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. * - * {function} optionalCallback(err, result, request, response) + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. * - * {null} [result] - The deserialized result object if an error did not occur. + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. * - * {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. + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. * - * 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} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. * - * @param {string} name Name of the app. + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. * - * @param {object} connectionEnvelope Properties of the Virtual Network - * connection. See example. + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. * - * @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.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' * - * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies - * if the scale unit this Web App is on supports Swift integration. + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. * - * @param {object} [options] Optional Parameters. + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action * - * @returns {Promise} A promise is returned + * @param {string} [siteConfig.tracingOptions] Tracing options. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [siteConfig.vnetName] Virtual Network name. * - * @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. + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. * - * 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 {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 {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. * - * @param {string} name Name of the app. + * @param {object} [siteConfig.push] Push endpoint settings. * - * @param {object} connectionEnvelope Properties of the Virtual Network - * connection. See example. + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. * - * @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.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. * - * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies - * if the scale unit this Web App is on supports Swift integration. + * @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} [connectionEnvelope.kind] Kind of resource. + * @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] Optional Parameters. + * @param {string} [siteConfig.push.kind] Kind of resource. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. * - * @param {function} [optionalCallback] - The optional callback. + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. * - * {Promise} A promise is returned + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. * - * @resolve {SwiftVirtualNetwork} - The deserialized result object. + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id * - * @reject {Error} - The error object. + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id * - * {function} optionalCallback(err, result, request, response) + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions + * for main. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SwiftVirtualNetwork} for more information. + * @param {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 * - * {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); - } - } - - /** - * @summary Gets the configuration of an app, such as platform version and - * bitness, default documents, virtual applications, Always On, etc. + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' * - * Gets the configuration of an app, such as platform version and bitness, - * default documents, virtual applications, Always On, etc. + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan * - * @param {string} name Name of the app. + * @param {string} [siteConfig.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -82016,11 +82251,11 @@ class WebApps { * * @reject {Error} - The error object. */ - getConfigurationWithHttpOperationResponse(resourceGroupName, name, options) { + createOrUpdateConfigurationWithHttpOperationResponse(resourceGroupName, name, siteConfig, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getConfiguration(resourceGroupName, name, options, (err, result, request, response) => { + self._createOrUpdateConfiguration(resourceGroupName, name, siteConfig, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -82030,65 +82265,6 @@ class WebApps { }); } - /** - * @summary Gets the configuration of an app, such as platform version and - * bitness, default documents, virtual applications, Always On, etc. - * - * 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 {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 {SiteConfigResource} - 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 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. - */ - getConfiguration(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._getConfiguration(resourceGroupName, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getConfiguration(resourceGroupName, name, options, optionalCallback); - } - } - /** * @summary Updates the configuration of an app. * @@ -82184,7 +82360,7 @@ class WebApps { * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' * - * @param {object} [siteConfig.experiments] This is work around for polymophic + * @param {object} [siteConfig.experiments] This is work around for polymorphic * types. * * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. @@ -82266,6 +82442,11 @@ class WebApps { * origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteConfig.push] Push endpoint settings. * * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag @@ -82305,266 +82486,14 @@ class WebApps { * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed * Service Identity Id * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions + * for main. * - * @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 - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - createOrUpdateConfigurationWithHttpOperationResponse(resourceGroupName, name, siteConfig, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdateConfiguration(resourceGroupName, name, siteConfig, 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 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 {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. * - * @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 {object} [siteConfig.azureStorageAccounts] User-provided Azure - * storage accounts. - * - * @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.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web * site to allow clients to connect over http2.0 @@ -82724,7 +82653,7 @@ class WebApps { * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' * - * @param {object} [siteConfig.experiments] This is work around for polymophic + * @param {object} [siteConfig.experiments] This is work around for polymorphic * types. * * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. @@ -82806,6 +82735,11 @@ class WebApps { * origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteConfig.push] Push endpoint settings. * * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag @@ -82845,7 +82779,14 @@ class WebApps { * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed * Service Identity Id * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions + * for main. + * + * @param {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * + * @param {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web * site to allow clients to connect over http2.0 @@ -82983,7 +82924,7 @@ class WebApps { * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' * - * @param {object} [siteConfig.experiments] This is work around for polymophic + * @param {object} [siteConfig.experiments] This is work around for polymorphic * types. * * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. @@ -83065,6 +83006,11 @@ class WebApps { * origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteConfig.push] Push endpoint settings. * * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag @@ -83104,7 +83050,14 @@ class WebApps { * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed * Service Identity Id * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions + * for main. + * + * @param {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * + * @param {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web * site to allow clients to connect over http2.0 @@ -90050,6 +90003,447 @@ class WebApps { } } + /** + * @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} - 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. + * + * @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. + */ + createOrUpdateSwiftVirtualNetworkConnectionWithHttpOperationResponse(resourceGroupName, name, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateSwiftVirtualNetworkConnection(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. + */ + createOrUpdateSwiftVirtualNetworkConnection(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._createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + 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); + } + } + /** * @summary Gets all network features used by the app (or deployment slot, if * specified). @@ -90173,7 +90567,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. */ @@ -90217,7 +90611,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -90225,7 +90619,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -90383,7 +90777,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. */ @@ -90431,7 +90825,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -90439,7 +90833,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -90676,7 +91070,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. */ @@ -90720,7 +91114,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -90728,7 +91122,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -93629,6 +94023,9 @@ class WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -93679,6 +94076,9 @@ class WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -93768,6 +94168,9 @@ class WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -93836,6 +94239,9 @@ class WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -94588,7 +94994,7 @@ class WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -94680,6 +95086,431 @@ class WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * + * @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 for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. + * + * @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 {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * + * @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.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateSlotWithHttpOperationResponse(resourceGroupName, name, siteEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateSlot(resourceGroupName, name, siteEnvelope, 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 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] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] 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 {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @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 polymorphic 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 {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -94721,7 +95552,13 @@ class WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -94756,6 +95593,9 @@ class WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -94816,6 +95656,12 @@ class WebApps { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service @@ -94838,17 +95684,85 @@ class WebApps { * @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 {Site} - 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 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. + */ + createOrUpdateSlot(resourceGroupName, name, siteEnvelope, 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._createOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, options, optionalCallback); + } + } + + /** + * @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 + * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createOrUpdateSlotWithHttpOperationResponse(resourceGroupName, name, siteEnvelope, slot, options) { + deleteSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, options, (err, result, request, response) => { + self._deleteSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -94858,6 +95772,73 @@ class WebApps { }); } + /** + * @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} [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. + */ + deleteSlot(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._deleteSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + /** * @summary Creates a new web, mobile, or API app in an existing resource * group, or updates an existing app. @@ -94988,7 +95969,7 @@ class WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -95080,6 +96061,11 @@ class WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -95121,7 +96107,13 @@ class WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -95156,6 +96148,9 @@ class WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -95216,20 +96211,14 @@ class WebApps { * 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 {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' * - * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned - * managed service identities. + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site * * @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. * @@ -95238,85 +96227,17 @@ class WebApps { * @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 {Site} - 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 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. - */ - createOrUpdateSlot(resourceGroupName, name, siteEnvelope, 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._createOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, options, optionalCallback); - } - } - - /** - * @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 - * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + updateSlotWithHttpOperationResponse(resourceGroupName, name, siteEnvelope, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._updateSlot(resourceGroupName, name, siteEnvelope, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -95326,73 +96247,6 @@ class WebApps { }); } - /** - * @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} [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. - */ - deleteSlot(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._deleteSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteSlot(resourceGroupName, name, slot, options, optionalCallback); - } - } - /** * @summary Creates a new web, mobile, or API app in an existing resource * group, or updates an existing app. @@ -95523,7 +96377,7 @@ class WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -95615,6 +96469,11 @@ class WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -95656,7 +96515,13 @@ class WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -95691,6 +96556,9 @@ class WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -95751,393 +96619,11 @@ class WebApps { * 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 - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - updateSlotWithHttpOperationResponse(resourceGroupName, name, siteEnvelope, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateSlot(resourceGroupName, name, siteEnvelope, 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 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] Obsolete: Hyper-V sandbox. - * - * @param {boolean} [siteEnvelope.hyperV] 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 {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided - * Azure storage accounts. - * - * @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 {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' * - * @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 {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -97635,6 +98121,11 @@ class WebApps { * More information on OpenID Connect: * http://openid.net/specs/openid-connect-core-1_0.html * + * @param {string} [siteAuthSettings.clientSecretCertificateThumbprint] An + * alternative to the client secret, that is the thumbprint of a certificate + * used for signing purposes. This property acts as + * a replacement for the Client Secret. It is also optional. + * * @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 @@ -97819,6 +98310,11 @@ class WebApps { * More information on OpenID Connect: * http://openid.net/specs/openid-connect-core-1_0.html * + * @param {string} [siteAuthSettings.clientSecretCertificateThumbprint] An + * alternative to the client secret, that is the thumbprint of a certificate + * used for signing purposes. This property acts as + * a replacement for the Client Secret. It is also optional. + * * @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 @@ -99338,445 +99834,7 @@ class WebApps { /** * @summary Gets the metadata of an app. * - * Gets the metadata of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the metadata 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. - */ - listMetadataSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetadataSlot(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 metadata of an app. - * - * Gets the metadata of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the metadata 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 {StringDictionary} - 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 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. - */ - listMetadataSlot(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._listMetadataSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetadataSlot(resourceGroupName, name, slot, options, optionalCallback); - } - } - - /** - * @summary Gets the Git/FTP publishing credentials 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 {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 - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listPublishingCredentialsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listPublishingCredentialsSlot(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 Git/FTP publishing credentials 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 {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} [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 {User} - 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 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. - */ - listPublishingCredentialsSlot(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._listPublishingCredentialsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listPublishingCredentialsSlot(resourceGroupName, name, slot, options, optionalCallback); - } - } - - /** - * @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. - * - * @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. - */ - updateSitePushSettingsSlotWithHttpOperationResponse(resourceGroupName, name, pushSettings, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, 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 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. - * - * @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. - */ - 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') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listSitePushSettingsSlot(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); - } - } - - /** - * @summary Gets a Swift Virtual Network connection. - * - * Gets a Swift Virtual Network connection. + * Gets the metadata of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -99784,8 +99842,7 @@ class WebApps { * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get a gateway for the production slot's Virtual - * Network. + * specified, the API will get the metadata for the production slot. * * @param {object} [options] Optional Parameters. * @@ -99794,15 +99851,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. */ - getSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + listMetadataSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._listMetadataSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -99813,9 +99870,9 @@ class WebApps { } /** - * @summary Gets a Swift Virtual Network connection. + * @summary Gets the metadata of an app. * - * Gets a Swift Virtual Network connection. + * Gets the metadata of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -99823,8 +99880,7 @@ class WebApps { * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get a gateway for the production slot's Virtual - * Network. + * specified, the API will get the metadata for the production slot. * * @param {object} [options] Optional Parameters. * @@ -99838,7 +99894,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {SwiftVirtualNetwork} - The deserialized result object. + * @resolve {StringDictionary} - The deserialized result object. * * @reject {Error} - The error object. * @@ -99847,13 +99903,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 SwiftVirtualNetwork} 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. */ - getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, optionalCallback) { + listMetadataSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -99862,47 +99918,30 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._listMetadataSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._listMetadataSlot(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. + * @summary Gets the Git/FTP publishing credentials 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. + * 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} 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. + * specified, the API will get the publishing credentials for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -99911,15 +99950,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. */ - createOrUpdateSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName, name, connectionEnvelope, slot, options) { + listPublishingCredentialsSlotWithHttpOperationResponse(resourceGroupName, name, 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) => { + self._listPublishingCredentialsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -99930,35 +99969,18 @@ class WebApps { } /** - * @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. + * @summary Gets the Git/FTP publishing credentials 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. + * 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} 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. + * specified, the API will get the publishing credentials for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -99972,7 +99994,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {SwiftVirtualNetwork} - The deserialized result object. + * @resolve {User} - The deserialized result object. * * @reject {Error} - The error object. * @@ -99981,13 +100003,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 SwiftVirtualNetwork} 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. */ - createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, optionalCallback) { + listPublishingCredentialsSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -99996,30 +100018,51 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, (err, result, request, response) => { + self._listPublishingCredentialsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, optionalCallback); + return self._listPublishingCredentialsSlot(resourceGroupName, name, slot, options, optionalCallback); } } /** - * @summary Deletes a Swift Virtual Network connection from an app (or - * deployment slot). + * @summary Updates the Push settings associated with web app. * - * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * 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 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 connection for the production slot. + * @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. * * @param {object} [options] Optional Parameters. * @@ -100028,15 +100071,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. */ - deleteSwiftVirtualNetworkSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + updateSitePushSettingsSlotWithHttpOperationResponse(resourceGroupName, name, pushSettings, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -100047,18 +100090,39 @@ class WebApps { } /** - * @summary Deletes a Swift Virtual Network connection from an app (or - * deployment slot). + * @summary Updates the Push settings associated with web app. * - * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * 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 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 connection for the production slot. + * @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. * * @param {object} [options] Optional Parameters. * @@ -100072,7 +100136,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {PushSettings} - The deserialized result object. * * @reject {Error} - The error object. * @@ -100080,13 +100144,14 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link 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. */ - deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, options, optionalCallback) { + updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -100095,47 +100160,29 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, 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. + * @summary Gets the Push settings associated with web 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. + * 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 {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} name Name of web app. * - * @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 {string} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -100144,15 +100191,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. */ - updateSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName, name, connectionEnvelope, slot, options) { + listSitePushSettingsSlotWithHttpOperationResponse(resourceGroupName, name, 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) => { + self._listSitePushSettingsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -100163,35 +100210,17 @@ class WebApps { } /** - * @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. + * @summary Gets the Push settings associated with web 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. + * 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 {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} name Name of web app. * - * @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 {string} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -100205,7 +100234,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {SwiftVirtualNetwork} - The deserialized result object. + * @resolve {PushSettings} - The deserialized result object. * * @reject {Error} - The error object. * @@ -100214,13 +100243,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 SwiftVirtualNetwork} 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. */ - updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, optionalCallback) { + listSitePushSettingsSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -100229,14 +100258,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, 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._updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, optionalCallback); + return self._listSitePushSettingsSlot(resourceGroupName, name, slot, options, optionalCallback); } } @@ -100437,7 +100466,281 @@ class WebApps { * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' * - * @param {object} [siteConfig.experiments] This is work around for polymophic + * @param {object} [siteConfig.experiments] This is work around for polymorphic + * 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 {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * + * @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 + * for main. + * + * @param {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * + * @param {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. + * + * @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 configuration 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. + */ + createOrUpdateConfigurationSlotWithHttpOperationResponse(resourceGroupName, name, siteConfig, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, 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 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 {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @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 polymorphic * types. * * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. @@ -100519,6 +100822,11 @@ class WebApps { * origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteConfig.push] Push endpoint settings. * * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag @@ -100558,269 +100866,14 @@ class WebApps { * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed * Service Identity Id * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions + * for main. * - * @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 configuration 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. - */ - createOrUpdateConfigurationSlotWithHttpOperationResponse(resourceGroupName, name, siteConfig, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, 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 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 {object} [siteConfig.azureStorageAccounts] User-provided Azure - * storage accounts. - * - * @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.scmIpSecurityRestrictions] IP security + * restrictions for scm. * - * @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.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web * site to allow clients to connect over http2.0 @@ -100983,7 +101036,7 @@ class WebApps { * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' * - * @param {object} [siteConfig.experiments] This is work around for polymophic + * @param {object} [siteConfig.experiments] This is work around for polymorphic * types. * * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. @@ -101065,6 +101118,11 @@ class WebApps { * origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteConfig.push] Push endpoint settings. * * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag @@ -101104,7 +101162,14 @@ class WebApps { * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed * Service Identity Id * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions + * for main. + * + * @param {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * + * @param {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web * site to allow clients to connect over http2.0 @@ -101245,7 +101310,7 @@ class WebApps { * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', * 'WeightedTotalTraffic', 'RequestHash' * - * @param {object} [siteConfig.experiments] This is work around for polymophic + * @param {object} [siteConfig.experiments] This is work around for polymorphic * types. * * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. @@ -101327,6 +101392,11 @@ class WebApps { * origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteConfig.cors.supportCredentials] Gets or sets whether + * CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteConfig.push] Push endpoint settings. * * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag @@ -101366,7 +101436,14 @@ class WebApps { * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed * Service Identity Id * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions + * for main. + * + * @param {array} [siteConfig.scmIpSecurityRestrictions] IP security + * restrictions for scm. + * + * @param {boolean} [siteConfig.scmIpSecurityRestrictionsUseMain] IP security + * restrictions for scm to use main. * * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web * site to allow clients to connect over http2.0 @@ -107550,39 +107627,482 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + self._listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get process information 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. + * + * @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. + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceProcessModuleSlotWithHttpOperationResponse(resourceGroupName, name, processId, baseAddress, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get process information 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. + * + * @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. + * + * @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 + * + * @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 {ProcessModuleInfo} - 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 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. + */ + getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, 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._getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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} 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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listInstanceProcessThreadsSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, 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 the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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} 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 + * + * @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 {ProcessThreadInfoCollection} - 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 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. + */ + listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, 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._listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @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. + * + * @param {string} name Site name. + * + * @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. + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceProcessThreadSlotWithHttpOperationResponse(resourceGroupName, name, processId, threadId, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get 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. + * + * @param {string} name Site name. + * + * @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. + * + * @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 + * + * @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 {ProcessThreadInfo} - 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 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. + */ + getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, 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._getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Shows whether an app can be cloned to another resource group or + * 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 the app. + * + * @param {string} slot Name of the deployment slot. By default, this API + * returns information on 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. + */ + isCloneableSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._isCloneableSlot(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 Shows whether an app can be cloned to another resource group or + * 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 the app. + * + * @param {string} slot Name of the deployment slot. By default, this API + * returns information on 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 {SiteCloneability} - 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 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. + */ + isCloneableSlot(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._isCloneableSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); + return self._isCloneableSlot(resourceGroupName, name, slot, options, optionalCallback); } } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary 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. + * 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 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 restore a backup of the production slot. * * @param {object} [options] Optional Parameters. * @@ -107591,15 +108111,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. */ - getInstanceProcessModuleSlotWithHttpOperationResponse(resourceGroupName, name, processId, baseAddress, slot, instanceId, options) { + listSyncFunctionTriggersSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, (err, result, request, response) => { + self._listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -107610,27 +108130,17 @@ class WebApps { } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary 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. + * 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 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 restore a backup of the production slot. * * @param {object} [options] Optional Parameters. * @@ -107644,7 +108154,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {ProcessModuleInfo} - The deserialized result object. + * @resolve {FunctionSecrets} - The deserialized result object. * * @reject {Error} - The error object. * @@ -107653,13 +108163,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 ProcessModuleInfo} 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. */ - getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, optionalCallback) { + listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -107668,37 +108178,30 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, (err, result, request, response) => { + self._listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, optionalCallback); + return self._listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, optionalCallback); } } /** - * @summary List the threads in 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 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). * * @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. * @@ -107707,15 +108210,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. */ - listInstanceProcessThreadsSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { + listMetricDefinitionsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + self._listMetricDefinitionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -107726,25 +108229,18 @@ class WebApps { } /** - * @summary List the threads in 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 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). * * @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. * @@ -107758,7 +108254,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {ProcessThreadInfoCollection} - The deserialized result object. + * @resolve {ResourceMetricDefinitionCollection} - The deserialized result object. * * @reject {Error} - The error object. * @@ -107767,14 +108263,14 @@ class WebApps { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfoCollection} 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. */ - listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback) { + listMetricDefinitionsSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -107783,56 +108279,55 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + self._listMetricDefinitionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); + return self._listMetricDefinitionsSlot(resourceGroupName, name, slot, options, optionalCallback); } } /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. + * @summary 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. + * 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} 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. - * - * @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 * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getInstanceProcessThreadSlotWithHttpOperationResponse(resourceGroupName, name, processId, threadId, slot, instanceId, options) { + listMetricsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, (err, result, request, response) => { + self._listMetricsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -107843,30 +108338,29 @@ class WebApps { } /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. + * @summary 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. + * 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} 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. - * - * @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 * @@ -107877,7 +108371,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {ProcessThreadInfo} - The deserialized result object. + * @resolve {ResourceMetricCollection} - The deserialized result object. * * @reject {Error} - The error object. * @@ -107886,13 +108380,14 @@ class WebApps { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfo} 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. */ - getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, optionalCallback) { + listMetricsSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -107901,31 +108396,30 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, (err, result, request, response) => { + self._listMetricsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, optionalCallback); + return self._listMetricsSlot(resourceGroupName, name, slot, options, optionalCallback); } } /** - * @summary Shows whether an app can be cloned to another resource group or - * subscription. + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled * - * Shows whether an app can be cloned to another resource group or - * subscription. + * 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 the app. + * @param {string} name Name of web app. * - * @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. * * @param {object} [options] Optional Parameters. * @@ -107934,15 +108428,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. */ - isCloneableSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + getMigrateMySqlStatusSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._isCloneableSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -107953,19 +108447,18 @@ class WebApps { } /** - * @summary Shows whether an app can be cloned to another resource group or - * subscription. + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled * - * Shows whether an app can be cloned to another resource group or - * subscription. + * 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 the app. + * @param {string} name Name of web app. * - * @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. * * @param {object} [options] Optional Parameters. * @@ -107979,7 +108472,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {SiteCloneability} - The deserialized result object. + * @resolve {MigrateMySqlStatus} - The deserialized result object. * * @reject {Error} - The error object. * @@ -107988,13 +108481,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 SiteCloneability} 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. */ - isCloneableSlot(resourceGroupName, name, slot, options, optionalCallback) { + getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -108003,21 +108496,21 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._isCloneableSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._isCloneableSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, optionalCallback); } } /** - * @summary This is to allow calling via powershell and ARM template. + * @summary Gets a Swift Virtual Network connection. * - * This is to allow calling via powershell and ARM template. + * Gets a Swift Virtual Network connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -108025,7 +108518,8 @@ class WebApps { * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will restore a backup of the production slot. + * specified, the API will get a gateway for the production slot's Virtual + * Network. * * @param {object} [options] Optional Parameters. * @@ -108034,15 +108528,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. */ - listSyncFunctionTriggersSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + getSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listSyncFunctionTriggersSlot(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); } @@ -108053,9 +108547,9 @@ class WebApps { } /** - * @summary This is to allow calling via powershell and ARM template. + * @summary Gets a Swift Virtual Network connection. * - * This is to allow calling via powershell and ARM template. + * Gets a Swift Virtual Network connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -108063,7 +108557,8 @@ class WebApps { * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will restore a backup of the production slot. + * specified, the API will get a gateway for the production slot's Virtual + * Network. * * @param {object} [options] Optional Parameters. * @@ -108077,7 +108572,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {FunctionSecrets} - The deserialized result object. + * @resolve {SwiftVirtualNetwork} - The deserialized result object. * * @reject {Error} - The error object. * @@ -108086,13 +108581,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 FunctionSecrets} 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. */ - listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, optionalCallback) { + getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -108101,30 +108596,47 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listSyncFunctionTriggersSlot(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._listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, optionalCallback); } } /** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). + * @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 all metric definitions of an app (or deployment slot, if specified). + * 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 metric definitions of the production slot. + * specified, the API will add or update connections for the production slot. * * @param {object} [options] Optional Parameters. * @@ -108133,15 +108645,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. */ - listMetricDefinitionsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + createOrUpdateSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName, name, connectionEnvelope, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listMetricDefinitionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + 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); } @@ -108152,18 +108664,35 @@ class WebApps { } /** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). + * @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 all metric definitions of an app (or deployment slot, if specified). + * 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 metric definitions of the production slot. + * specified, the API will add or update connections for the production slot. * * @param {object} [options] Optional Parameters. * @@ -108177,7 +108706,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {ResourceMetricDefinitionCollection} - The deserialized result object. + * @resolve {SwiftVirtualNetwork} - The deserialized result object. * * @reject {Error} - The error object. * @@ -108186,14 +108715,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 ResourceMetricDefinitionCollection} 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. */ - listMetricDefinitionsSlot(resourceGroupName, name, slot, options, optionalCallback) { + createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -108202,22 +108730,22 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listMetricDefinitionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listMetricDefinitionsSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, optionalCallback); } } /** - * @summary Gets performance metrics of an app (or deployment slot, if - * specified). + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). * - * Gets performance metrics of an app (or deployment slot, if specified). + * 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. @@ -108225,32 +108753,24 @@ class WebApps { * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get metrics of the production slot. + * specified, the API will delete the connection for 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 * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listMetricsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + deleteSwiftVirtualNetworkSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listMetricsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -108261,10 +108781,10 @@ class WebApps { } /** - * @summary Gets performance metrics of an app (or deployment slot, if - * specified). + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). * - * Gets performance metrics of an app (or deployment slot, if specified). + * 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. @@ -108272,18 +108792,10 @@ class WebApps { * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get metrics of the production slot. + * specified, the API will delete the connection for 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 * @@ -108294,7 +108806,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {ResourceMetricCollection} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -108302,15 +108814,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 ResourceMetricCollection} 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. */ - listMetricsSlot(resourceGroupName, name, slot, options, optionalCallback) { + deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -108319,30 +108829,47 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listMetricsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listMetricsSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, options, optionalCallback); } } /** - * @summary Returns the status of MySql in app migration, if one is active, and - * whether or not MySql in app is enabled + * @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. * - * Returns the status of MySql in app migration, if one is active, and whether - * or not MySql in app is enabled + * 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 web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of the deployment slot. + * @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. * @@ -108351,15 +108878,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. */ - getMigrateMySqlStatusSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + updateSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName, name, connectionEnvelope, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + 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); } @@ -108370,18 +108897,35 @@ class WebApps { } /** - * @summary Returns the status of MySql in app migration, if one is active, and - * whether or not MySql in app is enabled + * @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. * - * Returns the status of MySql in app migration, if one is active, and whether - * or not MySql in app is enabled + * 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 web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of the deployment slot. + * @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. * @@ -108395,7 +108939,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {MigrateMySqlStatus} - The deserialized result object. + * @resolve {SwiftVirtualNetwork} - The deserialized result object. * * @reject {Error} - The error object. * @@ -108404,13 +108948,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 MigrateMySqlStatus} 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. */ - getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, optionalCallback) { + updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -108419,14 +108963,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, optionalCallback); } } @@ -108562,7 +109106,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. */ @@ -108609,7 +109153,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -108617,7 +109161,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -108781,7 +109325,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. */ @@ -108831,7 +109375,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -108839,7 +109383,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -109089,7 +109633,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. */ @@ -109136,7 +109680,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -109144,7 +109688,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -112205,58 +112749,64 @@ class WebApps { * 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. - */ - restoreFromDeletedAppSlotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - 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); } - 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 {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + restoreFromDeletedAppSlotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + 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); } + 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 {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. * * @param {string} [restoreRequest.kind] Kind of resource. * @@ -112350,6 +112900,9 @@ class WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -112421,6 +112974,9 @@ class WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -113210,6 +113766,102 @@ class WebApps { } } + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @param {string} slot Website Slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listSnapshotsFromDRSecondarySlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSnapshotsFromDRSecondarySlot(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 Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @param {string} slot Website Slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SnapshotCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listSnapshotsFromDRSecondarySlot(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._listSnapshotsFromDRSecondarySlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSnapshotsFromDRSecondarySlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + /** * @summary Gets the source control configuration of an app. * @@ -113821,7 +114473,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. */ @@ -113871,7 +114523,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -113879,7 +114531,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -115262,6 +115914,9 @@ class WebApps { * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by * this Virtual Network. This should be a comma-separated list of IP addresses. * + * @param {boolean} [connectionEnvelope.isSwift] Flag that is used to denote if + * this is VNET injection + * * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -115319,6 +115974,9 @@ class WebApps { * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by * this Virtual Network. This should be a comma-separated list of IP addresses. * + * @param {boolean} [connectionEnvelope.isSwift] Flag that is used to denote if + * this is VNET injection + * * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -115503,6 +116161,9 @@ class WebApps { * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by * this Virtual Network. This should be a comma-separated list of IP addresses. * + * @param {boolean} [connectionEnvelope.isSwift] Flag that is used to denote if + * this is VNET injection + * * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -115560,6 +116221,9 @@ class WebApps { * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by * this Virtual Network. This should be a comma-separated list of IP addresses. * + * @param {boolean} [connectionEnvelope.isSwift] Flag that is used to denote if + * this is VNET injection + * * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -116213,15 +116877,127 @@ 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. + */ + listSlotDifferencesFromProductionWithHttpOperationResponse(resourceGroupName, name, slotSwapEntity, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SlotDifferenceCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SlotDifferenceCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, 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._listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, options, optionalCallback); + } + } + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {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. */ - listSlotDifferencesFromProductionWithHttpOperationResponse(resourceGroupName, name, slotSwapEntity, options) { + swapSlotWithProductionWithHttpOperationResponse(resourceGroupName, name, slotSwapEntity, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, options, (err, result, request, response) => { + self._swapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -116232,10 +117008,9 @@ class WebApps { } /** - * @summary Get the difference in configuration settings between two web app - * slots. + * @summary Swaps two deployment slots of an app. * - * Get the difference in configuration settings between two web app slots. + * Swaps two deployment slots of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -116263,7 +117038,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {SlotDifferenceCollection} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -116271,15 +117046,13 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SlotDifferenceCollection} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, options, optionalCallback) { + swapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -116288,35 +117061,26 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, options, (err, result, request, response) => { + self._swapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, options, optionalCallback); + return self._swapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, optionalCallback); } } /** - * @summary Swaps two deployment slots of an app. + * @summary Returns all Snapshots to the user. * - * Swaps two deployment slots of an app. + * Returns all Snapshots to the user. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {object} slotSwapEntity JSON object that contains the target slot - * name. See example. - * - * @param {string} slotSwapEntity.targetSlot Destination deployment slot during - * swap operation. - * - * @param {boolean} slotSwapEntity.preserveVnet true to preserve - * Virtual Network to the slot during swap; otherwise, false. + * @param {string} name Website Name. * * @param {object} [options] Optional Parameters. * @@ -116325,15 +117089,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. */ - swapSlotWithProductionWithHttpOperationResponse(resourceGroupName, name, slotSwapEntity, options) { + listSnapshotsWithHttpOperationResponse(resourceGroupName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._swapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, (err, result, request, response) => { + self._listSnapshots(resourceGroupName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -116344,23 +117108,14 @@ class WebApps { } /** - * @summary Swaps two deployment slots of an app. + * @summary Returns all Snapshots to the user. * - * Swaps two deployment slots of an app. + * Returns all Snapshots to the user. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. - * - * @param {object} slotSwapEntity JSON object that contains the target slot - * name. See example. - * - * @param {string} slotSwapEntity.targetSlot Destination deployment slot during - * swap operation. - * - * @param {boolean} slotSwapEntity.preserveVnet true to preserve - * Virtual Network to the slot during swap; otherwise, false. + * @param {string} name Website Name. * * @param {object} [options] Optional Parameters. * @@ -116374,7 +117129,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {SnapshotCollection} - The deserialized result object. * * @reject {Error} - The error object. * @@ -116382,13 +117137,14 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - swapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, optionalCallback) { + listSnapshots(resourceGroupName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -116397,21 +117153,21 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._swapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, (err, result, request, response) => { + self._listSnapshots(resourceGroupName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._swapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, optionalCallback); + return self._listSnapshots(resourceGroupName, name, options, optionalCallback); } } /** - * @summary Returns all Snapshots to the user. + * @summary Returns all Snapshots to the user from DRSecondary endpoint. * - * Returns all Snapshots to the user. + * Returns all Snapshots to the user from DRSecondary endpoint. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -116429,11 +117185,11 @@ class WebApps { * * @reject {Error} - The error object. */ - listSnapshotsWithHttpOperationResponse(resourceGroupName, name, options) { + listSnapshotsFromDRSecondaryWithHttpOperationResponse(resourceGroupName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listSnapshots(resourceGroupName, name, options, (err, result, request, response) => { + self._listSnapshotsFromDRSecondary(resourceGroupName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -116444,9 +117200,9 @@ class WebApps { } /** - * @summary Returns all Snapshots to the user. + * @summary Returns all Snapshots to the user from DRSecondary endpoint. * - * Returns all Snapshots to the user. + * Returns all Snapshots to the user from DRSecondary endpoint. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -116480,7 +117236,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listSnapshots(resourceGroupName, name, options, optionalCallback) { + listSnapshotsFromDRSecondary(resourceGroupName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -116489,14 +117245,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listSnapshots(resourceGroupName, name, options, (err, result, request, response) => { + self._listSnapshotsFromDRSecondary(resourceGroupName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listSnapshots(resourceGroupName, name, options, optionalCallback); + return self._listSnapshotsFromDRSecondary(resourceGroupName, name, options, optionalCallback); } } @@ -117071,7 +117827,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. */ @@ -117119,7 +117875,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -117127,7 +117883,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -118430,6 +119186,9 @@ class WebApps { * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by * this Virtual Network. This should be a comma-separated list of IP addresses. * + * @param {boolean} [connectionEnvelope.isSwift] Flag that is used to denote if + * this is VNET injection + * * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -118484,180 +119243,186 @@ class WebApps { * @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 - * - * @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 {VnetInfo} - 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 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. - */ - createOrUpdateVnetConnection(resourceGroupName, name, vnetName, 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._createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, optionalCallback); - } - } - - /** - * @summary Deletes a connection from an app (or deployment slot to a named - * virtual network. - * - * Deletes a connection from an app (or deployment slot to a named virtual - * network. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} vnetName Name of the virtual network. - * - * @param {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. - */ - deleteVnetConnectionWithHttpOperationResponse(resourceGroupName, name, vnetName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteVnetConnection(resourceGroupName, name, vnetName, 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 connection from an app (or deployment slot to a named - * virtual network. - * - * Deletes a connection from an app (or deployment slot to a named virtual - * network. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} vnetName Name of the virtual network. - * - * @param {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. - */ - deleteVnetConnection(resourceGroupName, name, vnetName, 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._deleteVnetConnection(resourceGroupName, name, vnetName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteVnetConnection(resourceGroupName, name, vnetName, options, optionalCallback); - } - } - - /** - * @summary Adds a Virtual Network connection to an app or slot (PUT) or - * updates the connection properties (PATCH). - * - * Adds a Virtual Network connection to an app or slot (PUT) or updates the - * connection properties (PATCH). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} vnetName Name of 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 {boolean} [connectionEnvelope.isSwift] Flag that is used to denote if + * this is VNET injection + * + * @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 {VnetInfo} - 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 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. + */ + createOrUpdateVnetConnection(resourceGroupName, name, vnetName, 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._createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Deletes a connection from an app (or deployment slot to a named + * virtual network. + * + * Deletes a connection from an app (or deployment slot to a named virtual + * network. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @param {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. + */ + deleteVnetConnectionWithHttpOperationResponse(resourceGroupName, name, vnetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteVnetConnection(resourceGroupName, name, vnetName, 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 connection from an app (or deployment slot to a named + * virtual network. + * + * Deletes a connection from an app (or deployment slot to a named virtual + * network. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @param {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. + */ + deleteVnetConnection(resourceGroupName, name, vnetName, 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._deleteVnetConnection(resourceGroupName, name, vnetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteVnetConnection(resourceGroupName, name, vnetName, options, optionalCallback); + } + } + + /** + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of 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 {boolean} [connectionEnvelope.isSwift] Flag that is used to denote if + * this is VNET injection * * @param {string} [connectionEnvelope.kind] Kind of resource. * @@ -118713,6 +119478,9 @@ class WebApps { * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by * this Virtual Network. This should be a comma-separated list of IP addresses. * + * @param {boolean} [connectionEnvelope.isSwift] Flag that is used to denote if + * this is VNET injection + * * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -119430,7 +120198,7 @@ class WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -119522,6 +120290,11 @@ class WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -119563,7 +120336,13 @@ class WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -119598,6 +120377,9 @@ class WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -119658,6 +120440,12 @@ class WebApps { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service @@ -119827,7 +120615,7 @@ class WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -119919,6 +120707,11 @@ class WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -119960,7 +120753,13 @@ class WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -119995,6 +120794,9 @@ class WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -120055,6 +120857,12 @@ class WebApps { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service @@ -121101,7 +121909,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. */ @@ -121149,7 +121957,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -121157,7 +121965,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -121377,6 +122185,9 @@ class WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -121427,6 +122238,9 @@ class WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -121516,73 +122330,79 @@ class WebApps { * 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 - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - beginRestoreSnapshotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginRestoreSnapshot(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 web app from a snapshot. - * - * Restores a web app from a snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} restoreRequest Snapshot restore settings. Snapshot - * information can be obtained by calling GetDeletedSites or GetSiteSnapshots - * API. - * - * @param {string} [restoreRequest.snapshotTime] Point in time in which the app - * restore should be done, formatted as a DateTime string. - * - * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web - * app that snapshot contents will be retrieved from. - * If empty, the targeted web app will be used as the source. - * - * @param {string} [restoreRequest.recoverySource.location] Geographical - * location of the source web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the - * source app. - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} - * for production slots and - * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} - * for other slots. - * - * @param {boolean} restoreRequest.overwrite If true the restore - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [restoreRequest.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom - * hostname conflicts will be ignored when recovering to a target web app. - * This setting is only necessary when RecoverConfiguration is enabled. + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {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. + */ + beginRestoreSnapshotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRestoreSnapshot(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 web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. * * @param {string} [restoreRequest.kind] Kind of resource. * @@ -121858,7 +122678,7 @@ class WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -121950,6 +122770,11 @@ class WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -121991,7 +122816,13 @@ class WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -122026,6 +122857,9 @@ class WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -122086,6 +122920,12 @@ class WebApps { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service @@ -122258,7 +123098,7 @@ class WebApps { * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' * * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * for polymorphic types. * * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of * ramp-up rules. @@ -122350,6 +123190,11 @@ class WebApps { * the list of origins that should be allowed to make cross-origin * calls (for example: http://example.com:12345). Use "*" to allow all. * + * @param {boolean} [siteEnvelope.siteConfig.cors.supportCredentials] Gets or + * sets whether CORS requests with credentials are allowed. See + * https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + * for more details. + * * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. * * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a @@ -122391,7 +123236,13 @@ class WebApps { * Managed Service Identity Id * * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * restrictions for main. + * + * @param {array} [siteEnvelope.siteConfig.scmIpSecurityRestrictions] IP + * security restrictions for scm. + * + * @param {boolean} [siteEnvelope.siteConfig.scmIpSecurityRestrictionsUseMain] + * IP security restrictions for scm to use main. * * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: * configures a web site to allow clients to connect over http2.0 @@ -122426,6 +123277,9 @@ class WebApps { * enable client certificate authentication (TLS mutual authentication); * otherwise, false. Default is false. * + * @param {string} [siteEnvelope.clientCertExclusionPaths] client certificate + * authentication comma-separated exclusion paths + * * @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. @@ -122486,6 +123340,12 @@ class WebApps { * to accept only https requests. Issues redirect for * http requests * + * @param {string} [siteEnvelope.redundancyMode] Site redundancy mode. Possible + * values include: 'None', 'Manual', 'Failover', 'ActiveActive', 'GeoRedundant' + * + * @param {array} [siteEnvelope.geoDistributions] GeoDistributions for this + * site + * * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service @@ -123322,7 +124182,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. */ @@ -123372,7 +124232,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -123380,7 +124240,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -123606,6 +124466,9 @@ class WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -123659,6 +124522,9 @@ class WebApps { * deleted app from, formatted as a DateTime string. * If unspecified, default value is the time that the app was deleted. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -123751,6 +124617,9 @@ class WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -123822,6 +124691,9 @@ class WebApps { * hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * + * @param {boolean} [restoreRequest.useDRSecondary] If true, the snapshot is + * retrieved from DRSecondary endpoint. + * * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -124261,7 +125133,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. */ @@ -124311,7 +125183,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -124319,7 +125191,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -124615,7 +125487,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. */ @@ -124663,7 +125535,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {Array} - The deserialized result object. * * @reject {Error} - The error object. * @@ -124671,7 +125543,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {array} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -128754,6 +129626,94 @@ class WebApps { } } + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listSnapshotsFromDRSecondarySlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSnapshotsFromDRSecondarySlotNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SnapshotCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listSnapshotsFromDRSecondarySlotNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSnapshotsFromDRSecondarySlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSnapshotsFromDRSecondarySlotNext(nextPageLink, options, optionalCallback); + } + } + /** * @summary List triggered web jobs for an app, or a deployment slot. * @@ -129294,6 +130254,94 @@ class WebApps { } } + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listSnapshotsFromDRSecondaryNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSnapshotsFromDRSecondaryNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Returns all Snapshots to the user from DRSecondary endpoint. + * + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SnapshotCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listSnapshotsFromDRSecondaryNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSnapshotsFromDRSecondaryNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSnapshotsFromDRSecondaryNext(nextPageLink, options, optionalCallback); + } + } + /** * @summary List triggered web jobs for an app, or a deployment slot. * diff --git a/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts b/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts index a8ea986272..b41019ef5d 100644 --- a/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts +++ b/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts @@ -47,8 +47,6 @@ export default class WebSiteManagementClient extends AzureServiceClient { subscriptionId: string; - apiVersion: string; - acceptLanguage: string; longRunningOperationRetryTimeout: number; @@ -1048,7 +1046,7 @@ export default class WebSiteManagementClient extends AzureServiceClient { * plan is for Spot instances; otherwise, false. * * @param {number} [validateRequest.capacity] Target capacity of the App - * Service plan (number of VM's). + * Service plan (number of VMs). * * @param {string} [validateRequest.hostingEnvironment] Name of App Service * Environment where app or App Service plan should be created. @@ -1099,7 +1097,7 @@ export default class WebSiteManagementClient extends AzureServiceClient { * plan is for Spot instances; otherwise, false. * * @param {number} [validateRequest.capacity] Target capacity of the App - * Service plan (number of VM's). + * Service plan (number of VMs). * * @param {string} [validateRequest.hostingEnvironment] Name of App Service * Environment where app or App Service plan should be created. @@ -1139,6 +1137,104 @@ export default class WebSiteManagementClient extends AzureServiceClient { validate(resourceGroupName: string, validateRequest: models.ValidateRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Validate if the container settings are correct. + * + * Validate if the container settings are correct. + * + * @param {object} validateContainerSettingsRequest + * + * @param {string} [validateContainerSettingsRequest.baseUrl] Base URL of the + * container registry + * + * @param {string} [validateContainerSettingsRequest.username] Username for to + * access the container registry + * + * @param {string} [validateContainerSettingsRequest.password] Password for to + * access the container registry + * + * @param {string} [validateContainerSettingsRequest.repository] Repository + * name (image name) + * + * @param {string} [validateContainerSettingsRequest.tag] Image tag + * + * @param {string} [validateContainerSettingsRequest.platform] Platform + * (windows or linux) + * + * @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. + */ + validateContainerSettingsWithHttpOperationResponse(validateContainerSettingsRequest: models.ValidateContainerSettingsRequest, resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Validate if the container settings are correct. + * + * Validate if the container settings are correct. + * + * @param {object} validateContainerSettingsRequest + * + * @param {string} [validateContainerSettingsRequest.baseUrl] Base URL of the + * container registry + * + * @param {string} [validateContainerSettingsRequest.username] Username for to + * access the container registry + * + * @param {string} [validateContainerSettingsRequest.password] Password for to + * access the container registry + * + * @param {string} [validateContainerSettingsRequest.repository] Repository + * name (image name) + * + * @param {string} [validateContainerSettingsRequest.tag] Image tag + * + * @param {string} [validateContainerSettingsRequest.platform] Platform + * (windows or linux) + * + * @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 {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. + */ + validateContainerSettings(validateContainerSettingsRequest: models.ValidateContainerSettingsRequest, resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + validateContainerSettings(validateContainerSettingsRequest: models.ValidateContainerSettingsRequest, resourceGroupName: string, callback: ServiceCallback): void; + validateContainerSettings(validateContainerSettingsRequest: models.ValidateContainerSettingsRequest, resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Validate whether a resource can be moved. * diff --git a/lib/services/websiteManagement2/lib/webSiteManagementClient.js b/lib/services/websiteManagement2/lib/webSiteManagementClient.js index 72bc864f4b..ad573e5d17 100644 --- a/lib/services/websiteManagement2/lib/webSiteManagementClient.js +++ b/lib/services/websiteManagement2/lib/webSiteManagementClient.js @@ -56,11 +56,9 @@ function _getPublishingUser(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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.'); } @@ -72,7 +70,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(this.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -205,14 +203,12 @@ function _updatePublishingUser(userDetails, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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.'); } @@ -224,7 +220,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(this.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -355,11 +351,9 @@ function _listSourceControls(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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.'); } @@ -371,7 +365,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(this.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -489,14 +483,12 @@ function _getSourceControl(sourceControlType, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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.'); } @@ -509,7 +501,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(this.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -639,6 +631,7 @@ function _updateSourceControl(sourceControlType, requestMessage, options, callba if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (sourceControlType === null || sourceControlType === undefined || typeof sourceControlType.valueOf() !== 'string') { @@ -647,9 +640,6 @@ 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.'); } @@ -662,7 +652,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(this.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -800,6 +790,7 @@ function _listBillingMeters(options, callback) { } let billingLocation = (options && options.billingLocation !== undefined) ? options.billingLocation : undefined; let osType = (options && options.osType !== undefined) ? options.osType : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (billingLocation !== null && billingLocation !== undefined && typeof billingLocation.valueOf() !== 'string') { @@ -811,9 +802,6 @@ function _listBillingMeters(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.'); } @@ -832,7 +820,7 @@ function _listBillingMeters(options, callback) { if (osType !== null && osType !== undefined) { queryParameters.push('osType=' + encodeURIComponent(osType)); } - queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -959,14 +947,12 @@ function _checkNameAvailability(name, type, options, callback) { throw new Error('callback cannot be null.'); } let isFqdn = (options && options.isFqdn !== undefined) ? options.isFqdn : undefined; + let apiVersion = '2018-02-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.'); } @@ -995,7 +981,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(this.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1125,14 +1111,12 @@ function _getSubscriptionDeploymentLocations(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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.'); } @@ -1145,7 +1129,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(this.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1279,6 +1263,7 @@ function _listGeoRegions(options, callback) { let linuxWorkersEnabled = (options && options.linuxWorkersEnabled !== undefined) ? options.linuxWorkersEnabled : undefined; let xenonWorkersEnabled = (options && options.xenonWorkersEnabled !== undefined) ? options.xenonWorkersEnabled : undefined; let linuxDynamicWorkersEnabled = (options && options.linuxDynamicWorkersEnabled !== undefined) ? options.linuxDynamicWorkersEnabled : undefined; + let apiVersion = '2018-02-01'; // Validate try { if (sku !== null && sku !== undefined && typeof sku.valueOf() !== 'string') { @@ -1296,9 +1281,6 @@ function _listGeoRegions(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.'); } @@ -1323,7 +1305,7 @@ function _listGeoRegions(options, callback) { if (linuxDynamicWorkersEnabled !== null && linuxDynamicWorkersEnabled !== undefined) { queryParameters.push('linuxDynamicWorkersEnabled=' + encodeURIComponent(linuxDynamicWorkersEnabled.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1442,14 +1424,12 @@ function _listSiteIdentifiersAssignedToHostName(options, callback) { throw new Error('callback cannot be null.'); } let name = (options && options.name !== undefined) ? options.name : undefined; + let apiVersion = '2018-02-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.'); } @@ -1470,7 +1450,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(this.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1601,14 +1581,12 @@ function _listPremierAddOnOffers(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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.'); } @@ -1621,7 +1599,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(this.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1737,14 +1715,12 @@ function _listSkus(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-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.'); } @@ -1757,7 +1733,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(this.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1887,6 +1863,7 @@ function _verifyHostingEnvironmentVnet(parameters, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (parameters === null || parameters === undefined) { @@ -1895,9 +1872,6 @@ 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.'); } @@ -1910,7 +1884,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(this.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2049,6 +2023,7 @@ function _move(resourceGroupName, moveResourceEnvelope, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2074,9 +2049,6 @@ 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.'); } @@ -2090,7 +2062,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(this.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2199,7 +2171,7 @@ function _move(resourceGroupName, moveResourceEnvelope, options, callback) { * plan is for Spot instances; otherwise, false. * * @param {number} [validateRequest.capacity] Target capacity of the App - * Service plan (number of VM's). + * Service plan (number of VMs). * * @param {string} [validateRequest.hostingEnvironment] Name of App Service * Environment where app or App Service plan should be created. @@ -2235,6 +2207,7 @@ function _validate(resourceGroupName, validateRequest, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2260,9 +2233,6 @@ 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.'); } @@ -2276,7 +2246,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(this.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2373,6 +2343,202 @@ function _validate(resourceGroupName, validateRequest, options, callback) { }); } +/** + * @summary Validate if the container settings are correct. + * + * Validate if the container settings are correct. + * + * @param {object} validateContainerSettingsRequest + * + * @param {string} [validateContainerSettingsRequest.baseUrl] Base URL of the + * container registry + * + * @param {string} [validateContainerSettingsRequest.username] Username for to + * access the container registry + * + * @param {string} [validateContainerSettingsRequest.password] Password for to + * access the container registry + * + * @param {string} [validateContainerSettingsRequest.repository] Repository + * name (image name) + * + * @param {string} [validateContainerSettingsRequest.tag] Image tag + * + * @param {string} [validateContainerSettingsRequest.platform] Platform + * (windows or linux) + * + * @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 {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 _validateContainerSettings(validateContainerSettingsRequest, resourceGroupName, 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 apiVersion = '2018-02-01'; + // Validate + try { + if (validateContainerSettingsRequest === null || validateContainerSettingsRequest === undefined) { + throw new Error('validateContainerSettingsRequest cannot be null or undefined.'); + } + 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 (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.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validateContainerSettings'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.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.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]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (validateContainerSettingsRequest !== null && validateContainerSettingsRequest !== undefined) { + let requestModelMapper = new client.models['ValidateContainerSettingsRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, validateContainerSettingsRequest, 'validateContainerSettingsRequest'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(validateContainerSettingsRequest, 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Object' + } + }; + 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 Validate whether a resource can be moved. * @@ -2415,6 +2581,7 @@ function _validateMove(resourceGroupName, moveResourceEnvelope, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2440,9 +2607,6 @@ 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.'); } @@ -2456,7 +2620,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(this.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3216,7 +3380,6 @@ class WebSiteManagementClient extends ServiceClient { super(credentials, options); - this.apiVersion = '2018-02-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -3268,6 +3431,7 @@ class WebSiteManagementClient extends ServiceClient { this._verifyHostingEnvironmentVnet = _verifyHostingEnvironmentVnet; this._move = _move; this._validate = _validate; + this._validateContainerSettings = _validateContainerSettings; this._validateMove = _validateMove; this._listSourceControlsNext = _listSourceControlsNext; this._listBillingMetersNext = _listBillingMetersNext; @@ -4631,7 +4795,7 @@ class WebSiteManagementClient extends ServiceClient { * plan is for Spot instances; otherwise, false. * * @param {number} [validateRequest.capacity] Target capacity of the App - * Service plan (number of VM's). + * Service plan (number of VMs). * * @param {string} [validateRequest.hostingEnvironment] Name of App Service * Environment where app or App Service plan should be created. @@ -4694,7 +4858,7 @@ class WebSiteManagementClient extends ServiceClient { * plan is for Spot instances; otherwise, false. * * @param {number} [validateRequest.capacity] Target capacity of the App - * Service plan (number of VM's). + * Service plan (number of VMs). * * @param {string} [validateRequest.hostingEnvironment] Name of App Service * Environment where app or App Service plan should be created. @@ -4749,6 +4913,131 @@ class WebSiteManagementClient extends ServiceClient { } } + /** + * @summary Validate if the container settings are correct. + * + * Validate if the container settings are correct. + * + * @param {object} validateContainerSettingsRequest + * + * @param {string} [validateContainerSettingsRequest.baseUrl] Base URL of the + * container registry + * + * @param {string} [validateContainerSettingsRequest.username] Username for to + * access the container registry + * + * @param {string} [validateContainerSettingsRequest.password] Password for to + * access the container registry + * + * @param {string} [validateContainerSettingsRequest.repository] Repository + * name (image name) + * + * @param {string} [validateContainerSettingsRequest.tag] Image tag + * + * @param {string} [validateContainerSettingsRequest.platform] Platform + * (windows or linux) + * + * @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} - The error object. + */ + validateContainerSettingsWithHttpOperationResponse(validateContainerSettingsRequest, resourceGroupName, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._validateContainerSettings(validateContainerSettingsRequest, resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Validate if the container settings are correct. + * + * Validate if the container settings are correct. + * + * @param {object} validateContainerSettingsRequest + * + * @param {string} [validateContainerSettingsRequest.baseUrl] Base URL of the + * container registry + * + * @param {string} [validateContainerSettingsRequest.username] Username for to + * access the container registry + * + * @param {string} [validateContainerSettingsRequest.password] Password for to + * access the container registry + * + * @param {string} [validateContainerSettingsRequest.repository] Repository + * name (image name) + * + * @param {string} [validateContainerSettingsRequest.tag] Image tag + * + * @param {string} [validateContainerSettingsRequest.platform] Platform + * (windows or linux) + * + * @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 {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 {Object} - 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. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + validateContainerSettings(validateContainerSettingsRequest, resourceGroupName, 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._validateContainerSettings(validateContainerSettingsRequest, resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._validateContainerSettings(validateContainerSettingsRequest, resourceGroupName, options, optionalCallback); + } + } + /** * @summary Validate whether a resource can be moved. *